The refactored template can now be used with MachineVerifier.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
- rebase
- replaced std::function with function_ref
- removed the everything capture
- renamed CheckFailed() to reportFailure() ... more aligned with the coding standard
llvm/include/llvm/ADT/GenericConvergenceVerifier.h | ||
---|---|---|
35 | See the function reportFailure() where the failure context is passed as an ArrayRef<Printable>. Both verifiers use different variadic function templates that do the same thing: print the message, change the verifier state and then print a variable number of context arguments. This lambda is a call-back to do the first two things. reportFailure() calls this lambda and then prints the context objects passed to it. |
llvm/test/Verifier/convergencectrl-invalid.ll | ||
---|---|---|
3 ↗ | (On Diff #545100) | These extra tests were separately committed to the main branch in |
this broke my build with:
ld.lld-12: error: undefined symbol: llvm::GenericCycle<llvm::GenericSSAContext<llvm::Function> >::contains(llvm::BasicBlock const*) const >>> referenced by UniformityAnalysis.cpp:72 (/home/culrho01/llvm-project/llvm/lib/Analysis/UniformityAnalysis.cpp:72) >>> lib/Analysis/CMakeFiles/LLVMAnalysis.dir/UniformityAnalysis.cpp.o:(llvm::GenericUniformityAnalysisImpl<llvm::GenericSSAContext<llvm::Function> >::usesValueFromCycle(llvm::Instruction const&, llvm::GenericCycle<llvm::GenericSSAContext<llvm::Function> > const&) const)
please could you look into it?
It's not obvious to me how this change could affect affect functions defined in GenericCycle. Can you please provide the commit hash that you are building, and the build parameters? I will need to reproduced this locally to make any progress.
I build with -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Debug, I tried static libs (-DBUILD_SHARED_LIBS=OFF) and that works so I think you'll be able to reproduce with shared libs.
Reopened this because of build errors with shared libraries enabled.
The "extern template" declaration of CycleInfo caused problems in a shared build when CycleInfo was removed from Verifier.cpp. There needs to be an explicit instantiation corresponding to an extern template in every SO.
llvm/include/llvm/ADT/GenericConvergenceVerifierImpl.h | ||
---|---|---|
34 | This commit also breaks clang module. You cannot add a dependency from ADT -> IR. This will cause a cyclic dependency in modules between LLVM_Utils <-> LLVM_IR. |
- rebase
- fix build failures:
- Shared libraries build failed with undefined references due to "extern template" declarations.
- Modules build failed due to a cycle dependence between llvm/ADT and llvm/IR. The Generic*Impl.h files should be in llvm/IR to prevent this.
llvm/include/llvm/ADT/GenericConvergenceVerifierImpl.h | ||
---|---|---|
34 | Fixed this by moving the file into llvm/IR. But I still see a failure in the modules build, in a different place: In file included from /home/ssahasra/projects/llvm-gmir-verifier/llvm/lib/Support/MemAlloc.cpp:10: ... /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/type_traits:2993:41: error: template parameter redefines default argument template <typename _Tp, unsigned _Idx = 0> ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/type_traits:2993:41: note: previous default template argument defined here template <typename _Tp, unsigned _Idx = 0> ^ 1 error generated. Is that expected? I am using "Ubuntu clang version 14.0.6" |
llvm/include/llvm/ADT/GenericConvergenceVerifierImpl.h | ||
---|---|---|
34 | I am not too familiar with stdc++ implementation (it should work) but libcxx should just work. We have some macOS bots covering the module builds (it didn't report last time because your commit and revert happen to landed in the same build). |
can this be function_ref? I'd expect this to have the failure context as an explicit argument