Index: llvm/trunk/lib/Transforms/IPO/WholeProgramDevirt.cpp =================================================================== --- llvm/trunk/lib/Transforms/IPO/WholeProgramDevirt.cpp +++ llvm/trunk/lib/Transforms/IPO/WholeProgramDevirt.cpp @@ -838,7 +838,7 @@ Target.WasDevirt = true; // Rewrite each call to a load from OffsetByte/OffsetBit. - Constant *ByteConst = ConstantInt::get(Int64Ty, OffsetByte); + Constant *ByteConst = ConstantInt::get(Int32Ty, OffsetByte); Constant *BitConst = ConstantInt::get(Int8Ty, 1ULL << OffsetBit); applyVirtualConstProp(CSByConstantArg.second, TargetsForSlot[0].Fn->getName(), ByteConst, BitConst); Index: llvm/trunk/test/Transforms/WholeProgramDevirt/virtual-const-prop-begin.ll =================================================================== --- llvm/trunk/test/Transforms/WholeProgramDevirt/virtual-const-prop-begin.ll +++ llvm/trunk/test/Transforms/WholeProgramDevirt/virtual-const-prop-begin.ll @@ -78,7 +78,7 @@ %fptrptr = getelementptr [3 x i8*], [3 x i8*]* %vtable, i32 0, i32 0 %fptr = load i8*, i8** %fptrptr %fptr_casted = bitcast i8* %fptr to i1 (i8*)* - ; CHECK: [[VTGEP1:%[^ ]*]] = getelementptr i8, i8* [[VT1]], i64 -5 + ; CHECK: [[VTGEP1:%[^ ]*]] = getelementptr i8, i8* [[VT1]], i32 -5 ; CHECK: [[VTLOAD1:%[^ ]*]] = load i8, i8* [[VTGEP1]] ; CHECK: [[VTAND1:%[^ ]*]] = and i8 [[VTLOAD1]], 2 ; CHECK: [[VTCMP1:%[^ ]*]] = icmp ne i8 [[VTAND1]], 0 @@ -98,7 +98,7 @@ %fptrptr = getelementptr [3 x i8*], [3 x i8*]* %vtable, i32 0, i32 1 %fptr = load i8*, i8** %fptrptr %fptr_casted = bitcast i8* %fptr to i1 (i8*)* - ; CHECK: [[VTGEP2:%[^ ]*]] = getelementptr i8, i8* [[VT2]], i64 -5 + ; CHECK: [[VTGEP2:%[^ ]*]] = getelementptr i8, i8* [[VT2]], i32 -5 ; CHECK: [[VTLOAD2:%[^ ]*]] = load i8, i8* [[VTGEP2]] ; CHECK: [[VTAND2:%[^ ]*]] = and i8 [[VTLOAD2]], 1 ; CHECK: [[VTCMP2:%[^ ]*]] = icmp ne i8 [[VTAND2]], 0 @@ -118,7 +118,7 @@ %fptrptr = getelementptr [3 x i8*], [3 x i8*]* %vtable, i32 0, i32 2 %fptr = load i8*, i8** %fptrptr %fptr_casted = bitcast i8* %fptr to i32 (i8*)* - ; CHECK: [[VTGEP3:%[^ ]*]] = getelementptr i8, i8* [[VT3]], i64 -4 + ; CHECK: [[VTGEP3:%[^ ]*]] = getelementptr i8, i8* [[VT3]], i32 -4 ; CHECK: [[VTBC3:%[^ ]*]] = bitcast i8* [[VTGEP3]] to i32* ; CHECK: [[VTLOAD3:%[^ ]*]] = load i32, i32* [[VTBC3]] %result = call i32 %fptr_casted(i8* %obj) Index: llvm/trunk/test/Transforms/WholeProgramDevirt/virtual-const-prop-check.ll =================================================================== --- llvm/trunk/test/Transforms/WholeProgramDevirt/virtual-const-prop-check.ll +++ llvm/trunk/test/Transforms/WholeProgramDevirt/virtual-const-prop-check.ll @@ -87,7 +87,7 @@ %pair = call {i8*, i1} @llvm.type.checked.load(i8* %vtablei8, i32 0, metadata !"typeid") %fptr = extractvalue {i8*, i1} %pair, 0 %fptr_casted = bitcast i8* %fptr to i1 (i8*)* - ; CHECK: [[VTGEP1:%[^ ]*]] = getelementptr i8, i8* [[VT1]], i64 -5 + ; CHECK: [[VTGEP1:%[^ ]*]] = getelementptr i8, i8* [[VT1]], i32 -5 ; CHECK: [[VTLOAD1:%[^ ]*]] = load i8, i8* [[VTGEP1]] ; CHECK: [[VTAND1:%[^ ]*]] = and i8 [[VTLOAD1]], 2 ; CHECK: [[VTCMP1:%[^ ]*]] = icmp ne i8 [[VTAND1]], 0 @@ -108,7 +108,7 @@ %pair = call {i8*, i1} @llvm.type.checked.load(i8* %vtablei8, i32 8, metadata !"typeid") %fptr = extractvalue {i8*, i1} %pair, 0 %fptr_casted = bitcast i8* %fptr to i1 (i8*)* - ; CHECK: [[VTGEP2:%[^ ]*]] = getelementptr i8, i8* [[VT2]], i64 -5 + ; CHECK: [[VTGEP2:%[^ ]*]] = getelementptr i8, i8* [[VT2]], i32 -5 ; CHECK: [[VTLOAD2:%[^ ]*]] = load i8, i8* [[VTGEP2]] ; CHECK: [[VTAND2:%[^ ]*]] = and i8 [[VTLOAD2]], 1 ; CHECK: [[VTCMP2:%[^ ]*]] = icmp ne i8 [[VTAND2]], 0 @@ -129,7 +129,7 @@ %pair = call {i8*, i1} @llvm.type.checked.load(i8* %vtablei8, i32 16, metadata !"typeid") %fptr = extractvalue {i8*, i1} %pair, 0 %fptr_casted = bitcast i8* %fptr to i32 (i8*)* - ; CHECK: [[VTGEP3:%[^ ]*]] = getelementptr i8, i8* [[VT3]], i64 -4 + ; CHECK: [[VTGEP3:%[^ ]*]] = getelementptr i8, i8* [[VT3]], i32 -4 ; CHECK: [[VTBC3:%[^ ]*]] = bitcast i8* [[VTGEP3]] to i32* ; CHECK: [[VTLOAD3:%[^ ]*]] = load i32, i32* [[VTBC3]] %result = call i32 %fptr_casted(i8* %obj) Index: llvm/trunk/test/Transforms/WholeProgramDevirt/virtual-const-prop-end.ll =================================================================== --- llvm/trunk/test/Transforms/WholeProgramDevirt/virtual-const-prop-end.ll +++ llvm/trunk/test/Transforms/WholeProgramDevirt/virtual-const-prop-end.ll @@ -73,7 +73,7 @@ %fptrptr = getelementptr [3 x i8*], [3 x i8*]* %vtable, i32 0, i32 0 %fptr = load i8*, i8** %fptrptr %fptr_casted = bitcast i8* %fptr to i1 (i8*)* - ; CHECK: [[VTGEP1:%[^ ]*]] = getelementptr i8, i8* [[VT1]], i64 28 + ; CHECK: [[VTGEP1:%[^ ]*]] = getelementptr i8, i8* [[VT1]], i32 28 ; CHECK: [[VTLOAD1:%[^ ]*]] = load i8, i8* [[VTGEP1]] ; CHECK: [[VTAND1:%[^ ]*]] = and i8 [[VTLOAD1]], 2 ; CHECK: [[VTCMP1:%[^ ]*]] = icmp ne i8 [[VTAND1]], 0 @@ -93,7 +93,7 @@ %fptrptr = getelementptr [3 x i8*], [3 x i8*]* %vtable, i32 0, i32 1 %fptr = load i8*, i8** %fptrptr %fptr_casted = bitcast i8* %fptr to i1 (i8*)* - ; CHECK: [[VTGEP2:%[^ ]*]] = getelementptr i8, i8* [[VT2]], i64 28 + ; CHECK: [[VTGEP2:%[^ ]*]] = getelementptr i8, i8* [[VT2]], i32 28 ; CHECK: [[VTLOAD2:%[^ ]*]] = load i8, i8* [[VTGEP2]] ; CHECK: [[VTAND2:%[^ ]*]] = and i8 [[VTLOAD2]], 1 ; CHECK: [[VTCMP2:%[^ ]*]] = icmp ne i8 [[VTAND2]], 0 @@ -113,7 +113,7 @@ %fptrptr = getelementptr [3 x i8*], [3 x i8*]* %vtable, i32 0, i32 2 %fptr = load i8*, i8** %fptrptr %fptr_casted = bitcast i8* %fptr to i32 (i8*)* - ; CHECK: [[VTGEP3:%[^ ]*]] = getelementptr i8, i8* [[VT3]], i64 24 + ; CHECK: [[VTGEP3:%[^ ]*]] = getelementptr i8, i8* [[VT3]], i32 24 ; CHECK: [[VTBC3:%[^ ]*]] = bitcast i8* [[VTGEP3]] to i32* ; CHECK: [[VTLOAD3:%[^ ]*]] = load i32, i32* [[VTBC3]] %result = call i32 %fptr_casted(i8* %obj)