[llvm] bda785a - [llvm][RelLookupTableConverter] Remove no-op ptr-to-ptr bitcast (NFC)
Youngsuk Kim via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 18 03:00:04 PST 2023
Author: Youngsuk Kim
Date: 2023-11-18T04:55:11-06:00
New Revision: bda785a3e2c02fc5006023b5f304edd3e3bb771a
URL: https://github.com/llvm/llvm-project/commit/bda785a3e2c02fc5006023b5f304edd3e3bb771a
DIFF: https://github.com/llvm/llvm-project/commit/bda785a3e2c02fc5006023b5f304edd3e3bb771a.diff
LOG: [llvm][RelLookupTableConverter] Remove no-op ptr-to-ptr bitcast (NFC)
Opaque ptr cleanup effort (NFC).
Added:
Modified:
llvm/lib/Transforms/Utils/RelLookupTableConverter.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Utils/RelLookupTableConverter.cpp b/llvm/lib/Transforms/Utils/RelLookupTableConverter.cpp
index c9ff94dc9744fa5..1666535b169600a 100644
--- a/llvm/lib/Transforms/Utils/RelLookupTableConverter.cpp
+++ b/llvm/lib/Transforms/Utils/RelLookupTableConverter.cpp
@@ -153,11 +153,10 @@ static void convertToRelLookupTable(GlobalVariable &LookupTable) {
Builder.SetInsertPoint(Load);
Function *LoadRelIntrinsic = llvm::Intrinsic::getDeclaration(
&M, Intrinsic::load_relative, {Index->getType()});
- Value *Base = Builder.CreateBitCast(RelLookupTable, Builder.getInt8PtrTy());
// Create a call to load.relative intrinsic that computes the target address
// by adding base address (lookup table address) and relative offset.
- Value *Result = Builder.CreateCall(LoadRelIntrinsic, {Base, Offset},
+ Value *Result = Builder.CreateCall(LoadRelIntrinsic, {RelLookupTable, Offset},
"reltable.intrinsic");
// Create a bitcast instruction if necessary.
More information about the llvm-commits
mailing list