shiltian wrote:

The target hook approach won't work here because `VerifierPass` is part of 
`LLVMCore`, so it can't depend on target-specific components and doing so would 
introduce a circular dependency.

Instead, I'm thinking of an alternative: make the target-dependent verifier run 
after the standard `VerifierPass`. For example, `PassBuilder` already supports 
callback registration. Maybe we can introduce a `registerVerifier` function 
that wraps and adds the `VerifierPass`. Alongside that, we could define 
something like `VerifierRegistrationCallbacks`, where each target can register 
its own verifier using `registerVerifierCallback`.

Then, wherever we currently call `addPass(VerifierPass())`, we'd replace it 
with `registerVerifier()`, which would insert both the core verifier and any 
target-specific verifiers.

Does this sound like a viable approach?

https://github.com/llvm/llvm-project/pull/123609
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to