aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/FunctionLoweringInfo.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/CodeGen/FunctionLoweringInfo.h')
-rw-r--r--include/llvm/CodeGen/FunctionLoweringInfo.h65
1 files changed, 15 insertions, 50 deletions
diff --git a/include/llvm/CodeGen/FunctionLoweringInfo.h b/include/llvm/CodeGen/FunctionLoweringInfo.h
index 7c658515de09..fb60191abd3a 100644
--- a/include/llvm/CodeGen/FunctionLoweringInfo.h
+++ b/include/llvm/CodeGen/FunctionLoweringInfo.h
@@ -1,9 +1,8 @@
//===- FunctionLoweringInfo.h - Lower functions from LLVM IR ---*- C++ -*--===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -14,13 +13,14 @@
#ifndef LLVM_CODEGEN_FUNCTIONLOWERINGINFO_H
#define LLVM_CODEGEN_FUNCTIONLOWERINGINFO_H
-
#include "llvm/ADT/APInt.h"
+#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/IndexedMap.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
+#include "llvm/Analysis/LegacyDivergenceAnalysis.h"
#include "llvm/CodeGen/ISDOpcodes.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
@@ -57,6 +57,7 @@ public:
const TargetLowering *TLI;
MachineRegisterInfo *RegInfo;
BranchProbabilityInfo *BPI;
+ const LegacyDivergenceAnalysis *DA;
/// CanLowerReturn - true iff the function's return value can be lowered to
/// registers.
bool CanLowerReturn;
@@ -71,48 +72,6 @@ public:
/// MBBMap - A mapping from LLVM basic blocks to their machine code entry.
DenseMap<const BasicBlock*, MachineBasicBlock *> MBBMap;
- /// A map from swifterror value in a basic block to the virtual register it is
- /// currently represented by.
- DenseMap<std::pair<const MachineBasicBlock *, const Value *>, unsigned>
- SwiftErrorVRegDefMap;
-
- /// A list of upward exposed vreg uses that need to be satisfied by either a
- /// copy def or a phi node at the beginning of the basic block representing
- /// the predecessor(s) swifterror value.
- DenseMap<std::pair<const MachineBasicBlock *, const Value *>, unsigned>
- SwiftErrorVRegUpwardsUse;
-
- /// A map from instructions that define/use a swifterror value to the virtual
- /// register that represents that def/use.
- llvm::DenseMap<PointerIntPair<const Instruction *, 1, bool>, unsigned>
- SwiftErrorVRegDefUses;
-
- /// The swifterror argument of the current function.
- const Value *SwiftErrorArg;
-
- using SwiftErrorValues = SmallVector<const Value*, 1>;
- /// A function can only have a single swifterror argument. And if it does
- /// have a swifterror argument, it must be the first entry in
- /// SwiftErrorVals.
- SwiftErrorValues SwiftErrorVals;
-
- /// Get or create the swifterror value virtual register in
- /// SwiftErrorVRegDefMap for this basic block.
- unsigned getOrCreateSwiftErrorVReg(const MachineBasicBlock *,
- const Value *);
-
- /// Set the swifterror virtual register in the SwiftErrorVRegDefMap for this
- /// basic block.
- void setCurrentSwiftErrorVReg(const MachineBasicBlock *MBB, const Value *,
- unsigned);
-
- /// Get or create the swifterror value virtual register for a def of a
- /// swifterror by an instruction.
- std::pair<unsigned, bool> getOrCreateSwiftErrorVRegDefAt(const Instruction *);
- std::pair<unsigned, bool>
- getOrCreateSwiftErrorVRegUseAt(const Instruction *, const MachineBasicBlock *,
- const Value *);
-
/// ValueMap - Since we emit code for the function a basic block at a time,
/// we must remember which virtual registers hold the values for
/// cross-basic-block values.
@@ -175,6 +134,10 @@ public:
/// function arguments that are inserted after scheduling is completed.
SmallVector<MachineInstr*, 8> ArgDbgValues;
+ /// Bitvector with a bit set if corresponding argument is described in
+ /// ArgDbgValues. Using arg numbers according to Argument numbering.
+ BitVector DescribedArgs;
+
/// RegFixups - Registers which need to be replaced after isel is done.
DenseMap<unsigned, unsigned> RegFixups;
@@ -236,9 +199,11 @@ public:
return ValueMap.count(V);
}
- unsigned CreateReg(MVT VT);
+ unsigned CreateReg(MVT VT, bool isDivergent = false);
+
+ unsigned CreateRegs(const Value *V);
- unsigned CreateRegs(Type *Ty);
+ unsigned CreateRegs(Type *Ty, bool isDivergent = false);
unsigned InitializeRegForValue(const Value *V) {
// Tokens never live in vregs.
@@ -247,7 +212,7 @@ public:
unsigned &R = ValueMap[V];
assert(R == 0 && "Already initialized this value register!");
assert(VirtReg2Value.empty());
- return R = CreateRegs(V->getType());
+ return R = CreateRegs(V);
}
/// GetLiveOutRegInfo - Gets LiveOutInfo for a register, returning NULL if the