[PATCH] D52834: [ARM] Account for implicit IT when calculating inline asm size

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 3 12:15:50 PDT 2018


efriedma added a comment.

> The Arm MaxInstLength could be increased to 6

This seems like a better solution.

> but this may not be right for Arm as there is some code in the ConstantIslands pass that assumes 4-byte alignment of Arm instructions.

We can just round up the size of an inline asm to a multiple of 4 if the function is in ARM mode.



================
Comment at: lib/Target/ARM/ARMComputeBlockSize.cpp:62
+      if (isThumb)
+        InstSize += InstSize / 2;
+    }
----------------
Doing the adjustment *here* is pretty clearly wrong; getInstSizeInBytes is supposed to return a conservative estimate of the instruction size.  If it isn't conservative enough, we should fix it *there*, rather than try to hack around it afterwards.


https://reviews.llvm.org/D52834





More information about the llvm-commits mailing list