Skip to content

Commit 9e4ef0d

Browse files
authored
[CodeGen][SDAG] Track returntwice in lowering info (#92640)
This saves an extra iteration over the all instructions of the function.
1 parent 0c7d268 commit 9e4ef0d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,10 @@ void FunctionLoweringInfo::set(const Function &fn, MachineFunction &mf,
214214
if (CI->isMustTailCall() && Fn->isVarArg())
215215
MF->getFrameInfo().setHasMustTailInVarArgFunc(true);
216216
}
217+
218+
// Determine if there is a call to setjmp in the machine function.
219+
if (Call->hasFnAttr(Attribute::ReturnsTwice))
220+
MF->setExposesReturnsTwice(true);
217221
}
218222

219223
// Mark values used outside their block as exported, by allocating

llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -680,9 +680,6 @@ bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) {
680680
}
681681
}
682682

683-
// Determine if there is a call to setjmp in the machine function.
684-
MF->setExposesReturnsTwice(Fn.callsFunctionThatReturnsTwice());
685-
686683
// Determine if floating point is used for msvc
687684
computeUsesMSVCFloatingPoint(TM.getTargetTriple(), Fn, MF->getMMI());
688685

0 commit comments

Comments
 (0)