Skip to content
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

Closed
lattner opened this issue Dec 23, 2005 · 8 comments
Closed

Simplify the TargetLowering interface #1052

lattner opened this issue Dec 23, 2005 · 8 comments
Labels
bugzilla Issues migrated from bugzilla code-cleanup llvm:codegen

Comments

@lattner
Copy link
Collaborator

lattner commented Dec 23, 2005

Bugzilla Link 680
Resolution FIXED
Resolved on Feb 22, 2010 12:43
Version trunk
OS All

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:

  1. It gets rid of lowering during dag construction, making it easier to understand things for new people.

  2. 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.

  3. 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

@lattner
Copy link
Collaborator Author

lattner commented Dec 23, 2005

s/two/three :)

@llvmbot
Copy link
Collaborator

llvmbot commented Jan 25, 2006

LowerVA* is dead.

Need to replace LowerCallTo, LowerArguments, and LowerReturnTo next.

@llvmbot
Copy link
Collaborator

llvmbot commented Jan 27, 2006

LowerReturnTo is dead. Just args and calls left.

@lattner
Copy link
Collaborator Author

lattner commented May 16, 2006

ISD::FORMAL_ARGUMENTS is implemented and working. We just have calls left.

-Chris

@lattner
Copy link
Collaborator Author

lattner commented May 16, 2006

Oh, we also have TLI::LowerFrameReturnAddress. It should be easy, but I don't plan to do it in the
immediate future.

-Chris

@lattner
Copy link
Collaborator Author

lattner commented May 17, 2006

ISD::CALL now exists, we just need TLI::LowerFrameReturnAddress converted over.

-Chris

@lattner
Copy link
Collaborator Author

lattner commented Aug 25, 2006

This one is close, but not done yet. The rest looks easy though.

@llvmbot
Copy link
Collaborator

llvmbot commented Jan 30, 2007

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla code-cleanup llvm:codegen
Projects
None yet
Development

No branches or pull requests

2 participants