[LLVMdev] Illegal node introduced by DAGCombiner after legal phase

Villmow, Micah Micah.Villmow at amd.com
Mon Aug 27 08:56:33 PDT 2012


Borja,
In this situation, you need to find the place where shl is generated and add a check to see if shl is legal before allowing it to do the transform.

Micah

From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Borja Ferrer
Sent: Sunday, August 26, 2012 11:49 AM
To: llvmdev at cs.uiuc.edu
Subject: [LLVMdev] Illegal node introduced by DAGCombiner after legal phase

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/20120827/b2fa446d/attachment.html>


More information about the llvm-dev mailing list