define canonicalizer and folder for tosa::select
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Dialect/Tosa/IR/TosaOps.cpp | ||
---|---|---|
624 | What is the issue with clang-format here? It is fairly rare that we have to disable clang-format, and in general it is always about some large struct initializers or things similar. | |
653 | Nit: remove trivial braces, here and elsewhere. | |
661 | Shouldn't this be part of a verifier? |
mlir/lib/Dialect/Tosa/IR/TosaOps.cpp | ||
---|---|---|
624 | There is an indenter on line 593 on the left of difference. I don't know why. I feel the format is strange. |
mlir/test/Dialect/Tosa/canonicalize.mlir | ||
---|---|---|
256 | smae -> same |
Thanks,Can you help me commit this? user.name: lipracer user.email: lipracer@gmail.com
Hi @lipracer, this change has caused a build error when building with clang:
/usr/bin/clang++ -DGTEST_HAS_RTTI=0 -DMLIR_CUDA_CONVERSIONS_ENABLED=0 -DMLIR_ROCM_CONVERSIONS_ENABLED=0 -D_DEBUG -D_GNU_SOURCE -DSTDC_CONSTANT_MACROS -DSTDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/mnt/vss/_work/1/b/llvm/Release/tools/mlir/lib/Dialect/Tosa -I/mnt/vss/_work/1/llvm-project/mlir/lib/Dialect/Tosa -I/mnt/vss/_work/1/b/llvm/Release/include -I/mnt/vss/_work/1/llvm-project/llvm/include -I/mnt/vss/_work/1/llvm-project/mlir/include -I/mnt/vss/_work/1/b/llvm/Release/tools/mlir/include -fPIC -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Werror=mismatched-tags -Werror=global-constructors -O3 -DNDEBUG -fno-exceptions -fno-rtti -UNDEBUG -std=c++14 -MD -MT tools/mlir/lib/Dialect/Tosa/CMakeFiles/obj.MLIRTosa.dir/IR/TosaOps.cpp.o -MF tools/mlir/lib/Dialect/Tosa/CMakeFiles/obj.MLIRTosa.dir/IR/TosaOps.cpp.o.d -o tools/mlir/lib/Dialect/Tosa/CMakeFiles/obj.MLIRTosa.dir/IR/TosaOps.cpp.o -c /mnt/vss/_work/1/llvm-project/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
/mnt/vss/_work/1/llvm-project/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp:599:26: error: extra ';' outside of a function is incompatible with C++98 [-Werror,-Wc++98-compat-extra-semi]
ReduceFolder(ReduceAllOp);
I have fixed https://reviews.llvm.org/D122599, Could you please review it, It's very strange why we get normal clang-format results when we change the macro definition to uppercase.
This change is resulting in these warnings:
/usr/local/google/home/morbo/llvm/llvm-project/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp:599:26: warning: extra ';' outside of a function is incompatible with C++98 [-Wc++98-compat-extra-semi] ReduceFolder(ReduceAllOp); ^ /usr/local/google/home/morbo/llvm/llvm-project/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp:600:26: warning: extra ';' outside of a function is incompatible with C++98 [-Wc++98-compat-extra-semi] ReduceFolder(ReduceAnyOp); ^ /usr/local/google/home/morbo/llvm/llvm-project/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp:601:26: warning: extra ';' outside of a function is incompatible with C++98 [-Wc++98-compat-extra-semi] ReduceFolder(ReduceMaxOp); ^ /usr/local/google/home/morbo/llvm/llvm-project/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp:602:26: warning: extra ';' outside of a function is incompatible with C++98 [-Wc++98-compat-extra-semi] ReduceFolder(ReduceMinOp); ^ /usr/local/google/home/morbo/llvm/llvm-project/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp:603:27: warning: extra ';' outside of a function is incompatible with C++98 [-Wc++98-compat-extra-semi] ReduceFolder(ReduceProdOp); ^ /usr/local/google/home/morbo/llvm/llvm-project/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp:604:26: warning: extra ';' outside of a function is incompatible with C++98 [-Wc++98-compat-extra-semi] ReduceFolder(ReduceSumOp); ^ 6 warnings generated.
I think this is what was mention right above? Can you check if the follow-up revision linked above fixed it for you as well?
how about using hasCanonicalizeMethod?