Skip to content

Commit 145a7d6

Browse files
authored
Backport "Refine metadata handling during instruction hoisting"
Backport of llvm#158448
1 parent 7b28655 commit 145a7d6

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
@@ -3031,7 +3031,8 @@ bool SimplifyCFGOpt::SpeculativelyExecuteBB(BranchInst *BI, BasicBlock *ThenBB,
30313031
// Similarly strip attributes that maybe dependent on condition we are
30323032
// hoisting above.
30333033
for (auto &I : make_early_inc_range(*ThenBB)) {
3034-
if (!SpeculatedStoreValue || &I != SpeculatedStore) {
3034+
if ((!SpeculatedStoreValue || &I != SpeculatedStore) &&
3035+
!isa<CallBase>(&I)) {
30353036
// Don't update the DILocation of dbg.assign intrinsics.
30363037
if (!isa<DbgAssignIntrinsic>(&I))
30373038
I.setDebugLoc(DebugLoc());

0 commit comments

Comments
 (0)