[LLVMdev] Best way to replace LLVM IR operation with code containing control flow?

Nowicki, Tyler tyler.nowicki at intel.com
Mon Jun 18 14:22:05 PDT 2012


Hi,

-Does anyone know where a backend-specific optimization can be added to replace an instruction with code containing control flow?

I'm interested in adding an optimization for the DIV instruction (x86-atom) which replace the IDIV/DIV with code containing control flow to select between the intended IDIV/DIV and an 8-bit DIV with movzx, as described in the Intel Atom Optimization Guide. My first attempt was to add this with a custom inserter in X86ISelLowering (see EmitInstrWithCustomInserter). However, the isel already done in X86ISelDAGToDAG, line 2200, adds multiple instructions which makes adding control flow in X86ISelLowering difficult. Also, it looks like control flow cannot be added in X86ISelDAGToDAG.

Any suggestions are appreciated.

Thanks,

Tyler Nowicki
Intel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120618/06d1384d/attachment.html>


More information about the llvm-dev mailing list