[polly] [llvm] [TargetLowering] remove unused virtual from ComputeConstraintToUse (PR #67171)

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 17 11:04:09 PST 2023


rnk wrote:

I'd say that we have an unwanted dependency between Passes and CodeGen as a result of the codegen pass NPM work. IR-only tools like llvm-extract now depend on CodeGen. Fixing that would be nice conceptually, but it might not be high priority, and it's not creating fragility.

The layering issue is that CodeGen has a header dependency on SelectionDAG without having a library link dependency on it. CodeGenPrepare calls ComputeConstraintToUse, which is defined in SelectionDAG:
https://github.com/llvm/llvm-project/blob/main/llvm/lib/CodeGen/CodeGenPrepare.cpp#L5024

If you make the virtual call direct, it results in a linker error. This code can't execute at runtime if you don't link in any targets that implement TargetLowering anyway, llvm-extract just depends on it transitively.

I'm not sure what the next step is, I think I touched this before and looked the other way.

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


More information about the llvm-commits mailing list