Przemyslaw Ossowski via llvm-dev
2020-Jan-28 17:10 UTC
[llvm-dev] Handling node through TargetLowering::LowerOperation vs TargetLowering::ReplaceNodeResults
Hi, I see that for different targets in classes which inherits from TargetLowering there are implemented both methods: LowerOperation and ReplaceNodeResults What decides that for one given ISD we have to add handling in LowerOperation and for other in ReplaceNodeResults, when for both SetOperationAction is configured to be Custom? Is it related with number of results of given operation and LowerOperation is called when there is only one SDValue? Thanks, Przemek -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200128/02528705/attachment.html>
Craig Topper via llvm-dev
2020-Jan-28 17:47 UTC
[llvm-dev] Handling node through TargetLowering::LowerOperation vs TargetLowering::ReplaceNodeResults
ReplaceNodeResults is called by the type legalizer for custom legalizing any of the results of a node that have an illegal type. LowerOperation is called by the type legalizer to custom legalize node inputs that have an illegal type. I believe technically it calls LowerOperationWrapper, but that forwards to LowerOperation by default. LowerOperation is also called for custom legalizing nodes with legal types after type legalization by both the vector op legalizer and the DAG legalizer. In those cases LowerOperation is called directly and does not call LowerOperationWrapper. On Tue, Jan 28, 2020 at 9:10 AM Przemyslaw Ossowski via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Hi, > > I see that for different targets in classes which inherits from > TargetLowering there are implemented both methods: > > LowerOperation and ReplaceNodeResults > > > > What decides that for one given ISD we have to add handling in > LowerOperation and for other in ReplaceNodeResults, when for both > SetOperationAction is configured to be Custom? > > > Is it related with number of results of given operation and LowerOperation > is called when there is only one SDValue? > > > > Thanks, > > Przemek > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-- ~Craig -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200128/5d76a2f8/attachment.html>
Przemyslaw Ossowski via llvm-dev
2020-Jan-28 20:40 UTC
[llvm-dev] Handling node through TargetLowering::LowerOperation vs TargetLowering::ReplaceNodeResults
Thank you Craig for explanation. Could be the same algorithm used for custom legalizing given node in LowerOperation and ReplaceNodeResults in case results and inputs of the node are illegal? Or actually such situation is impossible and for given node either LowerOperation or ReplaceNodeResults can be only called? Przemek wt., 28 sty 2020, 18:48 użytkownik Craig Topper <craig.topper at gmail.com> napisał:> ReplaceNodeResults is called by the type legalizer for custom legalizing > any of the results of a node that have an illegal type. > > LowerOperation is called by the type legalizer to custom legalize node > inputs that have an illegal type. I believe technically it calls > LowerOperationWrapper, but that forwards to LowerOperation by default. > > LowerOperation is also called for custom legalizing nodes with legal types > after type legalization by both the vector op legalizer and the DAG > legalizer. In those cases LowerOperation is called directly and does not > call LowerOperationWrapper. > > On Tue, Jan 28, 2020 at 9:10 AM Przemyslaw Ossowski via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > >> Hi, >> >> I see that for different targets in classes which inherits from >> TargetLowering there are implemented both methods: >> >> LowerOperation and ReplaceNodeResults >> >> >> >> What decides that for one given ISD we have to add handling in >> LowerOperation and for other in ReplaceNodeResults, when for both >> SetOperationAction is configured to be Custom? >> >> >> Is it related with number of results of given operation and >> LowerOperation is called when there is only one SDValue? >> >> >> >> Thanks, >> >> Przemek >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >> > -- > ~Craig >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200128/81cac9a5/attachment.html>