[X86] Fix cmp order in probing BuildStackAlignAND
authorJosh Stone <jistone@redhat.com>
Sat, 10 Dec 2022 01:06:04 +0000 (17:06 -0800)
committerJosh Stone <jistone@redhat.com>
Tue, 13 Dec 2022 20:10:39 +0000 (12:10 -0800)
commit9b8fcd04ef64cbe124f30b8cb49633b785b840d7
tree695c4d3076145ce44cd1af9f04b1cf5717edcadc
parentd08e3ae271a9748af6c99be7e455730fb110b0a5
[X86] Fix cmp order in probing BuildStackAlignAND

Due to reversed arguments, the loop start was almost always skipping the
whole loop, since FinalStackProbed is probably less than StackPtr for
large alignments. The intent was to skip the loop if the first sub on
StackPtr made it less than FinalStackProbed already, so flip it.

Reviewed By: serge-sans-paille

Differential Revision: https://reviews.llvm.org/D139756
llvm/lib/Target/X86/X86FrameLowering.cpp
llvm/test/CodeGen/X86/stack-clash-large-large-align.ll
llvm/test/CodeGen/X86/stack-clash-small-large-align.ll