[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 14:39:20 PDT 2024


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `premerge-monolithic-linux` running on `premerge-linux-1` while building `llvm` at step 6 "build-unified-tree".

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

Here is the relevant piece of the build log for the reference:
```
Step 6 (build-unified-tree) failure: build (failure)
...
68.720 [3258/58/337] Linking CXX static library lib/libLLVMInstrumentation.a
68.774 [3257/58/338] Building CXX object lib/Target/SystemZ/CMakeFiles/LLVMSystemZCodeGen.dir/SystemZTargetMachine.cpp.o
68.863 [3256/58/339] Building CXX object lib/Target/WebAssembly/CMakeFiles/LLVMWebAssemblyCodeGen.dir/WebAssemblyTargetTransformInfo.cpp.o
68.893 [3255/58/340] Linking CXX static library lib/libLLVMInstCombine.a
68.962 [3254/58/341] Linking CXX executable bin/llvm-ar
68.984 [3253/58/342] Generating ../../bin/llvm-ranlib
69.011 [3252/58/343] Building CXX object lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86LowerAMXIntrinsics.cpp.o
69.019 [3251/58/344] Generating ../../bin/llvm-lib
69.031 [3250/58/345] Generating ../../bin/llvm-dlltool
69.051 [3249/58/346] 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 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /usr/bin/clang++ -DBUILD_EXAMPLES -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/build/buildbot/premerge-monolithic-linux/build/tools/mlir/lib/Analysis -I/build/buildbot/premerge-monolithic-linux/llvm-project/mlir/lib/Analysis -I/build/buildbot/premerge-monolithic-linux/build/include -I/build/buildbot/premerge-monolithic-linux/llvm-project/llvm/include -I/build/buildbot/premerge-monolithic-linux/llvm-project/mlir/include -I/build/buildbot/premerge-monolithic-linux/build/tools/mlir/include -gmlt -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 /build/buildbot/premerge-monolithic-linux/llvm-project/mlir/lib/Analysis/Liveness.cpp
In file included from /build/buildbot/premerge-monolithic-linux/llvm-project/mlir/lib/Analysis/Liveness.cpp:19:
/build/buildbot/premerge-monolithic-linux/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'
          S1.erase(SI);
                   ^~
/build/buildbot/premerge-monolithic-linux/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
    llvm::set_subtract(useValues, defValues);
          ^
/build/buildbot/premerge-monolithic-linux/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
class Value {
      ^
/build/buildbot/premerge-monolithic-linux/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
/build/buildbot/premerge-monolithic-linux/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
  constexpr Value(detail::ValueImpl *impl = nullptr) : impl(impl) {}
            ^
/build/buildbot/premerge-monolithic-linux/llvm-project/llvm/include/llvm/ADT/SmallPtrSet.h:361:22: note: passing argument to parameter 'Ptr' here
  bool erase(PtrType Ptr) {
                     ^
1 error generated.
69.443 [3249/57/347] Building CXX object lib/Target/WebAssembly/CMakeFiles/LLVMWebAssemblyCodeGen.dir/WebAssemblyCFGStackify.cpp.o
69.501 [3249/56/348] Linking CXX static library lib/libLLVMScalarOpts.a
69.503 [3249/55/349] Building CXX object tools/mlir/test/lib/Analysis/CMakeFiles/MLIRTestAnalysis.dir/TestCFGLoopInfo.cpp.o
69.605 [3249/54/350] Building CXX object lib/Target/PowerPC/CMakeFiles/LLVMPowerPCCodeGen.dir/PPCTargetMachine.cpp.o
69.859 [3249/53/351] Building CXX object lib/Target/VE/CMakeFiles/LLVMVECodeGen.dir/VETargetMachine.cpp.o
70.068 [3249/52/352] Building CXX object lib/Target/RISCV/CMakeFiles/LLVMRISCVCodeGen.dir/RISCVTargetTransformInfo.cpp.o
70.139 [3249/51/353] Building CXX object lib/Target/PowerPC/CMakeFiles/LLVMPowerPCCodeGen.dir/PPCTargetTransformInfo.cpp.o
70.194 [3249/50/354] Building CXX object lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86OptimizeLEAs.cpp.o
70.247 [3249/49/355] Building CXX object lib/Target/AMDGPU/CMakeFiles/LLVMAMDGPUCodeGen.dir/SIISelLowering.cpp.o
70.258 [3249/48/356] Building CXX object lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86PreTileConfig.cpp.o
70.734 [3249/47/357] Building CXX object tools/mlir/lib/Analysis/CMakeFiles/obj.MLIRAnalysis.dir/CFGLoopInfo.cpp.o
70.774 [3249/46/358] 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 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /usr/bin/clang++ -DBUILD_EXAMPLES -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/build/buildbot/premerge-monolithic-linux/build/tools/mlir/lib/Dialect/Bufferization/Transforms -I/build/buildbot/premerge-monolithic-linux/llvm-project/mlir/lib/Dialect/Bufferization/Transforms -I/build/buildbot/premerge-monolithic-linux/build/include -I/build/buildbot/premerge-monolithic-linux/llvm-project/llvm/include -I/build/buildbot/premerge-monolithic-linux/llvm-project/mlir/include -I/build/buildbot/premerge-monolithic-linux/build/tools/mlir/include -gmlt -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 /build/buildbot/premerge-monolithic-linux/llvm-project/mlir/lib/Dialect/Bufferization/Transforms/BufferViewFlowAnalysis.cpp
In file included from /build/buildbot/premerge-monolithic-linux/llvm-project/mlir/lib/Dialect/Bufferization/Transforms/BufferViewFlowAnalysis.cpp:16:
/build/buildbot/premerge-monolithic-linux/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'
          S1.erase(SI);
                   ^~
/build/buildbot/premerge-monolithic-linux/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, llvm::DenseMapInfo<mlir::Value>>, 0>>' requested here

```

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


More information about the llvm-commits mailing list