[Mlir-commits] [mlir] b6bf775 - [mlir][nvvm] fix potential bug (NFC)

Guray Ozen llvmlistbot at llvm.org
Wed Jul 12 01:09:26 PDT 2023


Author: Guray Ozen
Date: 2023-07-12T10:09:21+02:00
New Revision: b6bf775f58abf6660c2f5064f020c40fa5b53d24

URL: https://github.com/llvm/llvm-project/commit/b6bf775f58abf6660c2f5064f020c40fa5b53d24
DIFF: https://github.com/llvm/llvm-project/commit/b6bf775f58abf6660c2f5064f020c40fa5b53d24.diff

LOG: [mlir][nvvm] fix potential bug (NFC)

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D155048

Added: 
    

Modified: 
    mlir/lib/Conversion/NVVMToLLVM/NVVMToLLVM.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Conversion/NVVMToLLVM/NVVMToLLVM.cpp b/mlir/lib/Conversion/NVVMToLLVM/NVVMToLLVM.cpp
index 4564e325b0d456..62d04e85f83a16 100644
--- a/mlir/lib/Conversion/NVVMToLLVM/NVVMToLLVM.cpp
+++ b/mlir/lib/Conversion/NVVMToLLVM/NVVMToLLVM.cpp
@@ -112,7 +112,8 @@ class PtxBuilder {
                                 : LLVM::LLVMVoidType::get(op->getContext());
 
     // Remove the last comma from the constraints string.
-    if (asmConstraints[asmConstraints.size() - 1] == ',')
+    if (!asmConstraints.empty() &&
+        asmConstraints[asmConstraints.size() - 1] == ',')
       asmConstraints.pop_back();
 
     return rewriter.create<LLVM::InlineAsmOp>(


        


More information about the Mlir-commits mailing list