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: [email protected]
ReportedBy: [email protected]
CC: [email protected]
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs