Skip to content

Commit 358604d

Browse files
committed
Fix for changes to LLVM::GEPOp
llvm/llvm-project#137272 plumbs through nusw and nuw by removing `inbounds` and replaces it with a enum. Signed-off-by: Ian Wood <[email protected]>
1 parent 571967f commit 358604d

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

compiler/src/iree/compiler/Codegen/LLVMCPU/ConvertToLLVM.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,9 +349,9 @@ acquireInstrumentationEntry(Location loc, Value buffer, Value bufferPtr,
349349
Value offsetIndex =
350350
builder.create<LLVM::ConstantOp>(loc, i64Type, headOffset);
351351
auto i8Type = builder.getI8Type();
352-
Value offsetPtr = builder.create<LLVM::GEPOp>(loc, basePtr.getType(), i8Type,
353-
basePtr, offsetIndex,
354-
/*inbounds=*/true);
352+
Value offsetPtr = builder.create<LLVM::GEPOp>(
353+
loc, basePtr.getType(), i8Type, basePtr, offsetIndex,
354+
/*noWrapFlags =*/LLVM::GEPNoWrapFlags::inbounds);
355355
Value rawOffset = builder.create<LLVM::AtomicRMWOp>(
356356
loc, LLVM::AtomicBinOp::add, offsetPtr, entrySize,
357357
LLVM::AtomicOrdering::monotonic);

compiler/src/iree/compiler/Codegen/LLVMCPU/DispatchABI.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -952,11 +952,12 @@ Value HALDispatchABI::updateProcessorDataFromTargetAttr(
952952
for (int64_t i = 1, e = ProcessorDataCapacity; i < e; ++i) {
953953
Value loadPtr = builder.create<LLVM::GEPOp>(
954954
loc, processorDataPtrValue.getType(), i64Ty, processorDataPtrValue,
955-
LLVM::GEPArg(int32_t(i)), /*inbounds =*/true);
955+
LLVM::GEPArg(int32_t(i)),
956+
/*noWrapFlags =*/LLVM::GEPNoWrapFlags::inbounds);
956957
Value loadVal = builder.create<LLVM::LoadOp>(loc, i64Ty, loadPtr);
957958
Value storePtr = builder.create<LLVM::GEPOp>(
958959
loc, alloca.getType(), i64Ty, alloca, LLVM::GEPArg(int32_t(i)),
959-
/*inbounds =*/true);
960+
/*noWrapFlags =*/LLVM::GEPNoWrapFlags::inbounds);
960961
builder.create<LLVM::StoreOp>(loc, loadVal, storePtr);
961962
}
962963
return alloca;
@@ -978,12 +979,12 @@ Value HALDispatchABI::loadProcessorData(Operation *forOp, OpBuilder &builder) {
978979
loc, LLVM::LLVMPointerType::get(context),
979980
LLVM::LLVMPointerType::get(context), environmentPtrValue,
980981
LLVM::GEPArg(int32_t(EnvironmentField::processor)),
981-
/*inbounds=*/true);
982+
/*noWrapFlags =*/LLVM::GEPNoWrapFlags::inbounds);
982983
Value processorDataPtrValue = builder.create<LLVM::GEPOp>(
983984
loc, LLVM::LLVMPointerType::get(context),
984985
LLVM::LLVMPointerType::get(context), processorPtrValue,
985986
LLVM::GEPArg(int32_t(ProcessorField::data)),
986-
/*inbounds=*/true);
987+
/*noWrapFlags =*/LLVM::GEPNoWrapFlags::inbounds);
987988
Value updatedProcessorData =
988989
updateProcessorDataFromTargetAttr(forOp, processorDataPtrValue, builder);
989990
return buildValueDI(forOp, updatedProcessorData, "processor_data",

third_party/llvm-project

0 commit comments

Comments
 (0)