[LLVMdev] analysis and transformation of Machine IRs
Jakob Stoklund Olesen
stoklund at 2pi.dk
Tue Aug 31 14:01:25 PDT 2010
On Aug 26, 2010, at 11:05 AM, Akira Hatanaka wrote:
> Is there a class or function that generates an add or sub instruction in a target-independent manner?
No. Such a target hook does not exist.
> I am looking for something similar to TargetInstrInfo::copyRegTpReg but one that creates other types of instructions.
It almost sounds like you should be writing a normal optimization pass that operates on LLVM IR instead of a code generator pass. That is a lot easier too. Are you doing something similar to LoopUnroll.cpp?
More information about the llvm-dev