[LLVMdev] analysis and transformation of Machine IRs

Akira Hatanaka ahatanak at gmail.com
Tue Aug 31 14:45:32 PDT 2010

Thank you for replying to my email.

On Tue, Aug 31, 2010 at 2:01 PM, Jakob Stoklund Olesen <stoklund at 2pi.dk>wrote:

> 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?
> /jakob
It reorders and replicates instructions in the original machine basic block,
so in a sense it is similar to LoopUnroll.cpp.

As you have pointed out, I agree that an LLVM IR scheduling pass would be
much easier to write. However, since the scheduling pass I am writing uses
the target instructions' latency and resource usage information, it would be
hard to generate a good schedule if it were operating on the LLVM IR instead
of the Machine IR.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100831/9438b46f/attachment.html>

More information about the llvm-dev mailing list