[llvm-commits] [llvm] r166850 - in /llvm/trunk: lib/Target/Mips/MipsISelLowering.cpp test/CodeGen/Mips/o32_cc_byval.ll
Akira Hatanaka
ahatanaka at mips.com
Fri Oct 26 17:44:40 PDT 2012
Author: ahatanak
Date: Fri Oct 26 19:44:39 2012
New Revision: 166850
URL: http://llvm.org/viewvc/llvm-project?rev=166850&view=rev
Log:
[mips] Make sure FuncArg doesn't advance when OrigArgIndex is the same as in the
previous iteration.
Modified:
llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
llvm/trunk/test/CodeGen/Mips/o32_cc_byval.ll
Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=166850&r1=166849&r2=166850&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Fri Oct 26 19:44:39 2012
@@ -2983,10 +2983,13 @@
Function::const_arg_iterator FuncArg =
DAG.getMachineFunction().getFunction()->arg_begin();
+ unsigned CurArgIdx = 0;
MipsCC::byval_iterator ByValArg = MipsCCInfo.byval_begin();
- for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i, ++FuncArg) {
+ for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) {
CCValAssign &VA = ArgLocs[i];
+ std::advance(FuncArg, Ins[i].OrigArgIndex - CurArgIdx);
+ CurArgIdx = Ins[i].OrigArgIndex;
EVT ValVT = VA.getValVT();
ISD::ArgFlagsTy Flags = Ins[i].Flags;
bool IsRegLoc = VA.isRegLoc();
Modified: llvm/trunk/test/CodeGen/Mips/o32_cc_byval.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Mips/o32_cc_byval.ll?rev=166850&r1=166849&r2=166850&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Mips/o32_cc_byval.ll (original)
+++ llvm/trunk/test/CodeGen/Mips/o32_cc_byval.ll Fri Oct 26 19:44:39 2012
@@ -119,6 +119,16 @@
ret void
}
+%struct.S4 = type { [4 x i32] }
+
+define void @f5(i64 %a0, %struct.S4* nocapture byval %a1) nounwind {
+entry:
+ tail call void @f6(%struct.S4* byval %a1, i64 %a0) nounwind
+ ret void
+}
+
+declare void @f6(%struct.S4* nocapture byval, i64)
+
!0 = metadata !{metadata !"int", metadata !1}
!1 = metadata !{metadata !"omnipotent char", metadata !2}
!2 = metadata !{metadata !"Simple C/C++ TBAA", null}
More information about the llvm-commits
mailing list