[LLVMbugs] [Bug 14032] New: Missed optimization: could form GEP of nicer type

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Oct 5 13:58:09 PDT 2012


http://llvm.org/bugs/show_bug.cgi?id=14032

             Bug #: 14032
           Summary: Missed optimization: could form GEP of nicer type
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: baldrick at free.fr
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


The following kind of thing is produced by dragonegg from GCC's "pointer-plus
expression".  The whole function could be turned into something like this:

  %pp = getelementptr inbounds double* %p, i64 %i
  %l = load double* %pp

by the optimizers, but it isn't.  Testcase:

target datalayout =
"e-p:64:64:64-S128-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f16:16:16-f32:32:32-f64:64:64-f128:128:128-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"

define double @foo(double *%p, i64 %i) {
  %o = mul i64 %i, 8
  %q = bitcast double* %p to i8*
  %pp = getelementptr inbounds i8* %q, i64 %o
  %r = bitcast i8* %pp to double*
  %l = load double* %r
  ret double %l
}

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list