[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
Thu Feb 15 05:47:56 PST 2018


rogfer01 added inline comments.


================
Comment at: test/CodeGen/ARM/select-imm.ll:239
+; THUMB1: bl f
+; THUMB1: sxtb r1, r4
+; THUMB1: uxtb r0, r1
----------------
samparker wrote:
> Why do we have a sxtb for T1 and not T2?
This comes from the load byte + sext in that testcase.

In Thumb2 we can coalesce the load byte + sext in a single `ldrsb.w Rt, [Rn, #0]` while in Thumb1 we can't do that (at least directly) because there `ldsrb` is of the form `ldsrb Rt, [Rn, Rm]` so a `ldrb Rt, [Rn, #0]` and then a `sxtb Rt, Rn` are used instead.


https://reviews.llvm.org/D34515





More information about the llvm-commits mailing list