[Mlir-commits] [mlir] mlir: fix builders by moving var into assert (PR #209494)
George Burgess IV
llvmlistbot at llvm.org
Tue Jul 14 07:07:52 PDT 2026
https://github.com/gburgessiv created https://github.com/llvm/llvm-project/pull/209494
non-asserts builders are failing since `vecTy` is unused aside from this one assertion: https://lab.llvm.org/buildbot/#/builders/228/builds/4754
Since side-effects here are uninteresting, move the entire expr into the assert, per CodingStandards.md
Fix-forward for #199700
>From 300b04bf455db87ccbbabbfd8fc52efa912c53b1 Mon Sep 17 00:00:00 2001
From: George Burgess IV <gbiv at google.com>
Date: Tue, 14 Jul 2026 07:56:20 -0600
Subject: [PATCH] mlir: fix builders by moving var into assert
non-asserts builders are failing since `vecTy` is unused aside from this
one assertion: https://lab.llvm.org/buildbot/#/builders/228/builds/4754
Since side-effects here are uninteresting, move the entire expr into the
assert, per CodingStandards.md
Fix-forward for #199700
---
mlir/lib/Conversion/NVGPUToNVVM/NVGPUToNVVM.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mlir/lib/Conversion/NVGPUToNVVM/NVGPUToNVVM.cpp b/mlir/lib/Conversion/NVGPUToNVVM/NVGPUToNVVM.cpp
index 948229bb53328..e97546f43c159 100644
--- a/mlir/lib/Conversion/NVGPUToNVVM/NVGPUToNVVM.cpp
+++ b/mlir/lib/Conversion/NVGPUToNVVM/NVGPUToNVVM.cpp
@@ -1807,8 +1807,8 @@ lookupConvOp(const TableEntry (&table)[N], Type srcElemType, Type dstElemType) {
/// Extract a single element from a vector.
static Value extractElement(ImplicitLocOpBuilder &b, Value srcVec, int idx) {
- auto vecTy = cast<VectorType>(srcVec.getType());
- assert(idx >= 0 && idx < vecTy.getNumElements() &&
+ assert(idx >= 0 &&
+ idx < cast<VectorType>(srcVec.getType()).getNumElements() &&
"extractElement: index out of bounds");
IntegerType i64Ty = b.getI64Type();
return b.create<LLVM::ExtractElementOp>(
More information about the Mlir-commits
mailing list