<div dir="ltr"><div><div><div><div>> That's because sext64(zext64(v)) == zext64(v)<br>>  sext(zext(y)) is not interesting because the sign bit is known to be zero<br></div>Ach, I missed this! This means a VariableGEPIndex only needs two counters, one for the number of bits SExt'ed and one for the number of bits ZExt'ed - and the ExtensionKind enum can be removed entirely. I've updated <a href="http://reviews.llvm.org/D6682">http://reviews.llvm.org/D6682</a> - it's much cleaner (+174,-57 plus tests) now.<br><br>> How are you getting a MustAlias?<br></div>Hm, I can't reproduce this. On stepping through that example in a build of 3f2027522c83fcb4fd8629b6395cec82bfda9cd1 it seems the PartialAlias decision comes because GetLinearExpression doesn't look through the two sext instructions (%sext.1 and %sext.2), so GetIndexDifference doesn't cancel the two expressions out. This means that it doesn't decide that %a and %b NoAlias in the below:<br><br>define void @test_zext_sext_amounts255(i8* %mem) {<br>  %sext.1 = sext i8 255 to i16<br>  %sext.zext.1 = zext i16 %sext.1 to i64<br>  %sext.2 = sext i8 255 to i32<br>  %sext.zext.2 = zext i32 %sext.2 to i64<br>  %a = getelementptr inbounds i8* %mem, i64 %sext.zext.1<br>  %b = getelementptr inbounds i8* %mem, i64 %sext.zext.2<br>  ret void<br>}<br><br>.> Expecting it to work just as well on un-optimized IR is not reasonable.<br></div>OK, that makes sense.<br><br>Thanks -<br><br></div><div>Nick<br></div></div>