llvm.org GIT mirror llvm / da282fc
Merging r199763: ------------------------------------------------------------------------ r199763 | hfinkel | 2014-01-21 15:15:58 -0500 (Tue, 21 Jan 2014) | 9 lines Fix pointer info on PPC byval stores For PPC64 SVR (and Darwin), the stores that take byval aggregate parameters from registers into the stack frame had MachinePointerInfo objects with incorrect offsets. These offsets are relative to the object itself, not to the stack frame base. This fixes self hosting on PPC64 when compiling with -enable-aa-sched-mi. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@205819 91177308-0d34-0410-b5e6-96231b3b80d8 Tom Stellard 6 years ago
2 changed file(s) with 22 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
23322332 EVT ObjType = (ObjSize == 1 ? MVT::i8 :
23332333 (ObjSize == 2 ? MVT::i16 : MVT::i32));
23342334 Store = DAG.getTruncStore(Val.getValue(1), dl, Val, FIN,
2335 MachinePointerInfo(FuncArg, CurArgOffset),
2335 MachinePointerInfo(FuncArg),
23362336 ObjType, false, false, 0);
23372337 } else {
23382338 // For sizes that don't fit a truncating store (3, 5, 6, 7),
23442344 int FI = MFI->CreateFixedObject(PtrByteSize, ArgOffset, true);
23452345 SDValue FIN = DAG.getFrameIndex(FI, PtrVT);
23462346 Store = DAG.getStore(Val.getValue(1), dl, Val, FIN,
2347 MachinePointerInfo(FuncArg, ArgOffset),
2347 MachinePointerInfo(FuncArg),
23482348 false, false, 0);
23492349 }
23502350
23682368 SDValue FIN = DAG.getFrameIndex(FI, PtrVT);
23692369 SDValue Val = DAG.getCopyFromReg(Chain, dl, VReg, PtrVT);
23702370 SDValue Store = DAG.getStore(Val.getValue(1), dl, Val, FIN,
2371 MachinePointerInfo(FuncArg, ArgOffset),
2371 MachinePointerInfo(FuncArg, j),
23722372 false, false, 0);
23732373 MemOps.push_back(Store);
23742374 ++GPR_idx;
26642664 SDValue Val = DAG.getCopyFromReg(Chain, dl, VReg, PtrVT);
26652665 EVT ObjType = ObjSize == 1 ? MVT::i8 : MVT::i16;
26662666 SDValue Store = DAG.getTruncStore(Val.getValue(1), dl, Val, FIN,
2667 MachinePointerInfo(FuncArg,
2668 CurArgOffset),
2667 MachinePointerInfo(FuncArg),
26692668 ObjType, false, false, 0);
26702669 MemOps.push_back(Store);
26712670 ++GPR_idx;
26892688 SDValue FIN = DAG.getFrameIndex(FI, PtrVT);
26902689 SDValue Val = DAG.getCopyFromReg(Chain, dl, VReg, PtrVT);
26912690 SDValue Store = DAG.getStore(Val.getValue(1), dl, Val, FIN,
2692 MachinePointerInfo(FuncArg, ArgOffset),
2691 MachinePointerInfo(FuncArg, j),
26932692 false, false, 0);
26942693 MemOps.push_back(Store);
26952694 ++GPR_idx;
0 ; RUN: llc < %s -print-after=prologepilog >%t 2>&1 && FileCheck <%t %s
1 target datalayout = "E-m:e-i64:64-n32:64"
2 target triple = "powerpc64-unknown-linux-gnu"
3
4 %struct.anon = type { i32, i32 }
5
6 declare void @foo(%struct.anon* %v)
7 define void @test(i32 %a, i32 %b, %struct.anon* byval nocapture %v) {
8 entry:
9 call void @foo(%struct.anon* %v)
10 ret void
11 }
12
13 ; Make sure that the MMO on the store has no offset from the byval
14 ; variable itself (we used to have mem:ST8[%v+64]).
15 ; CHECK: STD %X5, 176, %X1; mem:ST8[%v](align=16)
16