llvm.org GIT mirror llvm / aa47729
Disable this-return argument forwarding on ARM/AArch64 r275042 reverted function-attribute inference for the 'returned' attribute because the feature triggered self-hosting failures on ARM and AArch64. James Molloy determined that the this-return argument forwarding feature, which directly ties the returned input argument to the returned value, was the cause. It seems likely that this forwarding code contains, or triggers, a subtle bug. Disabling for now until we can track that down. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275677 91177308-0d34-0410-b5e6-96231b3b80d8 Hal Finkel 4 years ago
5 changed file(s) with 21 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
5151 "aarch64-elf-ldtls-generation", cl::Hidden,
5252 cl::desc("Allow AArch64 Local Dynamic TLS code generation"),
5353 cl::init(false));
54
55 // Disabled for causing self-hosting failures once returned-attribute inference
56 // was enabled.
57 static cl::opt
58 EnableThisRetForwarding("aarch64-this-return-forwarding", cl::Hidden,
59 cl::desc("Directly forward this return"),
60 cl::init(false));
5461
5562 /// Value type used for condition codes.
5663 static const MVT MVT_CC = MVT::i32;
27272734
27282735 // Pass 'this' value directly from the argument to return value, to avoid
27292736 // reg unit interference
2730 if (i == 0 && isThisReturn) {
2737 if (i == 0 && isThisReturn && EnableThisRetForwarding) {
27312738 assert(!VA.needsCustom() && VA.getLocVT() == MVT::i64 &&
27322739 "unexpected return calling convention register assignment");
27332740 InVals.push_back(ThisVal);
6363 ARMInterworking("arm-interworking", cl::Hidden,
6464 cl::desc("Enable / disable ARM interworking (for debugging only)"),
6565 cl::init(true));
66
67 // Disabled for causing self-hosting failures once returned-attribute inference
68 // was enabled.
69 static cl::opt
70 EnableThisRetForwarding("arm-this-return-forwarding", cl::Hidden,
71 cl::desc("Directly forward this return"),
72 cl::init(false));
6673
6774 namespace {
6875 class ARMCCState : public CCState {
14651472
14661473 // Pass 'this' value directly from the argument to return value, to avoid
14671474 // reg unit interference
1468 if (i == 0 && isThisReturn) {
1475 if (i == 0 && isThisReturn && EnableThisRetForwarding) {
14691476 assert(!VA.needsCustom() && VA.getLocVT() == MVT::i32 &&
14701477 "unexpected return calling convention register assignment");
14711478 InVals.push_back(ThisVal);
None ; RUN: llc < %s -march=arm64 | FileCheck %s
0 ; RUN: llc < %s -march=arm64 -aarch64-this-return-forwarding | FileCheck %s
11
22 %struct.A = type { i8 }
33 %struct.B = type { i32 }
None ; RUN: llc < %s -mtriple=armv6-linux-gnueabi | FileCheck %s -check-prefix=CHECKELF
1 ; RUN: llc < %s -mtriple=thumbv7-apple-ios5.0 | FileCheck %s -check-prefix=CHECKT2D
0 ; RUN: llc < %s -mtriple=armv6-linux-gnueabi -arm-this-return-forwarding | FileCheck %s -check-prefix=CHECKELF
1 ; RUN: llc < %s -mtriple=thumbv7-apple-ios5.0 -arm-this-return-forwarding | FileCheck %s -check-prefix=CHECKT2D
22
33 declare i16 @identity16(i16 returned %x)
44 declare i32 @identity32(i32 returned %x)
None ; RUN: llc < %s -mtriple=armv6-linux-gnueabi | FileCheck %s -check-prefix=CHECKELF
1 ; RUN: llc < %s -mtriple=thumbv7-apple-ios5.0 | FileCheck %s -check-prefix=CHECKT2D
0 ; RUN: llc < %s -mtriple=armv6-linux-gnueabi -arm-this-return-forwarding | FileCheck %s -check-prefix=CHECKELF
1 ; RUN: llc < %s -mtriple=thumbv7-apple-ios5.0 -arm-this-return-forwarding | FileCheck %s -check-prefix=CHECKT2D
22
33 %struct.A = type { i8 }
44 %struct.B = type { i32 }