diff options
author | Peiyong Lin <linpyong@gmail.com> | 2025-04-29 22:49:19 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-30 07:49:19 +0200 |
commit | 96eeb6c1a93ab295d9baa4baad2efe1c2b51ffc0 (patch) | |
tree | d1ba8c41a5f2f7cdbc5581ad07122b75763b5acc /mlir/lib/Target/LLVMIR/ModuleImport.cpp | |
parent | 857ac4c229d209ebf3990c4760e2fc546beeac9c (diff) | |
download | llvm-96eeb6c1a93ab295d9baa4baad2efe1c2b51ffc0.zip llvm-96eeb6c1a93ab295d9baa4baad2efe1c2b51ffc0.tar.gz llvm-96eeb6c1a93ab295d9baa4baad2efe1c2b51ffc0.tar.bz2 |
[mlir][llvm] Support nusw and nuw in GEP (#137272)
nusw and nuw were introduced in getelementptr, this patch plumbs them in
MLIR.
Since inbounds implies nusw, this patch also adds an inboundsFlag to
represent the concept of raw inbounds with no nusw implication, and have
the inbounds literal captured as the combination of inboundsFlag and
nusw.
Fixes: iree#20482
Signed-off-by: Lin, Peiyong <linpyong@gmail.com>
Diffstat (limited to 'mlir/lib/Target/LLVMIR/ModuleImport.cpp')
-rw-r--r-- | mlir/lib/Target/LLVMIR/ModuleImport.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mlir/lib/Target/LLVMIR/ModuleImport.cpp b/mlir/lib/Target/LLVMIR/ModuleImport.cpp index 0a3371c..7f2c0ca1 100644 --- a/mlir/lib/Target/LLVMIR/ModuleImport.cpp +++ b/mlir/lib/Target/LLVMIR/ModuleImport.cpp @@ -2035,8 +2035,9 @@ LogicalResult ModuleImport::convertInstruction(llvm::Instruction *inst) { } Type type = convertType(inst->getType()); - auto gepOp = builder.create<GEPOp>(loc, type, sourceElementType, *basePtr, - indices, gepInst->isInBounds()); + auto gepOp = builder.create<GEPOp>( + loc, type, sourceElementType, *basePtr, indices, + static_cast<GEPNoWrapFlags>(gepInst->getNoWrapFlags().getRaw())); mapValue(inst, gepOp); return success(); } |