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

Amjad Aboud via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 19 11:55:12 PDT 2017


aaboud added a comment.

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"}


Repository:
  rL LLVM

https://reviews.llvm.org/D36858





More information about the llvm-commits mailing list