[X86] Use BuildStackAdjustment in stack probes
authorJosh Stone <jistone@redhat.com>
Thu, 22 Sep 2022 19:56:20 +0000 (12:56 -0700)
committerJosh Stone <jistone@redhat.com>
Fri, 23 Sep 2022 16:30:32 +0000 (09:30 -0700)
commitcb46ffdbf44c4c9097531091dca92acf54844150
tree39722eadb55ab2d32811b2484a05238546d23823
parent26c37b461a02815ccd5d0b4300823542ceeed54e
[X86] Use BuildStackAdjustment in stack probes

This has the advantage of dealing with live EFLAGS, using LEA instead of
SUB if needed to avoid clobbering. That also respects feature "lea-sp".

We could allow unrolled stack probing from blocks with live-EFLAGS, if
canUseAsEpilogue learns when emitStackProbeInlineGeneric will be used.

Differential Revision: https://reviews.llvm.org/D134495
llvm/lib/Target/X86/X86FrameLowering.cpp
llvm/test/CodeGen/X86/probe-stack-eflags.ll