Skip to content

Commit c2457e1

Browse files
authored
Backport "Refine metadata handling during instruction hoisting llvm#158448"
Backport of llvm#158448
1 parent 3f0b731 commit c2457e1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/Transforms/Utils/SimplifyCFG.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2876,7 +2876,8 @@ bool SimplifyCFGOpt::SpeculativelyExecuteBB(BranchInst *BI, BasicBlock *ThenBB,
28762876
// Similarly strip attributes that maybe dependent on condition we are
28772877
// hoisting above.
28782878
for (auto &I : *ThenBB) {
2879-
if (!SpeculatedStoreValue || &I != SpeculatedStore)
2879+
if ((!SpeculatedStoreValue || &I != SpeculatedStore) &&
2880+
!isa<CallBase>(&I))
28802881
I.setDebugLoc(DebugLoc());
28812882
I.dropUndefImplyingAttrsAndUnknownMetadata();
28822883
}

0 commit comments

Comments
 (0)