Skip to content

Commit 21133f1

Browse files
committed
[TOSA] Fix -Wdangling-gsl and -Wunused-variable in TosaToLinalg.cpp (NFC)
llvm-project/mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp:2376:9: error: object backing the pointer will be destroyed at the end of the full-expression [-Werror,-Wdangling-gsl] tensor::getMixedSizes(rewriter, loc, input_real); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ llvm-project/mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp:2366:10: error: unused variable 'imag_el_ty' [-Werror,-Wunused-variable] auto imag_el_ty = cast<FloatType>( ^ 2 errors generated.
1 parent d1ecd12 commit 21133f1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2363,7 +2363,7 @@ struct FFT2dConverter final : OpRewritePattern<FFT2dOp> {
23632363

23642364
auto real_el_ty = cast<FloatType>(
23652365
cast<ShapedType>(input_real.getType()).getElementType());
2366-
auto imag_el_ty = cast<FloatType>(
2366+
[[maybe_unused]] auto imag_el_ty = cast<FloatType>(
23672367
cast<ShapedType>(input_imag.getType()).getElementType());
23682368

23692369
assert(real_el_ty == imag_el_ty);
@@ -2372,8 +2372,7 @@ struct FFT2dConverter final : OpRewritePattern<FFT2dOp> {
23722372
SmallVector<Value> dynamicSizes;
23732373

23742374
// Get [N, H, W]
2375-
ArrayRef<OpFoldResult> dims =
2376-
tensor::getMixedSizes(rewriter, loc, input_real);
2375+
auto dims = tensor::getMixedSizes(rewriter, loc, input_real);
23772376

23782377
SmallVector<int64_t, 3> staticSizes;
23792378
dispatchIndexOpFoldResults(dims, dynamicSizes, staticSizes);

0 commit comments

Comments
 (0)