Skip to content

Commit ad9ad37

Browse files
Do not move "auto-init" instruction if they're volatile
This is overly conservative, but at least it's safe. This is a follow-up to https://reviews.llvm.org/D137707
1 parent 73fd9d3 commit ad9ad37

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/Transforms/Utils/MoveAutoInit.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ static bool runMoveAutoInit(Function &F, DominatorTree &DT, MemorySSA &MSSA) {
109109
if (!hasAutoInitMetadata(I))
110110
continue;
111111

112-
assert(!I.isVolatile() && "auto init instructions cannot be volatile.");
112+
if (I.isVolatile())
113+
continue;
113114

114115
BasicBlock *UsersDominator = usersDominator(&I, DT, MSSA);
115116
if (!UsersDominator)

0 commit comments

Comments
 (0)