[LLVMbugs] [Bug 5424] New: Sink SelectAddr into Emit_* functions

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sat Nov 7 09:25:44 PST 2009


           Summary: Sink SelectAddr into Emit_* functions
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Backend: X86
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: daniel at zuster.org
                CC: llvmbugs at cs.uiuc.edu

Code sequences like this are very common in X86ISelDAGToDAG:
        SDValue N01 = N0.getOperand(1);
        SDValue CPTmpN01_0;
        SDValue CPTmpN01_1;
        SDValue CPTmpN01_2;
        SDValue CPTmpN01_3;
        SDValue CPTmpN01_4;
        if (SelectAddr(N, N01, CPTmpN01_0, CPTmpN01_1, CPTmpN01_2, CPTmpN01_3,
CPTmpN01_4)) {
          SDNode *Result = Emit_4(N, X86::ADD8rm, MVT::i8, CPTmpN01_0,
CPTmpN01_1, CPTmpN01_2, CPTmpN01_3, CPTmpN01_4);
          return Result;

It may be valuable to split SelectAddr into a predicate (CanSelectAddr) and an
extract function which pulls out the SDValue operands. This would allow us to
write the above code as:
        if (CanSelectAddr(N, N0.getOperand(1)))
          return Emit_4(N, X86::ADD8rm, MVT::i8);
where the extraction has been moved to Emit_4. This would probably be a compile
time (of X86ISelDAGToDAG) win, and may be a compile performance win.

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list