Skip to content

Commit 3c2c9d5

Browse files
authored
DAG: Cleanup string bool attribute check for disable-tail-calls (#166237)
1 parent a522ae3 commit 3c2c9d5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8958,9 +8958,8 @@ bool SelectionDAGBuilder::canTailCall(const CallBase &CB) const {
89588958
// Avoid emitting tail calls in functions with the disable-tail-calls
89598959
// attribute.
89608960
const Function *Caller = CB.getParent()->getParent();
8961-
if (Caller->getFnAttribute("disable-tail-calls").getValueAsString() ==
8962-
"true" &&
8963-
!isMustTailCall)
8961+
if (!isMustTailCall &&
8962+
Caller->getFnAttribute("disable-tail-calls").getValueAsBool())
89648963
return false;
89658964

89668965
// We can't tail call inside a function with a swifterror argument. Lowering

0 commit comments

Comments
 (0)