[PATCH] D34387: [PATCH 2/2] Implement "probe-stack" on x86

Patrick Walton via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 21 10:48:53 PDT 2017


pcwalton added inline comments.


================
Comment at: lib/Target/X86/X86FrameLowering.cpp:1253
+    if (SpillR11) {
+      pushRegForStackProbeCall(MF, MBB, MBBI, DL, R11Alive, X86::R11, NumBytes);
     }
----------------
majnemer wrote:
> Hmm, I believe a testcase for this situation hasn't been added.
Well, I'm not sure how R11 can actually be live-in in the function prolog right now. As I understand things, the reason why EAX is spilled if necessary is to handle the edge case on 32-bit x86 where `inreg` is specified for a function parameter, which causes EAX to be live-in at the very start of the function. But there's no corresponding `inreg` attribute for x86-64 that causes R11 to become live-in that early. Checking for that case even for R11 seemed prudent to me though, because (a) the corresponding situation can happen for EAX and it seemed cleaner to use the same logic for both registers instead of duplicating some of it; (b) in the future, if somehow R11 can become live-in at function start, this logic will be needed.

Am I interpreting the situation correctly, and if so, what would you prefer I do regarding testing?


https://reviews.llvm.org/D34387





More information about the llvm-commits mailing list