[llvm] [CodeGen] Make the parameter TRI required in some functions. (PR #85968)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 7 08:29:40 PDT 2024


RKSimon wrote:

> Why do you need to pass in TRI at all? Can't MachineInstr methods always get at it via MF.getSubtarget().getRegisterInfo()?

MF data isn't always available - hence why we have the tryToGetTargetInfo workaround. I'm not sure if there are cases where we can provide a valid TRI pointer but tryToGetTargetInfo would have failed?

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


More information about the llvm-commits mailing list