[llvm] [AMDGPU] Ensure SCC is not live before shrinking to s_bitset* (PR #167907)

via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 13 21:07:14 PST 2025


================
@@ -550,15 +552,19 @@ bool SIShrinkInstructions::shrinkScalarLogicOp(MachineInstr &MI) const {
   uint32_t NewImm = 0;
 
   if (Opc == AMDGPU::S_AND_B32) {
-    if (isPowerOf2_32(~Imm)) {
+    if (isPowerOf2_32(~Imm) &&
+        MBB.computeRegisterLiveness(TRI, AMDGPU::SCC, std::next(MBBI), 2) ==
----------------
LU-JOHN wrote:

Use isDead.

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


More information about the llvm-commits mailing list