[LLVMbugs] [Bug 8356] New: Don't do unprofitable narrowing of loads.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Oct 11 11:24:52 PDT 2010


http://llvm.org/bugs/show_bug.cgi?id=8356

           Summary: Don't do unprofitable narrowing of loads.
           Product: new-bugs
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: jpbonn-keyword-llvmbug.a51747 at corniceresearch.com
                CC: llvmbugs at cs.uiuc.edu


Our backend only does 32 bit loads.  I noticed some loads were narrowed to 8
bits and then had to be reverted back to 32 bit loads.  This patch prevents the
initial lowering.  I've only tested this on my backend. 


Index: CodeGen/SelectionDAG/TargetLowering.cpp
===================================================================
--- CodeGen/SelectionDAG/TargetLowering.cpp    (revision 115815)
+++ CodeGen/SelectionDAG/TargetLowering.cpp    (working copy)
@@ -1899,7 +1899,9 @@
               else
                 bestOffset = (uint64_t)offset * (width/8);
               bestMask = Mask.lshr(offset * (width/8) * 8);
-              bestWidth = width;
+              EVT NewVT = EVT::getIntegerVT(*DAG.getContext(), width);
+              if  (isNarrowingProfitable(Lod->getMemoryVT(), NewVT))
+                bestWidth = width;
               break;
             }
             newMask = newMask << width;

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