[llvm-bugs] [Bug 34603] failed to hoist load through select-of-pointers?

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Dec 14 14:34:52 PST 2017


https://bugs.llvm.org/show_bug.cgi?id=34603

Sanjay Patel <spatel+llvm at rotateright.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #29 from Sanjay Patel <spatel+llvm at rotateright.com> ---
After https://reviews.llvm.org/rL320749 :

define double @max_of_loads(double* nocapture readonly %x, double* nocapture
readonly %y, i32 %i) local_unnamed_addr #0 {
entry:
  %idxprom = sext i32 %i to i64
  %arrayidx = getelementptr inbounds double, double* %x, i64 %idxprom
  %0 = load double, double* %arrayidx, align 8, !tbaa !3
  %arrayidx2 = getelementptr inbounds double, double* %y, i64 %idxprom
  %1 = load double, double* %arrayidx2, align 8, !tbaa !3
  %cmp = fcmp ogt double %0, %1
  %. = select i1 %cmp, double %0, double %1
  ret double %.
}

And the max is back for x86:

$ ./clang -O2 -fomit-frame-pointer maxload.c -S -o -
        movslq  %edx, %rax
        movsd   (%rdi,%rax,8), %xmm0    ## xmm0 = mem[0],zero
        maxsd   (%rsi,%rax,8), %xmm0
        retq

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171214/821f99e3/attachment.html>


More information about the llvm-bugs mailing list