unsigned &SExtBits, const DataLayout &DL, unsigned Depth,
AssumptionCache *AC, DominatorTree *DT, bool &NSW, bool &NUW) {
assert(V->getType()->isIntegerTy() && "Not an integer value");
+ // TODO: SExtBits can be non-zero on entry.
+ assert(Scale == 0 && Offset == 0 && ZExtBits == 0 && NSW == true &&
+ NUW == true && "Incorrect default values");
// Limit our recursion depth.
if (Depth == 6) {
// than the constant's (the Offset's always as wide as the outermost call),
// so we'll zext here and process any extension in the isa<SExtInst> &
// isa<ZExtInst> cases below.
- Offset += Const->getValue().zextOrSelf(Offset.getBitWidth());
+ Offset = Const->getValue().zextOrSelf(Offset.getBitWidth());
assert(Scale == 0 && "Constant values don't have a scale");
return V;
}
ret void
}
+; CHECK-LABEL: Function: test_implicit_sext
+; CHECK: MustAlias: i8* %p.1, i8* %p.2
+; TODO: Should be MayAlias.
+define void @test_implicit_sext(i8* %p, i32 %x) {
+ %add = add i32 %x, 1
+ %ext = sext i32 %x to i64
+ %ext.add = add i64 %ext, 1
+ %p.1 = getelementptr i8, i8* %p, i32 %add
+ %p.2 = getelementptr i8, i8* %p, i64 %ext.add
+ ret void
+}
+
; Function Attrs: nounwind
declare noalias i8* @malloc(i64)