================
@@ -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)) {
----------------
dominik-steenken wrote:

That was the way i tried to do it initially - replacing `ICMP` with 
`COMPARE_STACK_GUARD` seemed to make the most sense. .But i had a lot of 
trouble getting the cc def/use to work. Ultimately, it was easier to do it on 
the branch, so that i could manually make that link. It's been a while, so i am 
a bit fuzzy on the details.

I will try the third way you mentioned now, though. If i can emit 
`COMPARE_STACK_GUARD_DAG` in `getCmp`, and the whole machinery after that just 
works, that would be ideal.

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