[PATCH] D72366: [AArch64] Stack frame reordering.

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 27 13:28:31 PDT 2020


eugenis marked 2 inline comments as done.
eugenis added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64FrameLowering.cpp:3125
+  int ObjectIndex = 0;
+  // Group ID this object belongs to.
+  int GroupIndex = -1;
----------------
danielkiss wrote:
> IMHO if the data structure would be vector of vectors of FrameObjects then maybe the whole logic would be a bit simpler, but maybe I missed something.
> 
Do you mean a list of groups, where each group is a list of objects?
In that case we would have to deal with the possibility that one object participates in multiple groups, and resolve that somehow when building the final frame order. In the current implementation, the object always abandons its old group when joining a new one - it's not optimal, but simple and seems to work fine.

Also, FrameObjectCompare needs a fast way to determine when two objects are in the same group, hence group id is a member of FrameObject, and not vice versa.



================
Comment at: llvm/lib/Target/AArch64/AArch64FrameLowering.cpp:3193
+    const MachineFunction &MF, SmallVectorImpl<int> &ObjectsToAllocate) const {
+  if (!OrderFrameObjects || ObjectsToAllocate.empty())
+    return;
----------------
efriedma wrote:
> Can we skip running this code when stack tagging is disabled?  It doesn't do anything in that case, I think, but it would avoid running a bunch of unnecessary code, and make the intent more clear.
Sure, we can look for the sanitize_memtag attribute. Stack tagging instructions can be added some other way of course (ex. with intrinsic calls in the C source).
We could check if MTE is in the subtarget's feature bits, but that would not help much.




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72366





More information about the llvm-commits mailing list