Sachin.Punyani at microchip.com
2008-Dec-18 07:49 UTC
[LLVMdev] Doubts about lowering of UMUL_LOHI
Hi, When expanding multiply operation in LegalizeTypes LLVM generates some nodes such as UMUL_LOHI (please refer file LegalizeIntegerTypes.cpp - function - ExpandIntegerResult). However while lowering this operation in LegalizeDAG (please refer file LegalizeDAG.cpp - function - LegalizeOp) the comment says "These nodes will only be produced by target-specific lowering.....". LLVM, therefore, does not call the LowerOperation for these operations. Function setOperationAction(UMUL_LOHI, ValueType, Custom) does not work for these nodes. My Doubts 1) Why is there such contradiction in the code and comment? 2) Why is custom legalization of this node not allowed? 3) My target does not have any instruction directly matching to this operation. How should this node be legalized? Regards Sachin -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20081218/57d40f8b/attachment.html>
On Wed, Dec 17, 2008 at 11:49 PM, <Sachin.Punyani at microchip.com> wrote:> 2) Why is custom legalization of this node not allowed?No target has needed it so far. Why do you need it?> 3) My target does not have any instruction directly matching to this > operation. How should this node be legalized?If your target doesn't have this operation, you should mark it Expand; legalization will take care of the rest. -Eli
Sachin.Punyani at microchip.com
2008-Dec-19 02:45 UTC
[LLVMdev] Doubts about lowering of UMUL_LOHI
> -----Original Message----- > From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu]On> Behalf Of Eli Friedman > Sent: Thursday, December 18, 2008 1:52 PM > To: LLVM Developers Mailing List > Subject: Re: [LLVMdev] Doubts about lowering of UMUL_LOHI > > On Wed, Dec 17, 2008 at 11:49 PM, <Sachin.Punyani at microchip.com>wrote:> > 2) Why is custom legalization of this node not allowed? > > No target has needed it so far. Why do you need it?I may not need this. I have an 8-bit target. Also there is no instruction for multiply operation. Therefore I want to make a library call for this operation. I think better option would be to have library calls for types MVT::i8 and MVT::i16 in RTLIB enum. Currently this enum does not list any calls for types less than MVT::i32. Regards Sachin> > > 3) My target does not have any instruction directly matchingto> this > > operation. How should this node be legalized? > > If your target doesn't have this operation, you should mark it Expand; > legalization will take care of the rest. > > -Eli > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev