Skip to content

Commit 6f6eea4

Browse files
committed
Rebase
1 parent b18f4e7 commit 6f6eea4

File tree

24 files changed

+79
-9907
lines changed

24 files changed

+79
-9907
lines changed

clang/lib/CodeGen/TargetInfo.cpp

Lines changed: 0 additions & 9826 deletions
Large diffs are not rendered by default.

clang/lib/CodeGen/Targets/SystemZ.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -445,16 +445,20 @@ ABIArgInfo SystemZABIInfo::classifyArgumentType(QualType Ty) const {
445445
return getNaturalAlignIndirect(Ty, /*ByVal=*/false);
446446

447447
// The structure is passed as an unextended integer, a float, or a double.
448-
llvm::Type *PassTy;
449448
if (isFPArgumentType(SingleElementTy)) {
450449
assert(Size == 32 || Size == 64);
450+
llvm::Type *PassTy;
451451
if (Size == 32)
452452
PassTy = llvm::Type::getFloatTy(getVMContext());
453453
else
454454
PassTy = llvm::Type::getDoubleTy(getVMContext());
455-
} else
456-
PassTy = llvm::IntegerType::get(getVMContext(), Size);
457-
return ABIArgInfo::getDirect(PassTy);
455+
return ABIArgInfo::getDirect(PassTy);
456+
} else {
457+
llvm::IntegerType *PassTy = llvm::IntegerType::get(getVMContext(), Size);
458+
if (Size <= 32)
459+
return ABIArgInfo::getNoExtend(PassTy);
460+
return ABIArgInfo::getDirect(PassTy);
461+
}
458462
}
459463

460464
// Non-structure compounds are passed indirectly.

clang/test/CodeGen/SystemZ/systemz-abi-vector.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,17 +146,17 @@ v1f128 pass_v1f128(v1f128 arg) { return arg; }
146146

147147
struct agg_v1i8 { v1i8 a; };
148148
struct agg_v1i8 pass_agg_v1i8(struct agg_v1i8 arg) { return arg; }
149-
// CHECK-LABEL: define{{.*}} void @pass_agg_v1i8(ptr dead_on_unwind noalias writable sret(%struct.agg_v1i8) align 1 %{{.*}}, i8 %{{.*}})
149+
// CHECK-LABEL: define{{.*}} void @pass_agg_v1i8(ptr dead_on_unwind noalias writable sret(%struct.agg_v1i8) align 1 %{{.*}}, i8 noext %{{.*}})
150150
// CHECK-VECTOR-LABEL: define{{.*}} void @pass_agg_v1i8(ptr dead_on_unwind noalias writable sret(%struct.agg_v1i8) align 1 %{{.*}}, <1 x i8> %{{.*}})
151151

152152
struct agg_v2i8 { v2i8 a; };
153153
struct agg_v2i8 pass_agg_v2i8(struct agg_v2i8 arg) { return arg; }
154-
// CHECK-LABEL: define{{.*}} void @pass_agg_v2i8(ptr dead_on_unwind noalias writable sret(%struct.agg_v2i8) align 2 %{{.*}}, i16 %{{.*}})
154+
// CHECK-LABEL: define{{.*}} void @pass_agg_v2i8(ptr dead_on_unwind noalias writable sret(%struct.agg_v2i8) align 2 %{{.*}}, i16 noext %{{.*}})
155155
// CHECK-VECTOR-LABEL: define{{.*}} void @pass_agg_v2i8(ptr dead_on_unwind noalias writable sret(%struct.agg_v2i8) align 2 %{{.*}}, <2 x i8> %{{.*}})
156156

157157
struct agg_v4i8 { v4i8 a; };
158158
struct agg_v4i8 pass_agg_v4i8(struct agg_v4i8 arg) { return arg; }
159-
// CHECK-LABEL: define{{.*}} void @pass_agg_v4i8(ptr dead_on_unwind noalias writable sret(%struct.agg_v4i8) align 4 %{{.*}}, i32 %{{.*}})
159+
// CHECK-LABEL: define{{.*}} void @pass_agg_v4i8(ptr dead_on_unwind noalias writable sret(%struct.agg_v4i8) align 4 %{{.*}}, i32 noext %{{.*}})
160160
// CHECK-VECTOR-LABEL: define{{.*}} void @pass_agg_v4i8(ptr dead_on_unwind noalias writable sret(%struct.agg_v4i8) align 4 %{{.*}}, <4 x i8> %{{.*}})
161161

