[PATCH] D17936: [LICM] Don't silently ignore constant expressions in promoteLoopAccessesToScalars()

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 11 18:19:53 PST 2016


sanjoy added a comment.

In http://reviews.llvm.org/D17936#373784, @reames wrote:

> Ah, that was really helpful.  This is definitely an AST bug.  
>  "bitcast (i32* getelementptr inbounds ([4 x i32], [4 x i32]* @v, i32 0, i32 1) to i8*" and "getelementptr inbounds ([4 x i32], [4 x i32]* @v, i32 0, i32 1)" are the same address and thus must be must alias.  Both of them should be appearing in the alias set.  The fact they're not is very surprising.


The problem is that AST calls `MemIntrinsic::getDest` to get the pointer it should add, which returns the pointer after `stripPointerCasts` (though I'm not convinced (either way) that differentiating `x` and `(bitcast x to Y)` in AST is a good idea, since they're the same value at runtime).


http://reviews.llvm.org/D17936





More information about the llvm-commits mailing list