[llvm] 9c1842d - Change FastISel::CallLoweringInfo::CS to be an ImmutableCallSite instead of a pointer. NFCI.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 10 23:50:09 PDT 2020
Author: Craig Topper
Date: 2020-04-10T23:45:36-07:00
New Revision: 9c1842d8aff9196441555fd16001ee205fdf0acd
URL: https://github.com/llvm/llvm-project/commit/9c1842d8aff9196441555fd16001ee205fdf0acd
DIFF: https://github.com/llvm/llvm-project/commit/9c1842d8aff9196441555fd16001ee205fdf0acd.diff
LOG: Change FastISel::CallLoweringInfo::CS to be an ImmutableCallSite instead of a pointer. NFCI.
This is the same as what was done to the CallLoweringInfo in
TargetLowering.h in r309159.
This is just a step on the way to replacing this with CallBase.
Added:
Modified:
llvm/include/llvm/CodeGen/FastISel.h
llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
llvm/lib/Target/X86/X86FastISel.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/CodeGen/FastISel.h b/llvm/include/llvm/CodeGen/FastISel.h
index 02f5437f1901..1ad414e0c3fb 100644
--- a/llvm/include/llvm/CodeGen/FastISel.h
+++ b/llvm/include/llvm/CodeGen/FastISel.h
@@ -86,7 +86,7 @@ class FastISel {
const Value *Callee = nullptr;
MCSymbol *Symbol = nullptr;
ArgListTy Args;
- ImmutableCallSite *CS = nullptr;
+ ImmutableCallSite CS;
MachineInstr *Call = nullptr;
Register ResultReg;
unsigned NumResultRegs = 0;
@@ -103,7 +103,7 @@ class FastISel {
CallLoweringInfo &setCallee(Type *ResultTy, FunctionType *FuncTy,
const Value *Target, ArgListTy &&ArgsList,
- ImmutableCallSite &Call) {
+ ImmutableCallSite Call) {
RetTy = ResultTy;
Callee = Target;
@@ -118,14 +118,14 @@ class FastISel {
Args = std::move(ArgsList);
NumFixedArgs = FuncTy->getNumParams();
- CS = &Call;
+ CS = Call;
return *this;
}
CallLoweringInfo &setCallee(Type *ResultTy, FunctionType *FuncTy,
MCSymbol *Target, ArgListTy &&ArgsList,
- ImmutableCallSite &Call,
+ ImmutableCallSite Call,
unsigned FixedArgs = ~0U) {
RetTy = ResultTy;
Callee = Call.getCalledValue();
@@ -142,7 +142,7 @@ class FastISel {
Args = std::move(ArgsList);
NumFixedArgs = (FixedArgs == ~0U) ? FuncTy->getNumParams() : FixedArgs;
- CS = &Call;
+ CS = Call;
return *this;
}
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
index 2f0ef3b1e8b9..c53f15db3c2e 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -1250,11 +1250,11 @@ bool FastISel::lowerCallTo(CallLoweringInfo &CLI) {
CLI.Call->setPhysRegsDeadExcept(CLI.InRegs, TRI);
if (CLI.NumResultRegs && CLI.CS)
- updateValueMap(CLI.CS->getInstruction(), CLI.ResultReg, CLI.NumResultRegs);
+ updateValueMap(CLI.CS.getInstruction(), CLI.ResultReg, CLI.NumResultRegs);
// Set labels for heapallocsite call.
if (CLI.CS)
- if (MDNode *MD = CLI.CS->getInstruction()->getMetadata("heapallocsite"))
+ if (MDNode *MD = CLI.CS.getInstruction()->getMetadata("heapallocsite"))
CLI.Call->setHeapAllocMarker(*MF, MD);
return true;
diff --git a/llvm/lib/Target/X86/X86FastISel.cpp b/llvm/lib/Target/X86/X86FastISel.cpp
index 8ee1882408ea..6a318abd7208 100644
--- a/llvm/lib/Target/X86/X86FastISel.cpp
+++ b/llvm/lib/Target/X86/X86FastISel.cpp
@@ -3159,7 +3159,7 @@ bool X86FastISel::fastLowerArguments() {
static unsigned computeBytesPoppedByCalleeForSRet(const X86Subtarget *Subtarget,
CallingConv::ID CC,
- ImmutableCallSite *CS) {
+ ImmutableCallSite CS) {
if (Subtarget->is64Bit())
return 0;
if (Subtarget->getTargetTriple().isOSMSVCRT())
@@ -3169,8 +3169,8 @@ static unsigned computeBytesPoppedByCalleeForSRet(const X86Subtarget *Subtarget,
return 0;
if (CS)
- if (CS->arg_empty() || !CS->paramHasAttr(0, Attribute::StructRet) ||
- CS->paramHasAttr(0, Attribute::InReg) || Subtarget->isTargetMCU())
+ if (CS.arg_empty() || !CS.paramHasAttr(0, Attribute::StructRet) ||
+ CS.paramHasAttr(0, Attribute::InReg) || Subtarget->isTargetMCU())
return 0;
return 4;
@@ -3192,13 +3192,13 @@ bool X86FastISel::fastLowerCall(CallLoweringInfo &CLI) {
bool IsWin64 = Subtarget->isCallingConvWin64(CC);
const CallInst *CI =
- CLI.CS ? dyn_cast<CallInst>(CLI.CS->getInstruction()) : nullptr;
+ CLI.CS ? dyn_cast<CallInst>(CLI.CS.getInstruction()) : nullptr;
const Function *CalledFn = CI ? CI->getCalledFunction() : nullptr;
// Call / invoke instructions with NoCfCheck attribute require special
// handling.
const auto *II =
- CLI.CS ? dyn_cast<InvokeInst>(CLI.CS->getInstruction()) : nullptr;
+ CLI.CS ? dyn_cast<InvokeInst>(CLI.CS.getInstruction()) : nullptr;
if ((CI && CI->doesNoCfCheck()) || (II && II->doesNoCfCheck()))
return false;
@@ -3244,7 +3244,7 @@ bool X86FastISel::fastLowerCall(CallLoweringInfo &CLI) {
return false;
// Don't know about inalloca yet.
- if (CLI.CS && CLI.CS->hasInAllocaArgument())
+ if (CLI.CS && CLI.CS.hasInAllocaArgument())
return false;
for (auto Flag : CLI.OutFlags)
@@ -3275,7 +3275,7 @@ bool X86FastISel::fastLowerCall(CallLoweringInfo &CLI) {
auto *TI = dyn_cast<TruncInst>(Val);
unsigned ResultReg;
if (TI && TI->getType()->isIntegerTy(1) && CLI.CS &&
- (TI->getParent() == CLI.CS->getInstruction()->getParent()) &&
+ (TI->getParent() == CLI.CS.getInstruction()->getParent()) &&
TI->hasOneUse()) {
Value *PrevVal = TI->getOperand(0);
ResultReg = getRegForValue(PrevVal);
More information about the llvm-commits
mailing list