[llvm] [CodeGen][SDAG] Track returntwice in lowering info (PR #92640)
via llvm-commits
llvm-commits at lists.llvm.org
Sat May 18 02:39:26 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-selectiondag
Author: None (aengelke)
<details>
<summary>Changes</summary>
This saves an extra iteration over the all instructions of the function.
---
Full diff: https://github.com/llvm/llvm-project/pull/92640.diff
2 Files Affected:
- (modified) llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp (+4)
- (modified) llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (-3)
``````````diff
diff --git a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
index 8fb6b11b8805c..6ea17b4386cda 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
@@ -214,6 +214,10 @@ void FunctionLoweringInfo::set(const Function &fn, MachineFunction &mf,
if (CI->isMustTailCall() && Fn->isVarArg())
MF->getFrameInfo().setHasMustTailInVarArgFunc(true);
}
+
+ // Determine if there is a call to setjmp in the machine function.
+ if (Call->hasFnAttr(Attribute::ReturnsTwice))
+ MF->setExposesReturnsTwice(true);
}
// Mark values used outside their block as exported, by allocating
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index b5694c955b8c8..8addaf1ae3e54 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -680,9 +680,6 @@ bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) {
}
}
- // Determine if there is a call to setjmp in the machine function.
- MF->setExposesReturnsTwice(Fn.callsFunctionThatReturnsTwice());
-
// Determine if floating point is used for msvc
computeUsesMSVCFloatingPoint(TM.getTargetTriple(), Fn, MF->getMMI());
``````````
</details>
https://github.com/llvm/llvm-project/pull/92640
More information about the llvm-commits
mailing list