[llvm-bugs] [Bug 32446] New: [NewGVN] Store-to-Load forwarding failure if load is of different type

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Mar 27 21:36:16 PDT 2017


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

            Bug ID: 32446
           Summary: [NewGVN] Store-to-Load forwarding failure if load is
                    of different type
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: keno at alumni.harvard.edu
                CC: llvm-bugs at lists.llvm.org

Consider:
```
define i64 @foo(double %bar) {
    %slot = alloca double
    store double %bar, double *%slot
    %bcast = bitcast double *%slot to i64*
    %ival = load i64, i64* %bcast
    ret i64 %ival
}
```
With regular GVN:
$ opt -gvn -dse simple.ll -S
; ModuleID = 'simple.ll'
source_filename = "simple.ll"

define i64 @foo(double %bar) {
  %1 = bitcast double %bar to i64
  ret i64 %1
}

NewGVN:
define i64 @foo(double %bar) {
  %slot = alloca double
  store double %bar, double* %slot
  %bcast = bitcast double* %slot to i64*
  %ival = load i64, i64* %bcast
  ret i64 %ival
}

-- 
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/20170328/6b44f87d/attachment.html>


More information about the llvm-bugs mailing list