[PATCH] D75755: [AArch64][Fix] LdSt optimization generate premature stack-popping

Diogo N. Sampaio via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 8 14:56:03 PDT 2020


dnsampaio marked an inline comment as done.
dnsampaio added a comment.

In D75755#1910057 <https://reviews.llvm.org/D75755#1910057>, @efriedma wrote:

> I think there's a secondary problem here: if we move an SP adjustment, we might also need to adjust the unwind/debug info.  This is particularly nasty on Windows, where messing up the unwind info can actually cause a miscompile.
>
> If you don't want to spend the time to try to figure that out, I'd be happy to just completely forbid optimizing sp adjustments here.  It should be rare enough that it doesn't matter much in practice.


Hi @efriedma, thanks for the review.
I would be glad in taking a look into the windows unwind issue, but I don't know anything about it. Could you give me some further details?
Perhaps we can just prevent any SP adjustment for the moment, until I have the windows fix in place.



================
Comment at: llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp:1832
+        }
+        if (PSVa->mayAlias(MFI)){
+          MayAliasFP = true;
----------------
efriedma wrote:
> I'm not sure what you think this mayAlias check is doing?
Following a similar code from MachineInstr.mayAlias code, I thought this was just eliminating some trivial cases where the instruction would not access the stack, but now that I see the definition, I'm not so sure.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75755/new/

https://reviews.llvm.org/D75755





More information about the llvm-commits mailing list