[llvm-dev] [MachineLICM] how to add target-special constraints

realprincewall@yahoo.com via llvm-dev llvm-dev at lists.llvm.org
Sat Oct 31 17:33:01 PDT 2020


Hi,
I am facing a problem that MachineLICM is hoisting some MachineInstrs that are special for my target. I do not want to disable the optimization so I am looking for some solutions to avoid such hoisting. I have not seen anyone create subclass for MachineLICMBase either.
Looking at the implementation in MachineLICMBase::ProcessMI(), I could not find a place to add target specific constraints (for example, defines to certain registers cannot be hoisted). There is no target-specific callbacks I can overwrite.
One possible fix I can think of is to initialize PhysRegClobbers with the special registers. However, that will require a lot of changes to the common codebase, for example, I might need to add some helper functions in TargetRegisterInfo. I am not sure if that is a good idea.
Any suggestions are highly appreciated. 
Many thanks,PW
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20201101/cf4a5ccd/attachment-0001.html>


More information about the llvm-dev mailing list