[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-09-03 Thread Ulrich Weigand via cfe-commits
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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-09-02 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-09-01 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-09-01 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-09-01 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-09-01 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-09-01 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-09-01 Thread Ulrich Weigand via cfe-commits
@@ -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;

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-09-01 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-09-01 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-09-01 Thread Ulrich Weigand via cfe-commits
@@ -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/

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-09-01 Thread Ulrich Weigand via cfe-commits
@@ -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. +

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-09-01 Thread Ulrich Weigand via cfe-commits
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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-29 Thread Ulrich Weigand via 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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-29 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-28 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-28 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-28 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-28 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-28 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-28 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-22 Thread Ulrich Weigand via 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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-22 Thread Ulrich Weigand via 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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-22 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-22 Thread Ulrich Weigand via 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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-22 Thread Ulrich Weigand via 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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-22 Thread Ulrich Weigand via 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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-22 Thread Ulrich Weigand via 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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-22 Thread Ulrich Weigand via 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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-22 Thread Ulrich Weigand via 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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-22 Thread Ulrich Weigand via cfe-commits
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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-22 Thread Ulrich Weigand via 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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-22 Thread Ulrich Weigand via cfe-commits
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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-22 Thread Ulrich Weigand via 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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-20 Thread Ulrich Weigand via 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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-20 Thread Ulrich Weigand via cfe-commits
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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-20 Thread Ulrich Weigand via 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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-20 Thread Ulrich Weigand via 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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-20 Thread Ulrich Weigand via 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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-20 Thread Ulrich Weigand via 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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-20 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-20 Thread Ulrich Weigand via 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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-20 Thread Ulrich Weigand via 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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-20 Thread Ulrich Weigand via 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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-20 Thread Ulrich Weigand via 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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-20 Thread Ulrich Weigand via 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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-20 Thread Ulrich Weigand via 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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-20 Thread Ulrich Weigand via cfe-commits
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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-20 Thread Ulrich Weigand via 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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-20 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-20 Thread Ulrich Weigand via 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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-20 Thread Ulrich Weigand via 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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-11 Thread Ulrich Weigand via 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; +

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-11 Thread Ulrich Weigand via 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; +

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-11 Thread Ulrich Weigand via 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; +

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-11 Thread Ulrich Weigand via 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; +

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-11 Thread Ulrich Weigand via 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; +

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-11 Thread Ulrich Weigand via cfe-commits
@@ -803,7 +805,10 @@ SystemZTargetLowering::SystemZTargetLowering(const TargetMachine &TM, ISD::SREM, ISD::UREM, ISD::INTRINSIC_VOID, - ISD::INTRINSIC_W_CHAIN}); +

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-11 Thread Ulrich Weigand via 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; +

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-11 Thread Ulrich Weigand via 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; +

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-11 Thread Ulrich Weigand via 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; +

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-11 Thread Ulrich Weigand via cfe-commits
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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-11 Thread Ulrich Weigand via 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; +

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-08-11 Thread Ulrich Weigand via cfe-commits
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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-07-23 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-07-23 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-07-23 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-07-23 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-07-23 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-07-23 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-07-14 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-07-14 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-07-14 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-07-14 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-07-14 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-07-14 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-07-14 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-07-14 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-07-14 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-07-14 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-07-14 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-07-14 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-07-14 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] [clang][python][test] Move python binding tests to lit framework (PR #146844)

2025-07-08 Thread Ulrich Weigand via cfe-commits
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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-07-07 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-07-07 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-07-07 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-07-07 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-07-07 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-07-07 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-07-07 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-07-07 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-07-07 Thread Ulrich Weigand via cfe-commits
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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-07-07 Thread Ulrich Weigand via 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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-07-07 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-07-07 Thread Ulrich Weigand via cfe-commits
@@ -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-

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-06-30 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-06-30 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-06-30 Thread Ulrich Weigand via cfe-commits
@@ -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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-06-30 Thread Ulrich Weigand via cfe-commits
@@ -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   2   3   4   5   >