Skip to content

Commit 2cbfba2

Browse files
JOE1994sr-tream
authored andcommitted
[llvm][RelLookupTableConverter] Remove no-op ptr-to-ptr bitcast (NFC)
Opaque ptr cleanup effort (NFC).
1 parent 4487d0f commit 2cbfba2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llvm/lib/Transforms/Utils/RelLookupTableConverter.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,10 @@ static void convertToRelLookupTable(GlobalVariable &LookupTable) {
153153
Builder.SetInsertPoint(Load);
154154
Function *LoadRelIntrinsic = llvm::Intrinsic::getDeclaration(
155155
&M, Intrinsic::load_relative, {Index->getType()});
156-
Value *Base = Builder.CreateBitCast(RelLookupTable, Builder.getInt8PtrTy());
157156

158157
// Create a call to load.relative intrinsic that computes the target address
159158
// by adding base address (lookup table address) and relative offset.
160-
Value *Result = Builder.CreateCall(LoadRelIntrinsic, {Base, Offset},
159+
Value *Result = Builder.CreateCall(LoadRelIntrinsic, {RelLookupTable, Offset},
161160
"reltable.intrinsic");
162161

163162
// Create a bitcast instruction if necessary.

0 commit comments

Comments
 (0)