From 0dfd2bf4dfd3fc8c0733678186ceb37776597d35 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 29 May 2024 15:36:08 +0200 Subject: [PATCH] [LTT] Directly create inbounds gep (NFCI) We know that this gep is inbounds. Constant expression construction already infers this fact, but make it explicit. --- llvm/lib/Transforms/IPO/LowerTypeTests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Transforms/IPO/LowerTypeTests.cpp b/llvm/lib/Transforms/IPO/LowerTypeTests.cpp index 633fcb3314c4..f86f217bca58 100644 --- a/llvm/lib/Transforms/IPO/LowerTypeTests.cpp +++ b/llvm/lib/Transforms/IPO/LowerTypeTests.cpp @@ -879,7 +879,7 @@ void LowerTypeTestsModule::buildBitSetsFromGlobalVariables( // Multiply by 2 to account for padding elements. Constant *CombinedGlobalIdxs[] = {ConstantInt::get(Int32Ty, 0), ConstantInt::get(Int32Ty, I * 2)}; - Constant *CombinedGlobalElemPtr = ConstantExpr::getGetElementPtr( + Constant *CombinedGlobalElemPtr = ConstantExpr::getInBoundsGetElementPtr( NewInit->getType(), CombinedGlobal, CombinedGlobalIdxs); assert(GV->getType()->getAddressSpace() == 0); GlobalAlias *GAlias =