[llvm] ad9ad37 - Do not move "auto-init" instruction if they're volatile
via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 4 11:42:49 PDT 2023
Author: serge-sans-paille
Date: 2023-04-04T20:42:05+02:00
New Revision: ad9ad3735c4821ff4651fab7537a75b8f0bb60f8
URL: https://github.com/llvm/llvm-project/commit/ad9ad3735c4821ff4651fab7537a75b8f0bb60f8
DIFF: https://github.com/llvm/llvm-project/commit/ad9ad3735c4821ff4651fab7537a75b8f0bb60f8.diff
LOG: 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
Added:
Modified:
llvm/lib/Transforms/Utils/MoveAutoInit.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Utils/MoveAutoInit.cpp b/llvm/lib/Transforms/Utils/MoveAutoInit.cpp
index ca8a5875593af..2c38adba57c2a 100644
--- a/llvm/lib/Transforms/Utils/MoveAutoInit.cpp
+++ b/llvm/lib/Transforms/Utils/MoveAutoInit.cpp
@@ -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)
More information about the llvm-commits
mailing list