================
@@ -2837,8 +2837,37 @@ void SelectionDAGBuilder::visitBr(const BranchInst &I) {
       Opcode = Instruction::And;
     else if (match(BOp, m_LogicalOr(m_Value(BOp0), m_Value(BOp1))))
       Opcode = Instruction::Or;
-
-    if (Opcode &&
+    auto &TLI = DAG.getTargetLoweringInfo();
+    bool BrSrlIPM = FuncInfo.MF->getTarget().getTargetTriple().getArch() ==
+                    Triple::ArchType::systemz;
----------------
uweigand wrote:

We really shouldn't have triple checks here in common SelectionDAG code.  If 
absolutely needed, this should be abstracted behind appropriate target 
callbacks.

However, I'm wondering if this is indeed needed at all at this point.  Can't we 
just let common code canonicalize the sequence of if statements into a switch 
statement, and then recognize the particular form of switch (with input coming 
from an `IPM`, and only two different switch targets) in platform-specific 
DAGCombine and directly translate it into a ccmask branch?

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

Reply via email to