================
@@ -8891,6 +8964,43 @@ SDValue SystemZTargetLowering::combineBR_CCMASK(SDNode 
*N,
                        DAG.getTargetConstant(CCValidVal, SDLoc(N), MVT::i32),
                        DAG.getTargetConstant(CCMaskVal, SDLoc(N), MVT::i32),
                        N->getOperand(3), CCReg);
+
+  SDLoc DL(N);
+
+  // Combine BR_CCMASK (ICMP (Load FI, Load StackGuard)) into BRC
+  // (COMPARE_STACK_GUARD)
+  int FI = 0;
+  SDValue InChain, OutChain, StackGuardLoad;
+  if (isStackGuardCheck(N, FI, InChain, OutChain, StackGuardLoad, DCI)) {
----------------
uweigand wrote:

I don't understand why this needs to be done in combineBR_CCMASK - and why the 
branch needs to be touched at all.   Shouldn't we simply be able to replace the 
ICMP with COMPARE_STACK_GUARD_DAG either in a (to be added) combineICMP 
routine, or even just emit it this way from the beginning in getCmp/emitCmp?

https://github.com/llvm/llvm-project/pull/169317
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to