Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Consider synthesizing ptrint + arithmetic + inttoptr to GEP #14254

Open Quuxplusone opened 12 years ago

Quuxplusone commented 12 years ago
Bugzilla Link PR14226
Status NEW
Importance P enhancement
Reported by Carlo Kok (ck@remobjects.com)
Reported on 2012-10-31 07:53:49 -0700
Last modified on 2016-03-03 04:26:36 -0800
Version trunk
Hardware All All
CC baldrick@free.fr, david.majnemer@gmail.com, efriedma@quicinc.com, geek4civic@gmail.com, hfinkel@anl.gov, llvm-bugs@lists.llvm.org, rafael@espindo.la, trass3r@gmail.com
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
This is a feature request to start a discussion on consideration of turning
constructs like
%4 = ptrtoint i8* %3 to i64
%5 = add i64 %4, 5
%6 = inttoptr i64 %5 to i8*

into a single gep
%4 = gep %3, 5

(Whenever possible) as an early optimization; as GEPs. Since GEP is optimized a
lot by other optimization psses.
Quuxplusone commented 12 years ago

This transformation isn't safe in general; see http://llvm.org/docs/LangRef.html#pointeraliasing .

Quuxplusone commented 8 years ago
Could you elaborate on that?
Can't it be made in a safe way using AA?