[llvm] [AMDGPU] Simplify and improve codegen for llvm.amdgcn.set.inactive (PR #107889)

Carl Ritson via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 10 18:28:04 PDT 2024


================
@@ -1527,13 +1521,20 @@ bool SIWholeQuadMode::lowerCopyInstrs() {
   for (MachineInstr *MI : LowerToCopyInstrs) {
     LLVM_DEBUG(dbgs() << "simplify: " << *MI);
 
-    Register RecomputeReg = 0;
-    if (MI->getOpcode() == AMDGPU::V_SET_INACTIVE_B32 ||
-        MI->getOpcode() == AMDGPU::V_SET_INACTIVE_B64) {
-      assert(MI->getNumExplicitOperands() == 3);
-      if (MI->getOperand(2).isReg())
-        RecomputeReg = MI->getOperand(2).getReg();
-      MI->removeOperand(2);
+    if (MI->getOpcode() == AMDGPU::V_SET_INACTIVE_B32) {
+      assert(MI->getNumExplicitOperands() == 6);
+
+      LiveInterval *LI = nullptr;
+      if (MI->getOperand(4).isReg())
+        LI = &LIS->getInterval(MI->getOperand(4).getReg());
+
+      MI->removeOperand(5);
+      MI->removeOperand(4);
+      MI->removeOperand(3);
+      MI->removeOperand(1);
----------------
perlfu wrote:

OK, yes, I see now that operand 5 should just be a junk IMPLICIT_DEF at this point.

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


More information about the llvm-commits mailing list