[PATCH] [AArch64] Generate tbz/tbnz when comparing against zero.

Jiangning Liu liujiangning1 at gmail.com
Wed Jul 30 20:42:13 PDT 2014


Hi Chad,

Your comment says "// TBNZ only operates on i64's, but the ext should be
free.", so why TBZ/TBNZ only operates on 64-bit?

ARMARM says both W and X are supported.

+        if (LHS.getValueType() == MVT::i32)
+          LHS = DAG.getAnyExtOrTrunc(LHS, dl, MVT::i64);

This promotion finally will be transformed back to 32-bit version by this
pat, I think.

  def : Pat<(node GPR64:$Rn, tbz_imm0_31_diag:$imm, bb:$target),
            (!cast<Instruction>(NAME#"W") (EXTRACT_SUBREG GPR64:$Rn,
sub_32),
            tbz_imm0_31_diag:$imm, bb:$target)>;

Your code logic doesn't have issue, but at least the comment is misleading,
so could you please remove it?

And if you like, could you please change to use 32-bit version of TBZ/TBNZ
for 32-bit case directly?

Thanks,
-Jiangning



2014-07-30 11:21 GMT+08:00 Jiangning Liu <liujiangning1 at gmail.com>:

> Hi Chad,
>
> I'm happy with this, and your new patch looks good to me if only you can
> add more comments in the code around excluding AND, because at the first
> look it's strange.
>
> Thanks,
> -Jiangning
>
> 2014-07-30 0:02 GMT+08:00 Chad Rosier <mcrosier at codeaurora.org>:
>
> > >>! In D4440#12, @mcrosier wrote:
> > > The performance numbers are slightly better, but still less than noise.
> >  All, please take a look.
> >
> > To be clear, the numbers are slightly better relative to the ADD/SUB only
> > combine.  Overall, we still see a large improvement in eembc/OAv2.
> >
> > http://reviews.llvm.org/D4440
> >
> >
> >
>
> http://reviews.llvm.org/D4440
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140731/9982e2f0/attachment.html>


More information about the llvm-commits mailing list