New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify the TargetLowering interface #1052
Comments
s/two/three :) |
LowerVA* is dead. Need to replace LowerCallTo, LowerArguments, and LowerReturnTo next. |
LowerReturnTo is dead. Just args and calls left. |
ISD::FORMAL_ARGUMENTS is implemented and working. We just have calls left. -Chris |
Oh, we also have TLI::LowerFrameReturnAddress. It should be easy, but I don't plan to do it in the -Chris |
ISD::CALL now exists, we just need TLI::LowerFrameReturnAddress converted over. -Chris |
This one is close, but not done yet. The rest looks easy though. |
Extended Description
TargetLowering expects the target to implement two types of virtual methods: LowerOperation and the
rest of the Lower* methods. The LowerOperation method is used by the legalizer, and the rest of the
Lower* methods are used at dag formation time. This is confusing and makes future work harder.
Instead of this, it would be nice for SelectionDAGISel to create a target-independent node for each of
the Lower* methods, and have LowerOperation do the actual implementation. For example, the
LowerCallTo method could return an new ISD::CALLTO node which has all of the operands and the
return value passed into the call: this would get expanded at legalize time. Another important case is
incoming arguments. This could be represented with an ISD::INCOMINGARGS node which has a token
chain input (entry node) and one result for each incoming argument to a function.
This is interesting for two reasons:
It gets rid of lowering during dag construction, making it easier to understand things for new people.
This allows the legalizer to hack on things before having the target lower the node. For example, if a
target doesn't know how to pass a <16 x double> vector to a function but does know how to pass <4 x
vector>'s, the legalizer would simplify it down before handing it off to the LowerOperation code.
This makes a future planned change more powerful: I want to be able to run the dag combiner on
intermediate stages of legalization (e.g. after custom lower is done, but before other legalization has
been run). This will allow us to catch things like the double->longlong->double conversion sequence
in PPC.
-Chris
The text was updated successfully, but these errors were encountered: