[llvm] [AMDGPU][SDAG] Legalise v2i32 or/xor/and instructions to make use of 64-bit wide instructions (PR #140694)

Janek van Oirschot via llvm-commits llvm-commits at lists.llvm.org
Wed May 21 10:25:55 PDT 2025


================
@@ -12872,6 +12887,46 @@ SDValue SITargetLowering::performOrCombine(SDNode *N,
     }
   }
 
+  // Detect identity v2i32 OR and replace with identity source node.
+  // Specifically an Or that has operands constructed from the same source node
+  // via extract_vector_elt and build_vector.
----------------
JanekvO wrote:

Would it be alright to add the combine transform as expression transform in comments?
Something along the lines of
```
v2i32 or(
  v2i32 build_vector(
    i32 extract_elt(%Original, 0),
    i32 0
  ),
  v2i32 build_vector(
    i32 0,
    i32 extract_elt(%Original, 1)
  )
)
=>
v2i32 %Original
```

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


More information about the llvm-commits mailing list