[PATCH] D48246: [AMDGPU] setcc (select cc, CT, CF), CF, eq | ne -> xor cc, -1 | cc
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 17 00:32:11 PDT 2018
- Previous message: [PATCH] D48246: [AMDGPU] setcc (select cc, CT, CF), CF, eq | ne -> xor cc, -1 | cc
- Next message: [PATCH] D48246: [AMDGPU] setcc (select cc, CT, CF), CF, eq | ne -> xor cc, -1 | cc
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
arsenm added inline comments.
================
Comment at: llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp:7493
- if (CRHS && VT == MVT::i32 && LHS.getOpcode() == ISD::SIGN_EXTEND &&
- isBoolSGPR(LHS.getOperand(0))) {
- // setcc (sext from i1 cc), -1, ne|sgt|ult) => not cc => xor cc, -1
- // setcc (sext from i1 cc), -1, eq|sle|uge) => cc
- // setcc (sext from i1 cc), 0, eq|sge|ule) => not cc => xor cc, -1
- // setcc (sext from i1 cc), 0, ne|ugt|slt) => cc
- if ((CRHS->isAllOnesValue() &&
- (CC == ISD::SETNE || CC == ISD::SETGT || CC == ISD::SETULT)) ||
- (CRHS->isNullValue() &&
- (CC == ISD::SETEQ || CC == ISD::SETGE || CC == ISD::SETULE)))
- return DAG.getNode(ISD::XOR, SL, MVT::i1, LHS.getOperand(0),
- DAG.getConstant(-1, SL, MVT::i1));
- if ((CRHS->isAllOnesValue() &&
- (CC == ISD::SETEQ || CC == ISD::SETLE || CC == ISD::SETUGE)) ||
- (CRHS->isNullValue() &&
- (CC == ISD::SETNE || CC == ISD::SETUGT || CC == ISD::SETLT)))
- return LHS.getOperand(0);
+ if (CRHS) {
+ if (VT == MVT::i32 && LHS.getOpcode() == ISD::SIGN_EXTEND &&
----------------
Don't these combines exist in DAGCombiner already?
Repository:
rL LLVM
https://reviews.llvm.org/D48246
- Previous message: [PATCH] D48246: [AMDGPU] setcc (select cc, CT, CF), CF, eq | ne -> xor cc, -1 | cc
- Next message: [PATCH] D48246: [AMDGPU] setcc (select cc, CT, CF), CF, eq | ne -> xor cc, -1 | cc
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the llvm-commits
mailing list