[llvm] r245640 - AArch64: Do not create CCMP on multiple users.

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 20 16:54:02 PDT 2015


> On Aug 20, 2015, at 4:36 PM, Ahmed Bougacha via llvm-commits <llvm-commits at lists.llvm.org> wrote:
> 
> On Thu, Aug 20, 2015 at 4:33 PM, Matthias Braun via llvm-commits <llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>> wrote:
> Author: matze
> Date: Thu Aug 20 18:33:31 2015
> New Revision: 245640
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=245640&view=rev <https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D245640-26view-3Drev&d=BQMFaQ&c=eEvniauFctOgLOKGJOplqw&r=owCLIXjMdMpT1E9Ei7smWg&m=SwPFYUtzb34zudHl7guM4kicNsYswquFqXuwto7qp2I&s=HFGffUF9Csqwpja2-BCe38jqCCyA6ZBAaTRVc1IrrLg&e=>
> Log:
> AArch64: Do not create CCMP on multiple users.
> 
> Create CMP;CCMP sequences from and/or trees does not gain us anything if
> the and/or tree is materialized to a GP register anyway. While most of
> the code already checked for hasOneUse() there was one important case
> missing.
> 
> Modified:
>     llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp
>     llvm/trunk/test/CodeGen/AArch64/arm64-ccmp.ll
> 
> Modified: llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp?rev=245640&r1=245639&r2=245640&view=diff <https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_lib_Target_AArch64_AArch64ISelLowering.cpp-3Frev-3D245640-26r1-3D245639-26r2-3D245640-26view-3Ddiff&d=BQMFaQ&c=eEvniauFctOgLOKGJOplqw&r=owCLIXjMdMpT1E9Ei7smWg&m=SwPFYUtzb34zudHl7guM4kicNsYswquFqXuwto7qp2I&s=OKVifkuGhkUwmSgUhDG7bVH1MpwGJ-KO2FPbP9W0jIY&e=>
> ==============================================================================
> --- llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp (original)
> +++ llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp Thu Aug 20 18:33:31 2015
> @@ -1349,7 +1349,7 @@ static SDValue emitConjunctionDisjunctio
>      unsigned NZCV = AArch64CC::getNZCVToSatisfyCondCode(InvOutCC);
>      return emitConditionalComparison(LHS, RHS, CC, CCOp, ConditionOp, NZCV, DL,
>                                       DAG);
> -  } else if (Opcode != ISD::AND && Opcode != ISD::OR)
> +  } else if ((Opcode != ISD::AND && Opcode != ISD::OR) || !Val->hasOneUse())
>      return SDValue();
> 
>    assert((Opcode == ISD::OR || !PushNegate)
> 
> Modified: llvm/trunk/test/CodeGen/AArch64/arm64-ccmp.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/arm64-ccmp.ll?rev=245640&r1=245639&r2=245640&view=diff <https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_test_CodeGen_AArch64_arm64-2Dccmp.ll-3Frev-3D245640-26r1-3D245639-26r2-3D245640-26view-3Ddiff&d=BQMFaQ&c=eEvniauFctOgLOKGJOplqw&r=owCLIXjMdMpT1E9Ei7smWg&m=SwPFYUtzb34zudHl7guM4kicNsYswquFqXuwto7qp2I&s=W4WVNP7X9HiTsBG7H-00HAJOO60OgHlTIp65kNG6bEQ&e=>
> ==============================================================================
> --- llvm/trunk/test/CodeGen/AArch64/arm64-ccmp.ll (original)
> +++ llvm/trunk/test/CodeGen/AArch64/arm64-ccmp.ll Thu Aug 20 18:33:31 2015
> @@ -373,8 +373,8 @@ define i32 @select_ororand(i32 %w0, i32
>    ret i32 %sel
>  }
> 
> -; CHECK-LABEL: select_noccmp
> -define i64 @select_noccmp(i64 %v1, i64 %v2, i64 %v3, i64 %r) {
> +; CHECK-LABEL: select_noccmp1
> +define i64 @select_noccmp1(i64 %v1, i64 %v2, i64 %v3, i64 %r) {
>  ; CHECK-NOT: CCMP
> 
> Should this be lowercase "ccmp" ?
Indeed, thanks for spotting this. Should have double checked that. Turns out I even broke my own testcase while cleaning my code for submission. Fix is coming soon...

- Matthias

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150820/44df30a9/attachment.html>


More information about the llvm-commits mailing list