Jonas Paulsson via llvm-dev
2017-Jan-23 13:21 UTC
[llvm-dev] returning from LowerOperation()
Hi Eli, I would like to clarify generally what the difference is between returning SDValue() and Op (input argument unchanged) from LowerOperation()? My understanding is that returning SDValue() means that Target gives up, and the common code is supposed to handle it. Returning Op, the unchanged argument, means that the Target is happy with the node as it is, and the common code can move on to something else. Are there any exceptions to this? Is this commented on anywhere? Are there cases where the target should not return SDValue()? Thanks, Jonas
Friedman, Eli via llvm-dev
2017-Jan-23 20:36 UTC
[llvm-dev] returning from LowerOperation()
On 1/23/2017 5:21 AM, Jonas Paulsson wrote:> Hi Eli, > > I would like to clarify generally what the difference is between > returning SDValue() and Op (input argument unchanged) from > LowerOperation()? > > My understanding is that returning SDValue() means that Target gives > up, and the common code is supposed to handle it. Returning Op, the > unchanged argument, means that the Target is happy with the node as it > is, and the common code can move on to something else.This is right.> Are there any exceptions to this? Is this commented on anywhere? Are > there cases where the target should not return SDValue()?No exceptions to this. Not sure if it's described anywhere off the top of my head; if there isn't a comment describing this on the declaration of LowerOperation or LowerOperationWrapper, it would probably be good to add one. Returning SDValue() should be "fine" in all cases (it might lead to a fatal error if we can't actually lower the operation). -Eli -- Employee of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Matt Arsenault via llvm-dev
2017-Jan-23 20:41 UTC
[llvm-dev] returning from LowerOperation()
> On Jan 23, 2017, at 12:36, Friedman, Eli via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > On 1/23/2017 5:21 AM, Jonas Paulsson wrote: >> Hi Eli, >> >> I would like to clarify generally what the difference is between returning SDValue() and Op (input argument unchanged) from LowerOperation()? >> >> My understanding is that returning SDValue() means that Target gives up, and the common code is supposed to handle it. Returning Op, the unchanged argument, means that the Target is happy with the node as it is, and the common code can move on to something else. > > This is right.This sounds backwards. Returning SDValue() means the node should be treated as legal. Returning the original operation should hit the expand path. -Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170123/9d115080/attachment.html>