This is an archive of the discontinued LLVM Phabricator instance.

[X86] Fix cmp order in probing BuildStackAlignAND
ClosedPublic

Authored by cuviper on Dec 9 2022, 5:13 PM.

Details

Summary

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.

Diff Detail

Event Timeline

cuviper created this revision.Dec 9 2022, 5:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 9 2022, 5:13 PM
cuviper requested review of this revision.Dec 9 2022, 5:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 9 2022, 5:13 PM

Thanks for spotting this! Reading the generated assembly again, we were indeed jumping over the actual loop instead of short-circuiting it...

This revision is now accepted and ready to land.Dec 13 2022, 11:45 AM
This revision was automatically updated to reflect the committed changes.