[LLVMbugs] [Bug 680] NEW: Simplify the TargetLowering interface

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Dec 22 18:15:33 PST 2005


http://llvm.cs.uiuc.edu/bugs/show_bug.cgi?id=680

           Summary: Simplify the TargetLowering interface
           Product: libraries
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Common Code Generator Code
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: sabre at nondot.org
                CC: evan.cheng at apple.com,natebegeman at mac.com


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



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




More information about the llvm-bugs mailing list