Skip to content

Commit

Permalink
Do not move "auto-init" instruction if they're volatile
Browse files Browse the repository at this point in the history
This is overly conservative, but at least it's safe.

This is a follow-up to https://reviews.llvm.org/D137707
  • Loading branch information
serge-sans-paille committed Apr 4, 2023
1 parent 73fd9d3 commit ad9ad37
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion llvm/lib/Transforms/Utils/MoveAutoInit.cpp
Expand Up @@ -109,7 +109,8 @@ static bool runMoveAutoInit(Function &F, DominatorTree &DT, MemorySSA &MSSA) {
if (!hasAutoInitMetadata(I))
continue;

assert(!I.isVolatile() && "auto init instructions cannot be volatile.");
if (I.isVolatile())
continue;

BasicBlock *UsersDominator = usersDominator(&I, DT, MSSA);
if (!UsersDominator)
Expand Down

0 comments on commit ad9ad37

Please sign in to comment.