[LLVMbugs] [Bug 4589] Invalid GEP optimization after bitcast

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sun Jul 19 21:35:08 PDT 2009


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


Sterling Stuart Stein <stein at ir.iit.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |




--- Comment #2 from Sterling Stuart Stein <stein at ir.iit.edu>  2009-07-19 23:35:07 ---
Your comment is true, but missing the point.
If you add a target field, then the optimization works correctly.
I was able to duplicate what you gave in your post.
However, the difficult arises when the
target datalayout is not given.  Apparently, without it,
the optimization assumes 64-bit.

I understand that BitCode is not entirely platform independent.
However, it should refrain from making platform-specific
optimizations when it doesn't actually know what the platform is.
When you compile that code (without the 32-bit target datalayout)
on a 32-bit machine, it still compiles it as if it was
for a 64-bit machine.  Hence, it is a bug.

Side question: What's the advantage of saying GEP 8 over GEP 0,1 anyways?
Won't LLVM generate the same code either way (but with delaying the
offset calculation until it knows which platform it is on)?
Or do other optimizations depend on this somehow?


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