[llvm-commits] [llvm] r50255 - in /llvm/branches/Apple/Tak: lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/2008-04-24-MemCpyBug.ll
Bill Wendling
isanbard at gmail.com
Thu Apr 24 22:48:36 PDT 2008
Author: void
Date: Fri Apr 25 00:48:35 2008
New Revision: 50255
URL: http://llvm.org/viewvc/llvm-project?rev=50255&view=rev
Log:
Applie r50239 to Tak branch.
Added:
llvm/branches/Apple/Tak/test/CodeGen/X86/2008-04-24-MemCpyBug.ll
Modified:
llvm/branches/Apple/Tak/lib/Target/X86/X86ISelLowering.cpp
Modified: llvm/branches/Apple/Tak/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Tak/lib/Target/X86/X86ISelLowering.cpp?rev=50255&r1=50254&r2=50255&view=diff
==============================================================================
--- llvm/branches/Apple/Tak/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/branches/Apple/Tak/lib/Target/X86/X86ISelLowering.cpp Fri Apr 25 00:48:35 2008
@@ -4822,7 +4822,7 @@
DAG.getConstant(Offset, AddrVT)),
Src,
DAG.getConstant(BytesLeft, SizeVT),
- Align, DstSV, Offset);
+ Align, DstSV, 0);
}
// TODO: Use a Tokenfactor, as in memcpy, instead of a single chain.
@@ -4847,8 +4847,6 @@
if (!AlwaysInline && SizeVal > getSubtarget()->getMaxInlineSizeThreshold())
return SDOperand();
- SmallVector<SDOperand, 4> Results;
-
MVT::ValueType AVT;
unsigned BytesLeft = 0;
if (Align >= 8 && Subtarget->is64Bit())
@@ -4881,25 +4879,24 @@
Ops.push_back(Chain);
Ops.push_back(DAG.getValueType(AVT));
Ops.push_back(InFlag);
- Results.push_back(DAG.getNode(X86ISD::REP_MOVS, Tys, &Ops[0], Ops.size()));
+ SDOperand RepMovs = DAG.getNode(X86ISD::REP_MOVS, Tys, &Ops[0], Ops.size());
+ SmallVector<SDOperand, 4> Results;
+ Results.push_back(RepMovs);
if (BytesLeft) {
// Handle the last 1 - 7 bytes.
unsigned Offset = SizeVal - BytesLeft;
MVT::ValueType DstVT = Dst.getValueType();
MVT::ValueType SrcVT = Src.getValueType();
MVT::ValueType SizeVT = Size.getValueType();
-
- Results.push_back(DAG.getMemcpy(Chain,
+ Results.push_back(DAG.getMemcpy(Chain,
DAG.getNode(ISD::ADD, DstVT, Dst,
- DAG.getConstant(Offset,
- DstVT)),
+ DAG.getConstant(Offset, DstVT)),
DAG.getNode(ISD::ADD, SrcVT, Src,
- DAG.getConstant(Offset,
- SrcVT)),
+ DAG.getConstant(Offset, SrcVT)),
DAG.getConstant(BytesLeft, SizeVT),
Align, AlwaysInline,
- DstSV, Offset, SrcSV, Offset));
+ DstSV, 0, SrcSV, 0));
}
return DAG.getNode(ISD::TokenFactor, MVT::Other, &Results[0], Results.size());
Added: llvm/branches/Apple/Tak/test/CodeGen/X86/2008-04-24-MemCpyBug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Tak/test/CodeGen/X86/2008-04-24-MemCpyBug.ll?rev=50255&view=auto
==============================================================================
--- llvm/branches/Apple/Tak/test/CodeGen/X86/2008-04-24-MemCpyBug.ll (added)
+++ llvm/branches/Apple/Tak/test/CodeGen/X86/2008-04-24-MemCpyBug.ll Fri Apr 25 00:48:35 2008
@@ -0,0 +1,12 @@
+; RUN: llvm-as < %s | llc -march=x86 | not grep 120
+; Don't accidentally add the offset twice for trailing bytes.
+
+ %struct.S63 = type { [63 x i8] }
+ at g1s63 = external global %struct.S63 ; <%struct.S63*> [#uses=1]
+
+declare void @test63(%struct.S63* byval align 4 ) nounwind
+
+define void @testit63_entry_2E_ce() nounwind {
+ tail call void @test63( %struct.S63* byval align 4 @g1s63 ) nounwind
+ ret void
+}
More information about the llvm-commits
mailing list