Add specializations for walk to allow traversal of regions and blocks.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/include/mlir/IR/Visitors.h | ||
---|---|---|
68 | Shouldn't this be walkRegions or walkRegionsOfOperation? (This also feels like it may deserve a different comment as the operations one does invoke the callback on the operation, but with regions and blocks it can't) |
Address comment
mlir/include/mlir/IR/Visitors.h | ||
---|---|---|
68 | Different names for regions, blocks, and operations would mean to also split the template below into 3 variants. |
mlir/include/mlir/IR/Visitors.h | ||
---|---|---|
100 | Use llvm::is_one_of here. |
mlir/include/mlir/IR/Visitors.h | ||
---|---|---|
100 |
We are seeing a failure in the mlir build on Ubuntu with gcc/g++ since these two changes went in:
FAILED: tools/mlir/lib/Dialect/GPU/CMakeFiles/obj.MLIRGPU.dir/Transforms/AsyncRegionRewriter.cpp.o /usr/bin/c++ -DBUILD_EXAMPLES -DMLIR_CUDA_CONVERSIONS_ENABLED=0 -DMLIR_ROCM_CONVERSIONS_ENABLED=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools/mlir/lib/Dialect/GPU -I/vstsdrive/_work/20/s/llvm-project/mlir/lib/Dialect/GPU -Iinclude -I/vstsdrive/_work/20/s/llvm-project/llvm/include -I/vstsdrive/_work/20/s/llvm-project/mlir/include -Itools/mlir/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -fdiagnostics-color -g -fno-exceptions -std=c++14 -MD -MT tools/mlir/lib/Dialect/GPU/CMakeFiles/obj.MLIRGPU.dir/Transforms/AsyncRegionRewriter.cpp.o -MF tools/mlir/lib/Dialect/GPU/CMakeFiles/obj.MLIRGPU.dir/Transforms/AsyncRegionRewriter.cpp.o.d -o tools/mlir/lib/Dialect/GPU/CMakeFiles/obj.MLIRGPU.dir/Transforms/AsyncRegionRewriter.cpp.o -c /vstsdrive/_work/20/s/llvm-project/mlir/lib/Dialect/GPU/Transforms/AsyncRegionRewriter.cpp /vstsdrive/_work/20/s/llvm-project/mlir/lib/Dialect/GPU/Transforms/AsyncRegionRewriter.cpp: In member function ‘virtual void {anonymous}::GpuAsyncRegionPass::runOnFunction()’: /vstsdrive/_work/20/s/llvm-project/mlir/lib/Dialect/GPU/Transforms/AsyncRegionRewriter.cpp:113:16: internal compiler error: in replace_placeholders_r, at cp/tree.c:2804 if (getFunction() ~~~~~~~~~~~~~ .getRegion() ~~~~~~~~~~~~ .walk(Callback{OpBuilder(&getContext())}) ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
Unfortunately, I could not reproduce this failure,
I tried with gcc/g++ (Debian 10.2.0-9) 10.2.0.
Building with GCC7 is fixed by 5ece2115d85326e3b24336a7ccb4c191932ccb4a, but looks like this was reverted already.
Yes, I reverted it yesterday as it caused problems with the integrate. I will re-land this when I figure out how to install an old GCC version.
Sorry, what I was trying to say was that 5ece2115d85326e3b24336a7ccb4c191932ccb4a fixed the GCC7 crash. Your change seems mostly unrelated and should be safe to reland.
Shouldn't this be walkRegions or walkRegionsOfOperation? (This also feels like it may deserve a different comment as the operations one does invoke the callback on the operation, but with regions and blocks it can't)