[llvm] [ADT] Make set_subtract more efficient when subtrahend is larger (NFC) (PR #98702)

LLVM Continuous Integration via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 17 13:59:29 PDT 2024


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `flang-aarch64-out-of-tree` running on `linaro-flang-aarch64-out-of-tree` while building `llvm` at step 5 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/53/builds/1591

Here is the relevant piece of the build log for the reference:
```
Step 5 (build-unified-tree) failure: build (failure)
...
93.952 [180/15/219] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Version.cpp.o
94.181 [180/14/220] Building CXX object lib/Target/AArch64/CMakeFiles/LLVMAArch64CodeGen.dir/AArch64TargetTransformInfo.cpp.o
94.564 [177/16/221] Linking CXX static library lib/libLLVMInstCombine.a
94.680 [177/15/222] Linking CXX static library lib/libLLVMInstrumentation.a
100.320 [177/14/223] Building CXX object tools/llvm-objdump/CMakeFiles/llvm-objdump.dir/llvm-objdump.cpp.o
100.529 [171/19/224] Linking CXX static library lib/libLLVMScalarOpts.a
100.654 [166/23/225] Building CXX object tools/mlir/lib/Dialect/Linalg/IR/CMakeFiles/obj.MLIRLinalgDialect.dir/LinalgOps.cpp.o
100.660 [165/23/226] Linking CXX static library lib/libLLVMFrontendOpenMP.a
100.701 [162/25/227] Linking CXX static library lib/libLLVMCodeGen.a
101.005 [162/24/228] Building CXX object tools/mlir/lib/Analysis/CMakeFiles/obj.MLIRAnalysis.dir/Liveness.cpp.o
FAILED: tools/mlir/lib/Analysis/CMakeFiles/obj.MLIRAnalysis.dir/Liveness.cpp.o 
/usr/local/bin/c++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/tcwg-buildbot/worker/flang-aarch64-out-of-tree/build_llvm/tools/mlir/lib/Analysis -I/home/tcwg-buildbot/worker/flang-aarch64-out-of-tree/llvm-project/mlir/lib/Analysis -I/home/tcwg-buildbot/worker/flang-aarch64-out-of-tree/build_llvm/include -I/home/tcwg-buildbot/worker/flang-aarch64-out-of-tree/llvm-project/llvm/include -I/home/tcwg-buildbot/worker/flang-aarch64-out-of-tree/llvm-project/mlir/include -I/home/tcwg-buildbot/worker/flang-aarch64-out-of-tree/build_llvm/tools/mlir/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -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 -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wundef -Werror=mismatched-tags -Werror=global-constructors -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/mlir/lib/Analysis/CMakeFiles/obj.MLIRAnalysis.dir/Liveness.cpp.o -MF tools/mlir/lib/Analysis/CMakeFiles/obj.MLIRAnalysis.dir/Liveness.cpp.o.d -o tools/mlir/lib/Analysis/CMakeFiles/obj.MLIRAnalysis.dir/Liveness.cpp.o -c /home/tcwg-buildbot/worker/flang-aarch64-out-of-tree/llvm-project/mlir/lib/Analysis/Liveness.cpp
In file included from ../llvm-project/mlir/lib/Analysis/Liveness.cpp:19:
../llvm-project/llvm/include/llvm/ADT/SetOperations.h:109:20: error: no viable conversion from 'typename SmallPtrSet<Value, 16>::iterator' (aka 'SmallPtrSetIterator<mlir::Value>') to 'mlir::Value'
  109 |           S1.erase(SI);
      |                    ^~
../llvm-project/mlir/lib/Analysis/Liveness.cpp:80:11: note: in instantiation of function template specialization 'llvm::set_subtract<llvm::SmallPtrSet<mlir::Value, 16>, llvm::SmallPtrSet<mlir::Value, 16>>' requested here
   80 |     llvm::set_subtract(useValues, defValues);
      |           ^
../llvm-project/mlir/include/mlir/IR/Value.h:96:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'typename SmallPtrSet<Value, 16>::iterator' (aka 'SmallPtrSetIterator<mlir::Value>') to 'const Value &' for 1st argument
   96 | class Value {
      |       ^~~~~
../llvm-project/mlir/include/mlir/IR/Value.h:96:7: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'typename SmallPtrSet<Value, 16>::iterator' (aka 'SmallPtrSetIterator<mlir::Value>') to 'Value &&' for 1st argument
   96 | class Value {
      |       ^~~~~
../llvm-project/mlir/include/mlir/IR/Value.h:98:13: note: candidate constructor not viable: no known conversion from 'typename SmallPtrSet<Value, 16>::iterator' (aka 'SmallPtrSetIterator<mlir::Value>') to 'detail::ValueImpl *' for 1st argument
   98 |   constexpr Value(detail::ValueImpl *impl = nullptr) : impl(impl) {}
      |             ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../llvm-project/llvm/include/llvm/ADT/SmallPtrSet.h:361:22: note: passing argument to parameter 'Ptr' here
  361 |   bool erase(PtrType Ptr) {
      |                      ^
1 error generated.
102.100 [162/23/229] Building CXX object lib/Passes/CMakeFiles/LLVMPasses.dir/PassBuilderPipelines.cpp.o
103.433 [162/22/230] Building CXX object examples/IRTransforms/CMakeFiles/ExampleIRTransforms.dir/SimplifyCFG.cpp.o
104.188 [162/21/231] Building CXX object tools/mlir/lib/ExecutionEngine/CMakeFiles/obj.MLIRExecutionEngineUtils.dir/OptUtils.cpp.o
108.356 [162/20/232] Building CXX object tools/mlir/lib/Analysis/CMakeFiles/obj.MLIRAnalysis.dir/CFGLoopInfo.cpp.o
109.440 [162/19/233] Building CXX object tools/mlir/test/lib/Analysis/CMakeFiles/MLIRTestAnalysis.dir/TestCFGLoopInfo.cpp.o
111.077 [162/18/234] Building CXX object tools/mlir/lib/Dialect/Bufferization/Transforms/CMakeFiles/obj.MLIRBufferizationTransforms.dir/BufferViewFlowAnalysis.cpp.o
FAILED: tools/mlir/lib/Dialect/Bufferization/Transforms/CMakeFiles/obj.MLIRBufferizationTransforms.dir/BufferViewFlowAnalysis.cpp.o 
/usr/local/bin/c++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/tcwg-buildbot/worker/flang-aarch64-out-of-tree/build_llvm/tools/mlir/lib/Dialect/Bufferization/Transforms -I/home/tcwg-buildbot/worker/flang-aarch64-out-of-tree/llvm-project/mlir/lib/Dialect/Bufferization/Transforms -I/home/tcwg-buildbot/worker/flang-aarch64-out-of-tree/build_llvm/include -I/home/tcwg-buildbot/worker/flang-aarch64-out-of-tree/llvm-project/llvm/include -I/home/tcwg-buildbot/worker/flang-aarch64-out-of-tree/llvm-project/mlir/include -I/home/tcwg-buildbot/worker/flang-aarch64-out-of-tree/build_llvm/tools/mlir/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -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 -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wundef -Werror=mismatched-tags -Werror=global-constructors -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/mlir/lib/Dialect/Bufferization/Transforms/CMakeFiles/obj.MLIRBufferizationTransforms.dir/BufferViewFlowAnalysis.cpp.o -MF tools/mlir/lib/Dialect/Bufferization/Transforms/CMakeFiles/obj.MLIRBufferizationTransforms.dir/BufferViewFlowAnalysis.cpp.o.d -o tools/mlir/lib/Dialect/Bufferization/Transforms/CMakeFiles/obj.MLIRBufferizationTransforms.dir/BufferViewFlowAnalysis.cpp.o -c /home/tcwg-buildbot/worker/flang-aarch64-out-of-tree/llvm-project/mlir/lib/Dialect/Bufferization/Transforms/BufferViewFlowAnalysis.cpp
In file included from ../llvm-project/mlir/lib/Dialect/Bufferization/Transforms/BufferViewFlowAnalysis.cpp:16:
../llvm-project/llvm/include/llvm/ADT/SetOperations.h:109:20: error: no viable conversion from 'typename SmallPtrSet<Value, 16>::iterator' (aka 'SmallPtrSetIterator<mlir::Value>') to 'mlir::Value'
  109 |           S1.erase(SI);
      |                    ^~
../llvm-project/mlir/lib/Dialect/Bufferization/Transforms/BufferViewFlowAnalysis.cpp:63:11: note: in instantiation of function template specialization 'llvm::set_subtract<llvm::SmallPtrSet<mlir::Value, 16>, llvm::SetVector<mlir::Value, llvm::SmallVector<mlir::Value, 0>, llvm::DenseSet<mlir::Value>, 0>>' requested here
   63 |     llvm::set_subtract(entry.second, aliasValues);
      |           ^
../llvm-project/mlir/include/mlir/IR/Value.h:96:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'typename SmallPtrSet<Value, 16>::iterator' (aka 'SmallPtrSetIterator<mlir::Value>') to 'const Value &' for 1st argument
   96 | class Value {

```

https://github.com/llvm/llvm-project/pull/98702


More information about the llvm-commits mailing list