[llvm] [AMDGPU] Break v2i32 and/or/xor ops into i32 pairs when followed by t… (PR #191422)
Wooseok Lee via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 13 06:24:57 PDT 2026
================
@@ -13956,6 +13956,58 @@ static uint32_t getPermuteMask(SDValue V) {
return ~0;
}
+static SDValue performAndOrXorv2i32Combine(SDNode *N, SelectionDAG &DAG) {
+ EVT VT = N->getValueType(0);
+ const unsigned Opc = N->getOpcode();
+ assert(VT == MVT::v2i32);
+ if (!N->isDivergent())
+ return SDValue();
+
+ SDValue LHS = N->getOperand(0);
+ SDValue RHS = N->getOperand(1);
+
+ // Reject v2i32 ops that would be handled by v2i32-v2i32 patterns
+ auto matchV2I32Patterns = [](const unsigned Opc,
+ const unsigned userOpc) -> bool {
+ return (Opc == ISD::AND || Opc == ISD::OR) && userOpc == ISD::OR;
+ };
+ if (matchV2I32Patterns(LHS.getOpcode(), Opc) ||
+ matchV2I32Patterns(RHS.getOpcode(), Opc))
+ return SDValue();
+
+ for (SDUse &use : N->uses()) {
----------------
wooseoklee wrote:
I have to take it back. This approach needs to look for the uses. Merged two loops into one though.
https://github.com/llvm/llvm-project/pull/191422
More information about the llvm-commits
mailing list