[LLVMdev] Illegal node introduced by DAGCombiner after legal phase

Borja Ferrer borja.ferav at gmail.com
Sun Aug 26 11:48:40 PDT 2012


Hello,

I'm getting an instruction selection error because DAGCombiner is
introducing an illegal node after the legalizeDAG phase. Basically this is
what is going on:

1) During legalization, BR_JT gets expanded introducing a (mul x, 2).
2) After legalization  (AfterLegalizeDAG), that (mul x, 2) is converted to
an (shl x, 1).

However, that shl node introduced is illegal, and since my custom lowering
code won't run after this phase it gets into the instruction selector. I
would like to know if this is really a bug or it has to be handled by the
target code. I guess I could add a custom dagcombine hook for this node and
revert it in my target, but I want to hear what is the best thing to do.

Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120826/92fcac4d/attachment.html>


More information about the llvm-dev mailing list