Also, changes how the CSR loop is indexed, which should avoid bugs like the one fixed by rG4a57bb5a3b74bdad9b0518009a7d7ac7ca2ac650
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
This does look similar at first glance. What's the point of doing this? Why were these paths split in the first place?
They were split when these two loops where first created in rGd31f55c2361068d71f988829d167ce9e24b8f813. I'm not sure why they weren't done as 1 loop like I have here.
It seem like the split has already caused issues with changes to one loop not getting mirrored to the other: rG4a57bb5a3b74bdad9b0518009a7d7ac7ca2ac650 added a MaxCSFrameIndex >= MinCSFrameIndex condition to the else, which was only later mirrored to the other loop by rGea0eec69f16e0f1b00fec413986e4e44f6f627fa.
Not to mention rG6893926b69088eb65053470802e00081234684a7, which hasn't yet been mirrored, and it's not clear if it should (see my comment).
The goal is to generally tidy things up, and prevent similar issues from happening in the future.
llvm/lib/CodeGen/PrologEpilogInserter.cpp | ||
---|---|---|
871–873 | This was added by rG6893926b69088eb65053470802e00081234684a7, but only to one of the code paths, so I'm not sure if it should be added to both. @arsenm Any memory of whether there was a good reason to only add it to one half? | |
880–882 | For CSRs, the check/update to MaxAlign by AdjustStackOffset should be redundant since rG3b065cdb64b4dcd14c43e8d4e22f2bde680740a7. I'm not sure whether I should do what I have here and assert the expected behaviour, or just pass a dummy value to AdjustStackOffset so the compiler can more easily optimize that bit out when it presumably inlines AdjustStackOffset. |
This was added by rG6893926b69088eb65053470802e00081234684a7, but only to one of the code paths, so I'm not sure if it should be added to both. @arsenm Any memory of whether there was a good reason to only add it to one half?