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,
33873387 // Metadata can be dependent on the condition we are hoisting above.
33883388 // Strip all UB-implying metadata on the instruction. Drop the debug loc
33893389 // 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.
33913393 // Similarly strip attributes that maybe dependent on condition we are
33923394 // hoisting above.
33933395 for (auto &I : make_early_inc_range (*ThenBB)) {
3394- if (!SpeculatedStoreValue || &I != SpeculatedStore) {
3396+ if (!SpeculatedStoreValue || &I != SpeculatedStore && !isa<CallBase>(&I) ) {
33953397 I.setDebugLoc (DebugLoc::getDropped ());
33963398 }
33973399 I.dropUBImplyingAttrsAndMetadata ();
You can’t perform that action at this time.
0 commit comments