162162
struct agg_v8i8 { v8i8 a; };
@@ -189,8 +189,8 @@ struct agg_novector2 pass_agg_novector2(struct agg_novector2 arg) { return arg;
189189

190190
struct agg_novector3 { v4i8 a; int : 0; };
191191
struct agg_novector3 pass_agg_novector3(struct agg_novector3 arg) { return arg; }
192-
// CHECK-LABEL: define{{.*}} void @pass_agg_novector3(ptr dead_on_unwind noalias writable sret(%struct.agg_novector3) align 4 %{{.*}}, i32 %{{.*}})
193-
// CHECK-VECTOR-LABEL: define{{.*}} void @pass_agg_novector3(ptr dead_on_unwind noalias writable sret(%struct.agg_novector3) align 4 %{{.*}}, i32 %{{.*}})
192+
// CHECK-LABEL: define{{.*}} void @pass_agg_novector3(ptr dead_on_unwind noalias writable sret(%struct.agg_novector3) align 4 %{{.*}}, i32 noext %{{.*}})
193+
// CHECK-VECTOR-LABEL: define{{.*}} void @pass_agg_novector3(ptr dead_on_unwind noalias writable sret(%struct.agg_novector3) align 4 %{{.*}}, i32 noext %{{.*}})
194194

195195
struct agg_novector4 { v4i8 a __attribute__((aligned (8))); };
196196
struct agg_novector4 pass_agg_novector4(struct agg_novector4 arg) { return arg; }

clang/test/CodeGen/SystemZ/systemz-abi.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,19 @@ _Complex long double pass_complex_longdouble(_Complex long double arg) { return
8686

8787
struct agg_1byte { char a[1]; };
8888
struct agg_1byte pass_agg_1byte(struct agg_1byte arg) { return arg; }
89-
// CHECK-LABEL: define{{.*}} void @pass_agg_1byte(ptr dead_on_unwind noalias writable sret(%struct.agg_1byte) align 1 %{{.*}}, i8 %{{.*}})
89+
// CHECK-LABEL: define{{.*}} void @pass_agg_1byte(ptr dead_on_unwind noalias writable sret(%struct.agg_1byte) align 1 %{{.*}}, i8 noext %{{.*}})
9090

9191
struct agg_2byte { char a[2]; };
9292
struct agg_2byte pass_agg_2byte(struct agg_2byte arg) { return arg; }
93-
// CHECK-LABEL: define{{.*}} void @pass_agg_2byte(ptr dead_on_unwind noalias writable sret(%struct.agg_2byte) align 1 %{{.*}}, i16 %{{.*}})
93+
// CHECK-LABEL: define{{.*}} void @pass_agg_2byte(ptr dead_on_unwind noalias writable sret(%struct.agg_2byte) align 1 %{{.*}}, i16 noext %{{.*}})
9494

9595
struct agg_3byte { char a[3]; };
9696
struct agg_3byte pass_agg_3byte(struct agg_3byte arg) { return arg; }
9797
// CHECK-LABEL: define{{.*}} void @pass_agg_3byte(ptr dead_on_unwind noalias writable sret(%struct.agg_3byte) align 1 %{{.*}}, ptr %{{.*}})
9898

9999
struct agg_4byte { char a[4]; };
100100
struct agg_4byte pass_agg_4byte(struct agg_4byte arg) { return arg; }
101-
// CHECK-LABEL: define{{.*}} void @pass_agg_4byte(ptr dead_on_unwind noalias writable sret(%struct.agg_4byte) align 1 %{{.*}}, i32 %{{.*}})
101+
// CHECK-LABEL: define{{.*}} void @pass_agg_4byte(ptr dead_on_unwind noalias writable sret(%struct.agg_4byte) align 1 %{{.*}}, i32 noext %{{.*}})
102102

103103
struct agg_5byte { char a[5]; };
104104
struct agg_5byte pass_agg_5byte(struct agg_5byte arg) { return arg; }
@@ -126,7 +126,7 @@ struct agg_16byte pass_agg_16byte(struct agg_16byte arg) { return arg; }
126126
struct agg_float { float a; };
127127
struct agg_float pass_agg_float(struct agg_float arg) { return arg; }
128128
// HARD-FLOAT-LABEL: define{{.*}} void @pass_agg_float(ptr dead_on_unwind noalias writable sret(%struct.agg_float) align 4 %{{.*}}, float %{{.*}})
129-
// SOFT-FLOAT-LABEL: define{{.*}} void @pass_agg_float(ptr dead_on_unwind noalias writable sret(%struct.agg_float) align 4 %{{.*}}, i32 %{{.*}})
129+
// SOFT-FLOAT-LABEL: define{{.*}} void @pass_agg_float(ptr dead_on_unwind noalias writable sret(%struct.agg_float) align 4 %{{.*}}, i32 noext %{{.*}})
130130

131131
struct agg_double { double a; };
132132
struct agg_double pass_agg_double(struct agg_double arg) { return arg; }
@@ -159,14 +159,14 @@ struct agg_nofloat2 pass_agg_nofloat2(struct agg_nofloat2 arg) { return arg; }
159159

160160
struct agg_nofloat3 { float a; int : 0; };
161161
struct agg_nofloat3 pass_agg_nofloat3(struct agg_nofloat3 arg) { return arg; }
162-
// CHECK-LABEL: define{{.*}} void @pass_agg_nofloat3(ptr dead_on_unwind noalias writable sret(%struct.agg_nofloat3) align 4 %{{.*}}, i32 %{{.*}})
162+
// CHECK-LABEL: define{{.*}} void @pass_agg_nofloat3(ptr dead_on_unwind noalias writable sret(%struct.agg_nofloat3) align 4 %{{.*}}, i32 noext %{{.*}})
163163

164164

165165
// Union types likewise are *not* float-like aggregate types
166166

167167
union union_float { float a; };
168168
union union_float pass_union_float(union union_float arg) { return arg; }
169-
// CHECK-LABEL: define{{.*}} void @pass_union_float(ptr dead_on_unwind noalias writable sret(%union.union_float) align 4 %{{.*}}, i32 %{{.*}})
169+
// CHECK-LABEL: define{{.*}} void @pass_union_float(ptr dead_on_unwind noalias writable sret(%union.union_float) align 4 %{{.*}}, i32 noext %{{.*}})
170170

171171
union union_double { double a; };
172172
union union_double pass_union_double(union union_double arg) { return arg; }

clang/test/CodeGen/SystemZ/systemz-abi.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
class agg_float_class { float a; };
88
class agg_float_class pass_agg_float_class(class agg_float_class arg) { return arg; }
99
// CHECK-LABEL: define{{.*}} void @_Z20pass_agg_float_class15agg_float_class(ptr dead_on_unwind noalias writable sret(%class.agg_float_class) align 4 %{{.*}}, float %{{.*}})
10-
// SOFT-FLOAT-LABEL: define{{.*}} void @_Z20pass_agg_float_class15agg_float_class(ptr dead_on_unwind noalias writable sret(%class.agg_float_class) align 4 %{{.*}}, i32 %{{.*}})
11-
// SOFT-FLOAT-LABEL: define{{.*}} void @_Z20pass_agg_float_class15agg_float_class(ptr noalias sret(%class.agg_float_class) align 4 %{{.*}}, i32 noext%{{.*}})
10+
// SOFT-FLOAT-LABEL: define{{.*}} void @_Z20pass_agg_float_class15agg_float_class(ptr dead_on_unwind noalias writable sret(%class.agg_float_class) align 4 %{{.*}}, i32 noext %{{.*}})
1211

1312
class agg_double_class { double a; };
1413
class agg_double_class pass_agg_double_class(class agg_double_class arg) { return arg; }
@@ -19,9 +18,8 @@ class agg_double_class pass_agg_double_class(class agg_double_class arg) { retur
1918
// This structure is passed in a GPR in C++ (and C, checked in systemz-abi.c).
2019
struct agg_float_cpp { float a; int : 0; };
2120
struct agg_float_cpp pass_agg_float_cpp(struct agg_float_cpp arg) { return arg; }
22-
// CHECK-LABEL: define{{.*}} void @_Z18pass_agg_float_cpp13agg_float_cpp(ptr dead_on_unwind noalias writable sret(%struct.agg_float_cpp) align 4 %{{.*}}, i32 %{{.*}})
23-
// SOFT-FLOAT-LABEL: define{{.*}} void @_Z18pass_agg_float_cpp13agg_float_cpp(ptr dead_on_unwind noalias writable sret(%struct.agg_float_cpp) align 4 %{{.*}}, i32 %{{.*}})
24-
// SOFT-FLOAT-LABEL: define{{.*}} void @_Z18pass_agg_float_cpp13agg_float_cpp(ptr noalias sret(%struct.agg_float_cpp) align 4 %{{.*}}, i32 noext %{{.*}})
21+
// CHECK-LABEL: define{{.*}} void @_Z18pass_agg_float_cpp13agg_float_cpp(ptr dead_on_unwind noalias writable sret(%struct.agg_float_cpp) align 4 %{{.*}}, i32 noext %{{.*}})
22+
// SOFT-FLOAT-LABEL: define{{.*}} void @_Z18pass_agg_float_cpp13agg_float_cpp(ptr dead_on_unwind noalias writable sret(%struct.agg_float_cpp) align 4 %{{.*}}, i32 noext %{{.*}})
2523

2624

2725
// A field member of empty class type in C++ makes the record nonhomogeneous,
@@ -34,8 +32,7 @@ struct agg_nofloat_empty pass_agg_nofloat_empty(struct agg_nofloat_empty arg) {
3432
struct agg_float_empty { float a; [[no_unique_address]] empty dummy; };
3533
struct agg_float_empty pass_agg_float_empty(struct agg_float_empty arg) { return arg; }
3634
// CHECK-LABEL: define{{.*}} void @_Z20pass_agg_float_empty15agg_float_empty(ptr dead_on_unwind noalias writable sret(%struct.agg_float_empty) align 4 %{{.*}}, float %{{.*}})
37-
// SOFT-FLOAT-LABEL: define{{.*}} void @_Z20pass_agg_float_empty15agg_float_empty(ptr dead_on_unwind noalias writable sret(%struct.agg_float_empty) align 4 %{{.*}}, i32 %{{.*}})
38-
// SOFT-FLOAT-LABEL: define{{.*}} void @_Z20pass_agg_float_empty15agg_float_empty(ptr noalias sret(%struct.agg_float_empty) align 4 %{{.*}}, i32 noext %{{.*}})
35+
// SOFT-FLOAT-LABEL: define{{.*}} void @_Z20pass_agg_float_empty15agg_float_empty(ptr dead_on_unwind noalias writable sret(%struct.agg_float_empty) align 4 %{{.*}}, i32 noext %{{.*}})
3936
struct agg_nofloat_emptyarray { float a; [[no_unique_address]] empty dummy[3]; };
4037
struct agg_nofloat_emptyarray pass_agg_nofloat_emptyarray(struct agg_nofloat_emptyarray arg) { return arg; }
4138
// CHECK-LABEL: define{{.*}} void @_Z27pass_agg_nofloat_emptyarray22agg_nofloat_emptyarray(ptr dead_on_unwind noalias writable sret(%struct.agg_nofloat_emptyarray) align 4 %{{.*}}, i64 %{{.*}})
@@ -51,8 +48,7 @@ struct emptybase { [[no_unique_address]] empty dummy; };
5148
struct agg_float_emptybase : emptybase { float a; };
5249
struct agg_float_emptybase pass_agg_float_emptybase(struct agg_float_emptybase arg) { return arg; }
5350
// CHECK-LABEL: define{{.*}} void @_Z24pass_agg_float_emptybase19agg_float_emptybase(ptr dead_on_unwind noalias writable sret(%struct.agg_float_emptybase) align 4 %{{.*}}, float %{{.*}})
54-
// SOFT-FLOAT-LABEL: define{{.*}} void @_Z24pass_agg_float_emptybase19agg_float_emptybase(ptr dead_on_unwind noalias writable sret(%struct.agg_float_emptybase) align 4 %{{.*}}, i32 %{{.*}})
55-
// SOFT-FLOAT-LABEL: define{{.*}} void @_Z24pass_agg_float_emptybase19agg_float_emptybase(ptr noalias sret(%struct.agg_float_emptybase) align 4 %{{.*}}, i32 noext %{{.*}})
51+
// SOFT-FLOAT-LABEL: define{{.*}} void @_Z24pass_agg_float_emptybase19agg_float_emptybase(ptr dead_on_unwind noalias writable sret(%struct.agg_float_emptybase) align 4 %{{.*}}, i32 noext %{{.*}})
5652
struct noemptybasearray { [[no_unique_address]] empty dummy[3]; };
5753
struct agg_nofloat_emptybasearray : noemptybasearray { float a; };
5854
struct agg_nofloat_emptybasearray pass_agg_nofloat_emptybasearray(struct agg_nofloat_emptybasearray arg) { return arg; }

llvm/include/llvm/Bitcode/LLVMBitCodes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,9 +757,9 @@ enum AttributeKindCodes {
757757
ATTR_KIND_RANGE = 92,
758758
ATTR_KIND_SANITIZE_NUMERICAL_STABILITY = 93,
759759
ATTR_KIND_INITIALIZES = 94,
760-
ATTR_KIND_NO_EXT = 93, XXX
761760
ATTR_KIND_HYBRID_PATCHABLE = 95,
762-
};
761+
ATTR_KIND_NO_EXT = 96,
762+
};
763763

764764
enum ComdatSelectionKindCodes {
765765
COMDAT_SELECTION_KIND_ANY = 1,

llvm/lib/Bitcode/Reader/BitcodeReader.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2171,8 +2171,6 @@ static Attribute::AttrKind getAttrFromCode(uint64_t Code) {
21712171
return Attribute::ByRef;
21722172
case bitc::ATTR_KIND_MUSTPROGRESS:
21732173
return Attribute::MustProgress;
2174-
case bitc::ATTR_KIND_NO_EXT:
2175-
return Attribute::NoExt;
21762174
case bitc::ATTR_KIND_HOT:
21772175
return Attribute::Hot;
21782176
case bitc::ATTR_KIND_PRESPLIT_COROUTINE:
@@ -2187,6 +2185,8 @@ static Attribute::AttrKind getAttrFromCode(uint64_t Code) {
21872185
return Attribute::Range;
21882186
case bitc::ATTR_KIND_INITIALIZES:
21892187
return Attribute::Initializes;
2188+
case bitc::ATTR_KIND_NO_EXT:
2189+
return Attribute::NoExt;
21902190
}
21912191
}
21922192

llvm/lib/Bitcode/Writer/BitcodeWriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ static uint64_t getAttrKindEncoding(Attribute::AttrKind Kind) {
885885
return bitc::ATTR_KIND_RANGE;
886886
case Attribute::Initializes:
887887
return bitc::ATTR_KIND_INITIALIZES;
888-
case Attribute::NoExt: XXX right place?
888+
case Attribute::NoExt:
889889
return bitc::ATTR_KIND_NO_EXT;
890890
case Attribute::EndAttrKinds:
891891
llvm_unreachable("Can not encode end-attribute kinds marker.");

llvm/lib/Target/SystemZ/SystemZISelLowering.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ using namespace llvm;
3434

3535
#define DEBUG_TYPE "systemz-lower"
3636

37-
static cl::opt<bool> VerifyIntArgExtensions(
38-
"int-arg-ext-ver", cl::init(true),
39-
cl::desc("Verify that narrow int args are properly extended per the ABI."),
40-
cl::Hidden);
37+
static cl::opt<bool> DisableIntArgExtCheck(
38+
"no-argext-abi-check", cl::init(false),
39+
cl::desc("Do not verify that narrow int args are properly extended per the "
40+
"SystemZ ABI."));
4141

4242
namespace {
4343
// Represents information about a comparison.
@@ -1483,13 +1483,13 @@ static void VerifyIntegerArg(MVT VT, ISD::ArgFlagsTy Flags) {
14831483
"Unexpected integer argument VT.");
14841484
assert((VT != MVT::i32 ||
14851485
(Flags.isSExt() || Flags.isZExt() || Flags.isNoExt())) &&
1486-
"Narrow integer without valid extension type! [-int-arg-ext-ver]");
1486+
"Narrow integer argument must have a valid extension type.");
14871487
}
14881488
}
14891489

14901490
// Verify that narrow integer arguments are extended as required by the ABI.
14911491
static void CheckNarrowIntegerArgs(SmallVectorImpl<ISD::OutputArg> &Outs) {
1492-
if (VerifyIntArgExtensions) {
1492+
if (!DisableIntArgExtCheck) {
14931493
for (unsigned i = 0; i < Outs.size(); ++i)
14941494
VerifyIntegerArg(Outs[i].VT, Outs[i].Flags);
14951495
return;

llvm/lib/Transforms/Utils/CodeExtractor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,6 @@ Function *CodeExtractor::constructFunction(const ValueSet &inputs,
984984
case Attribute::Nest:
985985
case Attribute::NoAlias:
986986
case Attribute::NoCapture:
987-
case Attribute::NoExt:
988987
case Attribute::NoUndef:
989988
case Attribute::NonNull:
990989
case Attribute::Preallocated:
@@ -1004,6 +1003,7 @@ Function *CodeExtractor::constructFunction(const ValueSet &inputs,
10041003
case Attribute::DeadOnUnwind:
10051004
case Attribute::Range:
10061005
case Attribute::Initializes:
1006+
case Attribute::NoExt:
10071007
// These are not really attributes.
10081008
case Attribute::None:
10091009
case Attribute::EndAttrKinds:

0 commit comments

Comments
 (0)