Skip to content

Commit 49bb19d

Browse files
committed
Fix debug info in LICM
Use RegularLocation::getAutoGeneratedLocation() while hoisting a load. Previously the source location of the preheader's terminator was used, this need not be a RegularLocationKind triggering verification errors.
1 parent 3b093d7 commit 49bb19d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/SILOptimizer/LoopTransforms/LICM.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1432,7 +1432,7 @@ hoistLoadsAndStores(AccessPath accessPath, SILLoop *loop) {
14321432
return;
14331433

14341434
LoadInst *initialLoad =
1435-
B.createLoad(preheader->getTerminator()->getLoc(), initialAddr,
1435+
B.createLoad(RegularLocation::getAutoGeneratedLocation(), initialAddr,
14361436
LoadOwnershipQualifier::Unqualified);
14371437
LLVM_DEBUG(llvm::dbgs() << "Creating preload " << *initialLoad);
14381438
ssaUpdater.addAvailableValue(preheader, initialLoad);

0 commit comments

Comments
 (0)