arsenm wrote: > I don't think middle end passes are allowed to include TargetLowering.h are they? Isn't that why TTI exists? Yes, for certain value of middle end. Codegen IR passes can use TargetLowering https://github.com/llvm/llvm-project/pull/127753