[llvm] 0485211 - [IRBuilder] Remove redundant createGEP() overloads (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Fri May 13 03:43:28 PDT 2022
Author: Nikita Popov
Date: 2022-05-13T12:43:21+02:00
New Revision: 0485211dd0edca4d0f000ff7d053fe20dbd7531e
URL: https://github.com/llvm/llvm-project/commit/0485211dd0edca4d0f000ff7d053fe20dbd7531e
DIFF: https://github.com/llvm/llvm-project/commit/0485211dd0edca4d0f000ff7d053fe20dbd7531e.diff
LOG: [IRBuilder] Remove redundant createGEP() overloads (NFC)
ArrayRef<Value *> also accepts a single Value *, there's no need
to create separate overloads for this.
Added:
Modified:
llvm/include/llvm/IR/IRBuilder.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/IR/IRBuilder.h b/llvm/include/llvm/IR/IRBuilder.h
index adb0d72b0d57..e97cbf8aae82 100644
--- a/llvm/include/llvm/IR/IRBuilder.h
+++ b/llvm/include/llvm/IR/IRBuilder.h
@@ -1736,19 +1736,6 @@ class IRBuilderBase {
return Insert(GetElementPtrInst::CreateInBounds(Ty, Ptr, IdxList), Name);
}
- Value *CreateGEP(Type *Ty, Value *Ptr, Value *Idx, const Twine &Name = "") {
- if (auto *V = Folder.FoldGEP(Ty, Ptr, {Idx}, /*IsInBounds=*/false))
- return V;
- return Insert(GetElementPtrInst::Create(Ty, Ptr, Idx), Name);
- }
-
- Value *CreateInBoundsGEP(Type *Ty, Value *Ptr, Value *Idx,
- const Twine &Name = "") {
- if (auto *V = Folder.FoldGEP(Ty, Ptr, {Idx}, /*IsInBounds=*/true))
- return V;
- return Insert(GetElementPtrInst::CreateInBounds(Ty, Ptr, Idx), Name);
- }
-
Value *CreateConstGEP1_32(Type *Ty, Value *Ptr, unsigned Idx0,
const Twine &Name = "") {
Value *Idx = ConstantInt::get(Type::getInt32Ty(Context), Idx0);
More information about the llvm-commits
mailing list