Merge remote-tracking branch 'origin/7' into snapshot

This commit is contained in:
Sylvestre Ledru 2018-09-11 12:13:00 +02:00
commit e2c21f455a
2 changed files with 67 additions and 1 deletions

65
debian/patches/D51108-rust-powerpc.diff vendored Normal file
View File

@ -0,0 +1,65 @@
Index: llvm-toolchain-7-7~+rc2/lib/Target/PowerPC/PPCISelLowering.cpp
===================================================================
--- llvm-toolchain-7-7~+rc2.orig/lib/Target/PowerPC/PPCISelLowering.cpp
+++ llvm-toolchain-7-7~+rc2/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -3480,9 +3480,14 @@ SDValue PPCTargetLowering::LowerFormalAr
// Argument stored in memory.
assert(VA.isMemLoc());
+ // Get the extended size of the argument type in stack
unsigned ArgSize = VA.getLocVT().getStoreSize();
- int FI = MFI.CreateFixedObject(ArgSize, VA.getLocMemOffset(),
- isImmutable);
+ // Get the actual size of the argument type
+ unsigned ObjSize = VA.getValVT().getStoreSize();
+ unsigned ArgOffset = VA.getLocMemOffset();
+ // Stack objects in PPC32 are right justified.
+ ArgOffset += ArgSize - ObjSize;
+ int FI = MFI.CreateFixedObject(ArgSize, ArgOffset, isImmutable);
// Create load nodes to retrieve arguments from the stack.
SDValue FIN = DAG.getFrameIndex(FI, PtrVT);
@@ -5437,10 +5442,11 @@ SDValue PPCTargetLowering::LowerCall_32S
Arg = PtrOff;
}
- if (VA.isRegLoc()) {
- if (Arg.getValueType() == MVT::i1)
- Arg = DAG.getNode(ISD::ZERO_EXTEND, dl, MVT::i32, Arg);
+ // Ensure callee will get either 0x00000001 or 0x00000000.
+ if (Arg.getValueType() == MVT::i1)
+ Arg = DAG.getNode(ISD::ZERO_EXTEND, dl, MVT::i32, Arg);
+ if (VA.isRegLoc()) {
seenFloatArg |= VA.getLocVT().isFloatingPoint();
// Put argument in a physical register.
RegsToPass.push_back(std::make_pair(VA.getLocReg(), Arg));
Index: llvm-toolchain-7-7~+rc2/test/CodeGen/PowerPC/ppc32-i1-stack-arguments-abi-bug.ll
===================================================================
--- /dev/null
+++ llvm-toolchain-7-7~+rc2/test/CodeGen/PowerPC/ppc32-i1-stack-arguments-abi-bug.ll
@@ -0,0 +1,24 @@
+; RUN: llc -verify-machineinstrs < %s -mcpu=ppc32 -mattr=+crbits | FileCheck %s
+target triple = "powerpc-unknown-linux-gnu"
+
+define zeroext i1 @check_callee(
+ i1 zeroext, i1 zeroext, i1 zeroext, i1 zeroext,
+ i1 zeroext, i1 zeroext, i1 zeroext, i1 zeroext,
+ i1 zeroext %s1
+) {
+ call void @check_caller(
+ i1 zeroext true, i1 zeroext true, i1 zeroext true, i1 zeroext true,
+ i1 zeroext true, i1 zeroext true, i1 zeroext true, i1 zeroext true,
+ i1 zeroext %s1)
+ ret i1 true
+}
+
+; CHECK-LABEL: @check_callee
+; CHECK: lbz {{[0-9]+}}, 27(1)
+; CHECK: stw {{[0-9]+}}, 8(1)
+
+declare void @check_caller(
+ i1 zeroext, i1 zeroext, i1 zeroext, i1 zeroext,
+ i1 zeroext, i1 zeroext, i1 zeroext, i1 zeroext,
+ i1 zeroext
+)

View File

@ -58,7 +58,6 @@ impl-path-hurd.diff
openmp-check-execstack.diff openmp-check-execstack.diff
openmp-soname.diff openmp-soname.diff
openmp-mips-affinity.patch openmp-mips-affinity.patch
D51108.diff
# libcxx # libcxx
libcxxabi-test-don-t-fail-extended-long-double.patch libcxxabi-test-don-t-fail-extended-long-double.patch
@ -69,3 +68,5 @@ libcxx-silent-test-libcxx.diff
libcxx-silent-failure-ppc64el.diff libcxx-silent-failure-ppc64el.diff
libcxx-silent-failure-arm64.diff libcxx-silent-failure-arm64.diff
# Rust on ppc
D51108-rust-powerpc.diff