[PATCH] D36858: [x86] Teach the cmov converter to aggressively convert cmovs with memory operands into control flow.

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 19 16:38:48 PDT 2017


chandlerc added a comment.

In https://reviews.llvm.org/D36858#846610, @aaboud wrote:

> There is still an issue with this implementation, here another reproducer:
>
>   target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
>   target triple = "x86_64-unknown-unknown"
>  
>   define i32 @bar(i32* %a, i32* %b, i32* %c, i32 %n1, i32 %n2, i32 %d) #0 {
>   entry:
>     %cmp = icmp sgt i32 %n1, %n2
>     %s1 = select i1 %cmp, i32* %a, i32* %b
>     %s = select i1 %cmp, i32* %c, i32* %s1
>     %p = getelementptr inbounds i32, i32* %s, i64 1
>     %load = load i32, i32* %p, align 4
>     %res = select i1 %cmp, i32 %d, i32 %load
>    
>     ret i32 %res
>   }
>  
>   attributes #0 = {"target-cpu"="skylake"}
>


Good catch, fixed in r311267.


Repository:
  rL LLVM

https://reviews.llvm.org/D36858





More information about the llvm-commits mailing list