https://github.com/uweigand commented:
The code changes now look good to me, but the tests still need some work. In a
nutshell, most of the tests don't actually seem to verify what you wanted to
verify. These are IL tests, that only verify the translation from IL to
assembler. You appear to
@@ -0,0 +1,2427 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
UTC_ARGS: --version 5
+; Test Flag Output Operands with 14 combinations of CCMASK and optimizations.
+; This tests mixing XOR wirh OR, XOR with AND and OR with AND with
+; different
@@ -0,0 +1,786 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
UTC_ARGS: --version 5
+; Test Flag Output Operands with 14 combinations of CCMASK and optimizations.
+; This test negate of flag_output_operand_ccand, e.g
+; CC != 0 && cc != 1 && cc
@@ -0,0 +1,939 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
UTC_ARGS: --version 5
+; Test Flag Output Operands with 14 combinations of CCMASK and optimizations
+; for AND for 3 three different functions, including two tests from heiko.
+; Thi
@@ -0,0 +1,786 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
UTC_ARGS: --version 5
+; Test Flag Output Operands with 14 combinations of CCMASK and optimizations.
+; This test negate of flag_output_operand_ccand, e.g
+; CC != 0 && cc != 1 && cc
@@ -0,0 +1,786 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
UTC_ARGS: --version 5
+; Test Flag Output Operands with 14 combinations of CCMASK and optimizations.
+; This test negate of flag_output_operand_ccand, e.g
+; CC != 0 && cc != 1 && cc
@@ -0,0 +1,2427 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
UTC_ARGS: --version 5
+; Test Flag Output Operands with 14 combinations of CCMASK and optimizations.
+; This tests mixing XOR wirh OR, XOR with AND and OR with AND with
+; different
@@ -1514,10 +1516,21 @@ SystemZTargetLowering::getConstraintType(StringRef
Constraint) const {
default:
break;
}
+ } else if (Constraint.size() == 5 && Constraint.starts_with("{")) {
+if (StringRef("{@cc}").compare(Constraint) == 0)
+ return C_Other;
@@ -0,0 +1,786 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
UTC_ARGS: --version 5
+; Test Flag Output Operands with 14 combinations of CCMASK and optimizations.
+; This test negate of flag_output_operand_ccand, e.g
+; CC != 0 && cc != 1 && cc
@@ -0,0 +1,939 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
UTC_ARGS: --version 5
+; Test Flag Output Operands with 14 combinations of CCMASK and optimizations
+; for AND for 3 three different functions, including two tests from heiko.
+; Thi
@@ -0,0 +1,5272 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
UTC_ARGS: --version 5
+; Test Flag Output Operands with 14 combinations of CCMASK and optimizations.
+; Different ways of parenthesizing with mix of == and != operator for
+; AND/OR/
@@ -0,0 +1,500 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
UTC_ARGS: --version 5
+; Test Flag Output Operands with 14 combinations of CCMASK and optimizations
+; for AND for 3 three different functions, including two test cases from heiko.
+
https://github.com/uweigand edited
https://github.com/llvm/llvm-project/pull/125970
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1211,6 +1211,19 @@ class TargetInfo : public TransferrableTargetInfo,
TiedOperand = N;
// Don't copy Name or constraint string.
}
+
+// Output operand bounds can be set by target.
uweigand wrote:
Maybe make the comment a bit more specif
@@ -2715,18 +2716,20 @@ EmitAsmStores(CodeGenFunction &CGF, const AsmStmt &S,
// ResultRegDests can be also populated by addReturnRegisterOutputs() above,
// in which case its size may grow.
assert(ResultTypeRequiresCast.size() <= ResultRegDests.size());
- assert(ResultR
@@ -2715,18 +2715,22 @@ EmitAsmStores(CodeGenFunction &CGF, const AsmStmt &S,
// ResultRegDests can be also populated by addReturnRegisterOutputs() above,
// in which case its size may grow.
assert(ResultTypeRequiresCast.size() <= ResultRegDests.size());
- assert(ResultR
@@ -1211,6 +1211,15 @@ class TargetInfo : public TransferrableTargetInfo,
TiedOperand = N;
// Don't copy Name or constraint string.
}
+
+// Output operand bounds can be set by target.
+void setOutputOperandBounds(unsigned Min, unsigned Max) {
+ setR
@@ -1211,6 +1211,15 @@ class TargetInfo : public TransferrableTargetInfo,
TiedOperand = N;
// Don't copy Name or constraint string.
}
+
+// Output operand bounds can be set by target.
+void setOutputOperandBounds(unsigned Min, unsigned Max) {
+ setR
@@ -2715,18 +2715,22 @@ EmitAsmStores(CodeGenFunction &CGF, const AsmStmt &S,
// ResultRegDests can be also populated by addReturnRegisterOutputs() above,
// in which case its size may grow.
assert(ResultTypeRequiresCast.size() <= ResultRegDests.size());
- assert(ResultR
@@ -9158,9 +9393,9 @@ SDValue SystemZTargetLowering::PerformDAGCombine(SDNode
*N,
case ISD::SREM:
case ISD::UREM: return combineIntDIVREM(N, DCI);
case ISD::INTRINSIC_W_CHAIN:
- case ISD::INTRINSIC_VOID: return combineINTRINSIC(N, DCI);
+ case ISD::IN
@@ -2704,7 +2704,7 @@ EmitAsmStores(CodeGenFunction &CGF, const AsmStmt &S,
const llvm::ArrayRef ResultRegDests,
const llvm::ArrayRef ResultRegQualTys,
const llvm::BitVector &ResultTypeRequiresCast,
- const llvm::BitVector
@@ -8701,95 +8734,266 @@ SDValue SystemZTargetLowering::combineSETCC(
return SDValue();
}
-static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
+static std::pair findCCUse(const SDValue &Val) {
+ auto *N = Val.getNode();
+ if (!N)
+return std::make_pa
@@ -8701,95 +8734,266 @@ SDValue SystemZTargetLowering::combineSETCC(
return SDValue();
}
-static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
+static std::pair findCCUse(const SDValue &Val) {
+ auto *N = Val.getNode();
+ if (!N)
+return std::make_pa
@@ -8826,15 +9029,49 @@ SDValue SystemZTargetLowering::combineSELECT_CCMASK(
int CCMaskVal = CCMask->getZExtValue();
SDValue CCReg = N->getOperand(4);
- if (combineCCMask(CCReg, CCValidVal, CCMaskVal))
-return DAG.getNode(SystemZISD::SELECT_CCMASK, SDLoc(N), N->getVal
@@ -8701,95 +8734,266 @@ SDValue SystemZTargetLowering::combineSETCC(
return SDValue();
}
-static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
+static std::pair findCCUse(const SDValue &Val) {
+ auto *N = Val.getNode();
+ if (!N)
+return std::make_pa
@@ -8701,95 +8734,266 @@ SDValue SystemZTargetLowering::combineSETCC(
return SDValue();
}
-static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
+static std::pair findCCUse(const SDValue &Val) {
+ auto *N = Val.getNode();
+ if (!N)
+return std::make_pa
@@ -8701,95 +8734,266 @@ SDValue SystemZTargetLowering::combineSETCC(
return SDValue();
}
-static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
+static std::pair findCCUse(const SDValue &Val) {
+ auto *N = Val.getNode();
+ if (!N)
+return std::make_pa
@@ -8701,95 +8734,266 @@ SDValue SystemZTargetLowering::combineSETCC(
return SDValue();
}
-static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
+static std::pair findCCUse(const SDValue &Val) {
+ auto *N = Val.getNode();
+ if (!N)
+return std::make_pa
@@ -8701,95 +8734,266 @@ SDValue SystemZTargetLowering::combineSETCC(
return SDValue();
}
-static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
+static std::pair findCCUse(const SDValue &Val) {
+ auto *N = Val.getNode();
+ if (!N)
+return std::make_pa
@@ -8701,95 +8734,266 @@ SDValue SystemZTargetLowering::combineSETCC(
return SDValue();
}
-static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
+static std::pair findCCUse(const SDValue &Val) {
+ auto *N = Val.getNode();
+ if (!N)
+return std::make_pa
https://github.com/uweigand commented:
More comments on just the CC optimization part - this is looking really good
now, just a few minor issue and some suggestions for further enhancement.
I'll start looking at the rest of the patch again as well.
https://github.com/llvm/llvm-project/pull/1
@@ -8701,95 +8734,266 @@ SDValue SystemZTargetLowering::combineSETCC(
return SDValue();
}
-static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
+static std::pair findCCUse(const SDValue &Val) {
+ auto *N = Val.getNode();
+ if (!N)
+return std::make_pa
https://github.com/uweigand edited
https://github.com/llvm/llvm-project/pull/125970
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -8701,95 +8734,266 @@ SDValue SystemZTargetLowering::combineSETCC(
return SDValue();
}
-static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
+static std::pair findCCUse(const SDValue &Val) {
+ auto *N = Val.getNode();
+ if (!N)
+return std::make_pa
@@ -8701,95 +8734,341 @@ SDValue SystemZTargetLowering::combineSETCC(
return SDValue();
}
-static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
+static std::pair findCCUse(const SDValue &Val) {
+ auto *N = Val.getNode();
+ if (!N)
+return std::make_pa
https://github.com/uweigand commented:
CC optimization is looking better now, still a couple of issues below.
https://github.com/llvm/llvm-project/pull/125970
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailma
@@ -8701,95 +8734,341 @@ SDValue SystemZTargetLowering::combineSETCC(
return SDValue();
}
-static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
+static std::pair findCCUse(const SDValue &Val) {
+ auto *N = Val.getNode();
+ if (!N)
+return std::make_pa
@@ -8701,95 +8734,341 @@ SDValue SystemZTargetLowering::combineSETCC(
return SDValue();
}
-static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
+static std::pair findCCUse(const SDValue &Val) {
+ auto *N = Val.getNode();
+ if (!N)
+return std::make_pa
@@ -8701,95 +8734,341 @@ SDValue SystemZTargetLowering::combineSETCC(
return SDValue();
}
-static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
+static std::pair findCCUse(const SDValue &Val) {
+ auto *N = Val.getNode();
+ if (!N)
+return std::make_pa
@@ -8701,95 +8734,341 @@ SDValue SystemZTargetLowering::combineSETCC(
return SDValue();
}
-static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
+static std::pair findCCUse(const SDValue &Val) {
+ auto *N = Val.getNode();
+ if (!N)
+return std::make_pa
@@ -8826,15 +9104,49 @@ SDValue SystemZTargetLowering::combineSELECT_CCMASK(
int CCMaskVal = CCMask->getZExtValue();
SDValue CCReg = N->getOperand(4);
- if (combineCCMask(CCReg, CCValidVal, CCMaskVal))
-return DAG.getNode(SystemZISD::SELECT_CCMASK, SDLoc(N), N->getVal
@@ -8701,95 +8734,341 @@ SDValue SystemZTargetLowering::combineSETCC(
return SDValue();
}
-static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
+static std::pair findCCUse(const SDValue &Val) {
+ auto *N = Val.getNode();
+ if (!N)
+return std::make_pa
@@ -8701,95 +8734,341 @@ SDValue SystemZTargetLowering::combineSETCC(
return SDValue();
}
-static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
+static std::pair findCCUse(const SDValue &Val) {
+ auto *N = Val.getNode();
+ if (!N)
+return std::make_pa
@@ -8701,95 +8734,341 @@ SDValue SystemZTargetLowering::combineSETCC(
return SDValue();
}
-static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
+static std::pair findCCUse(const SDValue &Val) {
+ auto *N = Val.getNode();
+ if (!N)
+return std::make_pa
@@ -8701,95 +8734,341 @@ SDValue SystemZTargetLowering::combineSETCC(
return SDValue();
}
-static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
+static std::pair findCCUse(const SDValue &Val) {
+ auto *N = Val.getNode();
+ if (!N)
+return std::make_pa
@@ -8701,95 +8734,341 @@ SDValue SystemZTargetLowering::combineSETCC(
return SDValue();
}
-static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
+static std::pair findCCUse(const SDValue &Val) {
+ auto *N = Val.getNode();
+ if (!N)
+return std::make_pa
@@ -8701,95 +8734,341 @@ SDValue SystemZTargetLowering::combineSETCC(
return SDValue();
}
-static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
+static std::pair findCCUse(const SDValue &Val) {
+ auto *N = Val.getNode();
+ if (!N)
+return std::make_pa
https://github.com/uweigand edited
https://github.com/llvm/llvm-project/pull/125970
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -8701,95 +8734,341 @@ SDValue SystemZTargetLowering::combineSETCC(
return SDValue();
}
-static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
+static std::pair findCCUse(const SDValue &Val) {
+ auto *N = Val.getNode();
+ if (!N)
+return std::make_pa
@@ -8826,15 +9104,49 @@ SDValue SystemZTargetLowering::combineSELECT_CCMASK(
int CCMaskVal = CCMask->getZExtValue();
SDValue CCReg = N->getOperand(4);
- if (combineCCMask(CCReg, CCValidVal, CCMaskVal))
-return DAG.getNode(SystemZISD::SELECT_CCMASK, SDLoc(N), N->getVal
@@ -8701,95 +8734,341 @@ SDValue SystemZTargetLowering::combineSETCC(
return SDValue();
}
-static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
+static std::pair findCCUse(const SDValue &Val) {
+ auto *N = Val.getNode();
+ if (!N)
+return std::make_pa
@@ -8701,95 +8734,341 @@ SDValue SystemZTargetLowering::combineSETCC(
return SDValue();
}
-static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
+static std::pair findCCUse(const SDValue &Val) {
+ auto *N = Val.getNode();
+ if (!N)
+return std::make_pa
@@ -8702,61 +8738,264 @@ SDValue SystemZTargetLowering::combineSETCC(
return SDValue();
}
+static SmallSet convertCCMaskToCCValsSet(int Mask) {
+ SmallSet CCVals;
+ size_t Pos = 0;
+ while (Mask) {
+if (Mask & 0x1)
+ CCVals.insert(3 - Pos);
+Mask >>= 1;
+
@@ -8702,61 +8738,264 @@ SDValue SystemZTargetLowering::combineSETCC(
return SDValue();
}
+static SmallSet convertCCMaskToCCValsSet(int Mask) {
+ SmallSet CCVals;
+ size_t Pos = 0;
+ while (Mask) {
+if (Mask & 0x1)
+ CCVals.insert(3 - Pos);
+Mask >>= 1;
+
@@ -8702,61 +8738,264 @@ SDValue SystemZTargetLowering::combineSETCC(
return SDValue();
}
+static SmallSet convertCCMaskToCCValsSet(int Mask) {
+ SmallSet CCVals;
+ size_t Pos = 0;
+ while (Mask) {
+if (Mask & 0x1)
+ CCVals.insert(3 - Pos);
+Mask >>= 1;
+
@@ -8702,61 +8738,264 @@ SDValue SystemZTargetLowering::combineSETCC(
return SDValue();
}
+static SmallSet convertCCMaskToCCValsSet(int Mask) {
+ SmallSet CCVals;
+ size_t Pos = 0;
+ while (Mask) {
+if (Mask & 0x1)
+ CCVals.insert(3 - Pos);
+Mask >>= 1;
+
@@ -8702,61 +8738,264 @@ SDValue SystemZTargetLowering::combineSETCC(
return SDValue();
}
+static SmallSet convertCCMaskToCCValsSet(int Mask) {
+ SmallSet CCVals;
+ size_t Pos = 0;
+ while (Mask) {
+if (Mask & 0x1)
+ CCVals.insert(3 - Pos);
+Mask >>= 1;
+
@@ -803,7 +805,10 @@ SystemZTargetLowering::SystemZTargetLowering(const
TargetMachine &TM,
ISD::SREM,
ISD::UREM,
ISD::INTRINSIC_VOID,
- ISD::INTRINSIC_W_CHAIN});
+
@@ -8702,61 +8738,264 @@ SDValue SystemZTargetLowering::combineSETCC(
return SDValue();
}
+static SmallSet convertCCMaskToCCValsSet(int Mask) {
+ SmallSet CCVals;
+ size_t Pos = 0;
+ while (Mask) {
+if (Mask & 0x1)
+ CCVals.insert(3 - Pos);
+Mask >>= 1;
+
@@ -8702,61 +8738,264 @@ SDValue SystemZTargetLowering::combineSETCC(
return SDValue();
}
+static SmallSet convertCCMaskToCCValsSet(int Mask) {
+ SmallSet CCVals;
+ size_t Pos = 0;
+ while (Mask) {
+if (Mask & 0x1)
+ CCVals.insert(3 - Pos);
+Mask >>= 1;
+
@@ -8702,61 +8738,264 @@ SDValue SystemZTargetLowering::combineSETCC(
return SDValue();
}
+static SmallSet convertCCMaskToCCValsSet(int Mask) {
+ SmallSet CCVals;
+ size_t Pos = 0;
+ while (Mask) {
+if (Mask & 0x1)
+ CCVals.insert(3 - Pos);
+Mask >>= 1;
+
https://github.com/uweigand edited
https://github.com/llvm/llvm-project/pull/125970
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -8702,61 +8738,264 @@ SDValue SystemZTargetLowering::combineSETCC(
return SDValue();
}
+static SmallSet convertCCMaskToCCValsSet(int Mask) {
+ SmallSet CCVals;
+ size_t Pos = 0;
+ while (Mask) {
+if (Mask & 0x1)
+ CCVals.insert(3 - Pos);
+Mask >>= 1;
+
https://github.com/uweigand commented:
This approach does look promising, it's much shorter, cleaner, and more general
than before. Still a number of inline comments ...
https://github.com/llvm/llvm-project/pull/125970
___
cfe-commits mailing list
cf
@@ -8789,8 +9049,329 @@ static bool combineCCMask(SDValue &CCReg, int &CCValid,
int &CCMask) {
return false;
}
-SDValue SystemZTargetLowering::combineBR_CCMASK(
-SDNode *N, DAGCombinerInfo &DCI) const {
+// Combine (select_ccmask_a (select_ccmask_b)), where select_ccmas
@@ -8789,8 +9049,329 @@ static bool combineCCMask(SDValue &CCReg, int &CCValid,
int &CCMask) {
return false;
}
-SDValue SystemZTargetLowering::combineBR_CCMASK(
-SDNode *N, DAGCombinerInfo &DCI) const {
+// Combine (select_ccmask_a (select_ccmask_b)), where select_ccmas
@@ -8789,8 +9049,329 @@ static bool combineCCMask(SDValue &CCReg, int &CCValid,
int &CCMask) {
return false;
}
-SDValue SystemZTargetLowering::combineBR_CCMASK(
-SDNode *N, DAGCombinerInfo &DCI) const {
+// Combine (select_ccmask_a (select_ccmask_b)), where select_ccmas
@@ -8789,8 +9049,329 @@ static bool combineCCMask(SDValue &CCReg, int &CCValid,
int &CCMask) {
return false;
}
-SDValue SystemZTargetLowering::combineBR_CCMASK(
-SDNode *N, DAGCombinerInfo &DCI) const {
+// Combine (select_ccmask_a (select_ccmask_b)), where select_ccmas
@@ -8789,8 +9049,329 @@ static bool combineCCMask(SDValue &CCReg, int &CCValid,
int &CCMask) {
return false;
}
-SDValue SystemZTargetLowering::combineBR_CCMASK(
-SDNode *N, DAGCombinerInfo &DCI) const {
+// Combine (select_ccmask_a (select_ccmask_b)), where select_ccmas
@@ -8789,8 +9049,329 @@ static bool combineCCMask(SDValue &CCReg, int &CCValid,
int &CCMask) {
return false;
}
-SDValue SystemZTargetLowering::combineBR_CCMASK(
-SDNode *N, DAGCombinerInfo &DCI) const {
+// Combine (select_ccmask_a (select_ccmask_b)), where select_ccmas
@@ -8789,8 +9029,535 @@ static bool combineCCMask(SDValue &CCReg, int &CCValid,
int &CCMask) {
return false;
}
-SDValue SystemZTargetLowering::combineBR_CCMASK(
-SDNode *N, DAGCombinerInfo &DCI) const {
+// Combine (select_ccmask_a (select_ccmask_b)), where select_ccmas
@@ -8781,8 +8958,483 @@ static bool combineCCMask(SDValue &CCReg, int &CCValid,
int &CCMask) {
return false;
}
-SDValue SystemZTargetLowering::combineBR_CCMASK(
-SDNode *N, DAGCombinerInfo &DCI) const {
+// Combine (select_ccmask_a (select_ccmask_b)), where select_ccmas
@@ -8789,8 +9029,535 @@ static bool combineCCMask(SDValue &CCReg, int &CCValid,
int &CCMask) {
return false;
}
-SDValue SystemZTargetLowering::combineBR_CCMASK(
-SDNode *N, DAGCombinerInfo &DCI) const {
+// Combine (select_ccmask_a (select_ccmask_b)), where select_ccmas
@@ -8703,51 +8738,256 @@ SDValue SystemZTargetLowering::combineSETCC(
}
static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
- // We have a SELECT_CCMASK or BR_CCMASK comparing the condition code
- // set by the CCReg instruction using the CCValid / CCMask
@@ -8703,51 +8738,256 @@ SDValue SystemZTargetLowering::combineSETCC(
}
static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
- // We have a SELECT_CCMASK or BR_CCMASK comparing the condition code
- // set by the CCReg instruction using the CCValid / CCMask
@@ -8703,51 +8738,256 @@ SDValue SystemZTargetLowering::combineSETCC(
}
static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
- // We have a SELECT_CCMASK or BR_CCMASK comparing the condition code
- // set by the CCReg instruction using the CCValid / CCMask
@@ -8781,8 +8981,499 @@ static bool combineCCMask(SDValue &CCReg, int &CCValid,
int &CCMask) {
return false;
}
-SDValue SystemZTargetLowering::combineBR_CCMASK(
-SDNode *N, DAGCombinerInfo &DCI) const {
+// Combine (select_ccmask_a (select_ccmask_b)), where select_ccmas
@@ -8703,51 +8738,256 @@ SDValue SystemZTargetLowering::combineSETCC(
}
static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
- // We have a SELECT_CCMASK or BR_CCMASK comparing the condition code
- // set by the CCReg instruction using the CCValid / CCMask
@@ -8789,8 +9029,535 @@ static bool combineCCMask(SDValue &CCReg, int &CCValid,
int &CCMask) {
return false;
}
-SDValue SystemZTargetLowering::combineBR_CCMASK(
-SDNode *N, DAGCombinerInfo &DCI) const {
+// Combine (select_ccmask_a (select_ccmask_b)), where select_ccmas
@@ -8703,51 +8738,256 @@ SDValue SystemZTargetLowering::combineSETCC(
}
static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
- // We have a SELECT_CCMASK or BR_CCMASK comparing the condition code
- // set by the CCReg instruction using the CCValid / CCMask
@@ -8789,8 +9029,535 @@ static bool combineCCMask(SDValue &CCReg, int &CCValid,
int &CCMask) {
return false;
}
-SDValue SystemZTargetLowering::combineBR_CCMASK(
-SDNode *N, DAGCombinerInfo &DCI) const {
+// Combine (select_ccmask_a (select_ccmask_b)), where select_ccmas
@@ -8703,51 +8738,256 @@ SDValue SystemZTargetLowering::combineSETCC(
}
static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
- // We have a SELECT_CCMASK or BR_CCMASK comparing the condition code
- // set by the CCReg instruction using the CCValid / CCMask
@@ -8781,8 +8958,483 @@ static bool combineCCMask(SDValue &CCReg, int &CCValid,
int &CCMask) {
return false;
}
-SDValue SystemZTargetLowering::combineBR_CCMASK(
-SDNode *N, DAGCombinerInfo &DCI) const {
+// Combine (select_ccmask_a (select_ccmask_b)), where select_ccmas
uweigand wrote:
Both `clang-s390x-linux` and `clang-s390x-linux-lnt` failed with the same
`Clang::bindings.sh` error:
https://lab.llvm.org/buildbot/#/builders/42/builds/5208
https://lab.llvm.org/buildbot/#/builders/136/builds/4462
The `clang-s390x-linux-multistage` run including this change did
@@ -8781,8 +8981,499 @@ static bool combineCCMask(SDValue &CCReg, int &CCValid,
int &CCMask) {
return false;
}
-SDValue SystemZTargetLowering::combineBR_CCMASK(
-SDNode *N, DAGCombinerInfo &DCI) const {
+// Combine (select_ccmask_a (select_ccmask_b)), where select_ccmas
@@ -8695,6 +8730,106 @@ SDValue SystemZTargetLowering::combineSETCC(
}
static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
+ // CCMask for ICmp is equal to 0, 1, 2 or 3.
+ const auto CCMaskForICmpEQCCVal = [](unsigned CC) {
+assert(CC < 4 && "CC out of
@@ -8781,8 +8981,499 @@ static bool combineCCMask(SDValue &CCReg, int &CCValid,
int &CCMask) {
return false;
}
-SDValue SystemZTargetLowering::combineBR_CCMASK(
-SDNode *N, DAGCombinerInfo &DCI) const {
+// Combine (select_ccmask_a (select_ccmask_b)), where select_ccmas
@@ -8781,8 +8981,499 @@ static bool combineCCMask(SDValue &CCReg, int &CCValid,
int &CCMask) {
return false;
}
-SDValue SystemZTargetLowering::combineBR_CCMASK(
-SDNode *N, DAGCombinerInfo &DCI) const {
+// Combine (select_ccmask_a (select_ccmask_b)), where select_ccmas
@@ -8781,8 +8981,499 @@ static bool combineCCMask(SDValue &CCReg, int &CCValid,
int &CCMask) {
return false;
}
-SDValue SystemZTargetLowering::combineBR_CCMASK(
-SDNode *N, DAGCombinerInfo &DCI) const {
+// Combine (select_ccmask_a (select_ccmask_b)), where select_ccmas
@@ -8781,8 +8981,499 @@ static bool combineCCMask(SDValue &CCReg, int &CCValid,
int &CCMask) {
return false;
}
-SDValue SystemZTargetLowering::combineBR_CCMASK(
-SDNode *N, DAGCombinerInfo &DCI) const {
+// Combine (select_ccmask_a (select_ccmask_b)), where select_ccmas
@@ -8781,8 +8981,499 @@ static bool combineCCMask(SDValue &CCReg, int &CCValid,
int &CCMask) {
return false;
}
-SDValue SystemZTargetLowering::combineBR_CCMASK(
-SDNode *N, DAGCombinerInfo &DCI) const {
+// Combine (select_ccmask_a (select_ccmask_b)), where select_ccmas
@@ -8781,8 +8958,483 @@ static bool combineCCMask(SDValue &CCReg, int &CCValid,
int &CCMask) {
return false;
}
-SDValue SystemZTargetLowering::combineBR_CCMASK(
-SDNode *N, DAGCombinerInfo &DCI) const {
+// Combine (select_ccmask_a (select_ccmask_b)), where select_ccmas
https://github.com/uweigand edited
https://github.com/llvm/llvm-project/pull/125970
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/uweigand commented:
Once again not a full review, but comments on the combiner changes.
https://github.com/llvm/llvm-project/pull/125970
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/l
@@ -8695,6 +8730,106 @@ SDValue SystemZTargetLowering::combineSETCC(
}
static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
+ // CCMask for ICmp is equal to 0, 1, 2 or 3.
+ const auto CCMaskForICmpEQCCVal = [](unsigned CC) {
+assert(CC < 4 && "CC out of
@@ -8728,9 +8928,9 @@ static bool combineCCMask(SDValue &CCReg, int &CCValid,
int &CCMask) {
auto *FalseVal = dyn_cast(CompareLHS->getOperand(1));
if (!FalseVal)
return false;
-if (CompareRHS->getAPIntValue() == FalseVal->getAPIntValue())
+if (CompareRHS-
@@ -8695,6 +8730,83 @@ SDValue SystemZTargetLowering::combineSETCC(
}
static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
+ // CCMask for ICmp is equal to 0, 1, 2 or 3.
+ const auto CCMaskForICmpEQCCVal = [](unsigned CC) {
+assert(CC < 4 && "CC out of
@@ -8781,8 +8958,483 @@ static bool combineCCMask(SDValue &CCReg, int &CCValid,
int &CCMask) {
return false;
}
-SDValue SystemZTargetLowering::combineBR_CCMASK(
-SDNode *N, DAGCombinerInfo &DCI) const {
+// Combine (select_ccmask_a (select_ccmask_b)), where select_ccmas
@@ -8695,6 +8730,83 @@ SDValue SystemZTargetLowering::combineSETCC(
}
static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
+ // CCMask for ICmp is equal to 0, 1, 2 or 3.
+ const auto CCMaskForICmpEQCCVal = [](unsigned CC) {
+assert(CC < 4 && "CC out of
@@ -8781,8 +8958,483 @@ static bool combineCCMask(SDValue &CCReg, int &CCValid,
int &CCMask) {
return false;
}
-SDValue SystemZTargetLowering::combineBR_CCMASK(
-SDNode *N, DAGCombinerInfo &DCI) const {
+// Combine (select_ccmask_a (select_ccmask_b)), where select_ccmas
1 - 100 of 433 matches
Mail list logo