[PATCH] D34515: [ARM] Materialise some boolean values to avoid a branch

Roger Ferrer Ibanez via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 6 09:51:00 PDT 2017


rogfer01 added inline comments.


================
Comment at: lib/Target/ARM/ARMISelLowering.cpp:12128
+      if (Subtarget->isThumb() && !Subtarget->isThumb1Only() &&
+          Subtarget->hasV5TOps()) {
+        // If x == y then x - y == 0 and ARM's CLZ will return 32, shifting it
----------------
efriedma wrote:
> What are you trying to do here? With Thumb2, the relevant instructions are basically identical in ARM mode vs. Thumb mode, so doing this transform exclusively in Thumb mode doesn't really make sense.
Mmmh, I was trying to emit this in ARM because it is not always beneficial in `cmpxcg-O0` below. We're going from 2 instructions to 3.

For Thumb 2 I understand there is an IT block (which the test does not check) so we stay in 3 instructions.

(I'm aware that the metric "number of instructions" is a bit poor)

I may be missing something here.


https://reviews.llvm.org/D34515





More information about the llvm-commits mailing list