[PATCH] D38143: Dynamic stack alignment for Thumb1

Renato Golin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 22 08:01:52 PDT 2017


rengolin added inline comments.


================
Comment at: lib/Target/ARM/Thumb1FrameLowering.cpp:357
+    const unsigned NrBitsToZero = countTrailingZeros(MFI.getMaxAlignment());
+    // Emit the following sequence, using R4 as a temporary, since we cannot use
+    // SP as a source or destination register for the shifts:
----------------
hard-coding r4 here is bound to create problems. You need to make sure it's saved earlier (and popped later).

You also add four instructions to the prologue, which in Thumb1 is not great. It' better than bad codegen, of course, but you need to make sure how often the realignment will hit (from being fatal, I'm guessing not often), or if there's another way to do this (I can't think of anything).

Welcoming comments from people with more Thumb1 experience than myself.


https://reviews.llvm.org/D38143





More information about the llvm-commits mailing list