[llvm] Reland "RegisterCoalescer: Add implicit-def of super register when coalescing SUBREG_TO_REG" (PR #134408)

Greg Bedwell via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 4 08:41:50 PDT 2025


gregbedwell wrote:

FYI, we spotted the following assert on x86_64 (which disappeared after ed5bd23867eacaa3789060f9250ba6fcece2a3de).  Probably the same issue as reported above, but just in case I'm including it here as the testcase is quite different.

```
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-unknown"

define { i32, i1 } @_Z1iv() {
entry:
  %call = tail call ptr null(ptr null)
  %0 = cmpxchg ptr null, i8 0, i8 1 monotonic monotonic, align 1
  %1 = cmpxchg ptr null, i32 0, i32 0 monotonic monotonic, align 4
  ret { i32, i1 } %1
}
```

```
greg at GREG-WIN11:~/git/llvm-project/build$ ./bin/llc ~/reduce/reduced.ll
llc: /home/greg/git/llvm-project/llvm/lib/CodeGen/RegisterPressure.cpp:1170: void llvm::RegPressureTracker::getUpwardPressureDelta(const llvm::MachineInstr*, llvm::PressureDiff&, llvm::RegPressureDelta&, llvm::ArrayRef<llvm::PressureChange>, llvm::ArrayRef<unsigned int>) const: Assertion `(PDiffI->getUnitInc() >= 0) == (PNew >= POld) && "PSet overflow/underflow"' failed.
```

https://github.com/llvm/llvm-project/pull/134408


More information about the llvm-commits mailing list