search for: canoncalize

Displaying 2 results from an estimated 2 matches for "canoncalize".

Did you mean: canonicalize
2014 Sep 10
3
[LLVMdev] Canonicalization of ptrtoint/inttoptr and getelementptr
.... > > In any case, the general advice is that people should prefer to use > getelementptr to begin with. LLVM's own optimizers were converted to > use getelementptr instead of ptrtoint+add+inttoptr even when they have > to do raw byte arithmetic. It would be nice to be able to canoncalize ptrtoint+add+inttoptr to geps. Having seemingly reasonable-looking legal IR that simply doesn't optimize is not the best introduction for new frontend authors. :) > > > On Sat, Aug 30, 2014 at 6:01 PM, David Majnemer > <david.majnemer at gmail.com <mailto:david.majnemer a...
2014 Aug 31
3
[LLVMdev] Canonicalization of ptrtoint/inttoptr and getelementptr
Consider the two functions bellow: define i8* @f(i8* %A) { %pti = ptrtoint i8* %A to i64 %add = add i64 %pti, 5 %itp = inttoptr i64 %add to i8* ret i8* %itp} define i8* @g(i8* %A) { %gep = getelementptr i8* %A, i64 5 ret i8* %gep} What, if anything, prevents us from canonicalizing @f to @g?I've heard that this might be in violation of http://llvm.org/docs/LangRef.html#pointeraliasing