File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
llvm/lib/Transforms/Utils Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -3387,11 +3387,13 @@ bool SimplifyCFGOpt::speculativelyExecuteBB(BranchInst *BI,
3387
3387
// Metadata can be dependent on the condition we are hoisting above.
3388
3388
// Strip all UB-implying metadata on the instruction. Drop the debug loc
3389
3389
// to avoid making it appear as if the condition is a constant, which would
3390
- // be misleading while debugging.
3390
+ // be misleading while debugging. However, make sure to keep debug info
3391
+ // for calls as inlinable function calls in a function with debug info must
3392
+ // have a !dbg location.
3391
3393
// Similarly strip attributes that maybe dependent on condition we are
3392
3394
// hoisting above.
3393
3395
for (auto &I : make_early_inc_range (*ThenBB)) {
3394
- if (!SpeculatedStoreValue || &I != SpeculatedStore) {
3396
+ if (!SpeculatedStoreValue || &I != SpeculatedStore && !isa<CallBase>(&I) ) {
3395
3397
I.setDebugLoc (DebugLoc::getDropped ());
3396
3398
}
3397
3399
I.dropUBImplyingAttrsAndMetadata ();
You can’t perform that action at this time.
0 commit comments