[llvm] [CodeGen] Mark LIFETIME_START and LIFETIME_END as not safe to move (PR #211179)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 22 02:26:01 PDT 2026
================
@@ -1360,7 +1360,7 @@ bool MachineInstr::isSafeToMove(bool &SawStore) const {
// Don't touch instructions that have non-trivial invariants. For example,
// terminators have to be at the end of a basic block.
if (isPosition() || isDebugInstr() || isTerminator() ||
- isJumpTableDebugInfo())
+ isJumpTableDebugInfo() || isLifetimeMarker())
----------------
lukel97 wrote:
Yes for wouldBeTriviallyDead, done in 3c543e647862408179c6f05ed86e8449bae0f4e1.
Apparently not for isDead:
```c++
// FIXME: See issue #105950 for why LIFETIME markers are considered dead here.
if (isLifetimeMarker())
return true;
```
Not sure why isDead and wouldBeTriviallyDead diverge here.
https://github.com/llvm/llvm-project/pull/211179
More information about the llvm-commits
mailing list