Skip to content

Commit e16a84a

Browse files
authored
merge main into amd-staging (llvm#1040)
2 parents e51b3fe + 5c2a2b8 commit e16a84a

File tree

73 files changed

+5299
-748
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+5299
-748
lines changed

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,24 @@ static void emitSincosBuiltin(CodeGenFunction &CGF, const CallExpr *E,
859859
StoreCos->setMetadata(LLVMContext::MD_noalias, AliasScopeList);
860860
}
861861

862+
static llvm::Value *emitModfBuiltin(CodeGenFunction &CGF, const CallExpr *E,
863+
llvm::Intrinsic::ID IntrinsicID) {
864+
llvm::Value *Val = CGF.EmitScalarExpr(E->getArg(0));
865+
llvm::Value *IntPartDest = CGF.EmitScalarExpr(E->getArg(1));
866+
867+
llvm::Value *Call =
868+
CGF.Builder.CreateIntrinsic(IntrinsicID, {Val->getType()}, Val);
869+
870+
llvm::Value *FractionalResult = CGF.Builder.CreateExtractValue(Call, 0);
871+
llvm::Value *IntegralResult = CGF.Builder.CreateExtractValue(Call, 1);
872+
873+
QualType DestPtrType = E->getArg(1)->getType()->getPointeeType();
874+
LValue IntegralLV = CGF.MakeNaturalAlignAddrLValue(IntPartDest, DestPtrType);
875+
CGF.EmitStoreOfScalar(IntegralResult, IntegralLV);
876+
877+
return FractionalResult;
878+
}
879+
862880
/// EmitFAbs - Emit a call to @llvm.fabs().
863881
static Value *EmitFAbs(CodeGenFunction &CGF, Value *V) {
864882
Function *F = CGF.CGM.getIntrinsic(Intrinsic::fabs, V->getType());
@@ -4120,6 +4138,15 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
41204138
case Builtin::BI__builtin_frexpf128:
41214139
case Builtin::BI__builtin_frexpf16:
41224140
return RValue::get(emitFrexpBuiltin(*this, E, Intrinsic::frexp));
4141+
case Builtin::BImodf:
4142+
case Builtin::BImodff:
4143+
case Builtin::BImodfl:
4144+
case Builtin::BI__builtin_modf:
4145+
case Builtin::BI__builtin_modff:
4146+
case Builtin::BI__builtin_modfl:
4147+
if (Builder.getIsFPConstrained())
4148+
break; // TODO: Emit constrained modf intrinsic once one exists.
4149+
return RValue::get(emitModfBuiltin(*this, E, Intrinsic::modf));
41234150
case Builtin::BI__builtin_isgreater:
41244151
case Builtin::BI__builtin_isgreaterequal:
41254152
case Builtin::BI__builtin_isless:

clang/lib/CodeGen/Targets/X86.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3390,6 +3390,9 @@ ABIArgInfo WinX86_64ABIInfo::classify(QualType Ty, unsigned &FreeSSERegs,
33903390

33913391
case BuiltinType::Int128:
33923392
case BuiltinType::UInt128:
3393+
case BuiltinType::Float128:
3394+
// 128-bit float and integer types share the same ABI.
3395+
33933396
// If it's a parameter type, the normal ABI rule is that arguments larger
33943397
// than 8 bytes are passed indirectly. GCC follows it. We follow it too,
33953398
// even though it isn't particularly efficient.
@@ -3400,6 +3403,8 @@ ABIArgInfo WinX86_64ABIInfo::classify(QualType Ty, unsigned &FreeSSERegs,
34003403

34013404
// Mingw64 GCC returns i128 in XMM0. Coerce to v2i64 to handle that.
34023405
// Clang matches them for compatibility.
3406+
// NOTE: GCC actually returns f128 indirectly but will hopefully change.
3407+
// See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115054#c8.
34033408
return ABIArgInfo::getDirect(llvm::FixedVectorType::get(
34043409
llvm::Type::getInt64Ty(getVMContext()), 2));
34053410

clang/test/CodeGen/X86/math-builtins.c

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,24 @@ void foo(double *d, float f, float *fp, long double *l, int *i, const char *c) {
3838
// NO__ERRNO-NEXT: [[FREXP_F128_0:%.+]] = extractvalue { fp128, i32 } [[FREXP_F128]], 0
3939

4040

41+
// NO__ERRNO: [[MODF_F64:%.+]] = call { double, double } @llvm.modf.f64(double %{{.+}})
42+
// NO__ERRNO-NEXT: [[MODF_F64_FP:%.+]] = extractvalue { double, double } [[MODF_F64]], 0
43+
// NO__ERRNO-NEXT: [[MODF_F64_IP:%.+]] = extractvalue { double, double } [[MODF_F64]], 1
44+
// NO__ERRNO-NEXT: store double [[MODF_F64_IP]], ptr %{{.+}}, align 8
45+
46+
// NO__ERRNO: [[MODF_F32:%.+]] = call { float, float } @llvm.modf.f32(float %{{.+}})
47+
// NO__ERRNO-NEXT: [[MODF_F32_FP:%.+]] = extractvalue { float, float } [[MODF_F32]], 0
48+
// NO__ERRNO-NEXT: [[MODF_F32_IP:%.+]] = extractvalue { float, float } [[MODF_F32]], 1
49+
// NO__ERRNO-NEXT: store float [[MODF_F32_IP]], ptr %{{.+}}, align 4
50+
51+
// NO__ERRNO: [[MODF_F80:%.+]] = call { x86_fp80, x86_fp80 } @llvm.modf.f80(x86_fp80 %{{.+}})
52+
// NO__ERRNO-NEXT: [[MODF_F80_FP:%.+]] = extractvalue { x86_fp80, x86_fp80 } [[MODF_F80]], 0
53+
// NO__ERRNO-NEXT: [[MODF_F80_IP:%.+]] = extractvalue { x86_fp80, x86_fp80 } [[MODF_F80]], 1
54+
// NO__ERRNO-NEXT: store x86_fp80 [[MODF_F80_IP]], ptr %{{.+}}, align 16
55+
56+
// NO__ERRNO: call fp128 @modff128(fp128 noundef %{{.+}}, ptr noundef %{{.+}})
57+
58+
4159
// NO__ERRNO: [[SINCOS_F64:%.+]] = call { double, double } @llvm.sincos.f64(double %{{.+}})
4260
// NO__ERRNO-NEXT: [[SINCOS_F64_0:%.+]] = extractvalue { double, double } [[SINCOS_F64]], 0
4361
// NO__ERRNO-NEXT: [[SINCOS_F64_1:%.+]] = extractvalue { double, double } [[SINCOS_F64]], 1
@@ -158,13 +176,13 @@ void foo(double *d, float f, float *fp, long double *l, int *i, const char *c) {
158176

159177
__builtin_modf(f,d); __builtin_modff(f,fp); __builtin_modfl(f,l); __builtin_modff128(f,l);
160178

161-
// NO__ERRNO: declare double @modf(double noundef, ptr noundef) [[NOT_READNONE:#[0-9]+]]
162-
// NO__ERRNO: declare float @modff(float noundef, ptr noundef) [[NOT_READNONE]]
163-
// NO__ERRNO: declare x86_fp80 @modfl(x86_fp80 noundef, ptr noundef) [[NOT_READNONE]]
164-
// NO__ERRNO: declare fp128 @modff128(fp128 noundef, ptr noundef) [[NOT_READNONE]]
165-
// HAS_ERRNO: declare double @modf(double noundef, ptr noundef) [[NOT_READNONE]]
166-
// HAS_ERRNO: declare float @modff(float noundef, ptr noundef) [[NOT_READNONE]]
167-
// HAS_ERRNO: declare x86_fp80 @modfl(x86_fp80 noundef, ptr noundef) [[NOT_READNONE]]
179+
// NO__ERRNO: declare { double, double } @llvm.modf.f64(double) [[READNONE_INTRINSIC]]
180+
// NO__ERRNO: declare { float, float } @llvm.modf.f32(float) [[READNONE_INTRINSIC]]
181+
// NO__ERRNO: declare { x86_fp80, x86_fp80 } @llvm.modf.f80(x86_fp80) [[READNONE_INTRINSIC]]
182+
// NO__ERRNO: declare fp128 @modff128(fp128 noundef, ptr noundef) [[NOT_READNONE:#[0-9]+]]
183+
// HAS_ERRNO: declare { double, double } @llvm.modf.f64(double) [[READNONE_INTRINSIC]]
184+
// HAS_ERRNO: declare { float, float } @llvm.modf.f32(float) [[READNONE_INTRINSIC]]
185+
// HAS_ERRNO: declare { x86_fp80, x86_fp80 } @llvm.modf.f80(x86_fp80) [[READNONE_INTRINSIC]]
168186
// HAS_ERRNO: declare fp128 @modff128(fp128 noundef, ptr noundef) [[NOT_READNONE]]
169187

170188
__builtin_nan(c); __builtin_nanf(c); __builtin_nanl(c); __builtin_nanf128(c);

clang/test/CodeGen/aix-builtin-mapping.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ int main()
1717
returnValue = __builtin_ldexpl(1.0L, 1);
1818
}
1919

20-
// CHECK: %call = call double @modf(double noundef 1.000000e+00, ptr noundef %DummyLongDouble) #3
20+
// CHECK: %{{.+}} = call { double, double } @llvm.modf.f64(double 1.000000e+00)
2121
// CHECK: %{{.+}} = call { double, i32 } @llvm.frexp.f64.i32(double 0.000000e+00)
2222
// CHECK: %{{.+}} = call double @llvm.ldexp.f64.i32(double 1.000000e+00, i32 1)

clang/test/CodeGen/assignment-tracking/assignment-tracking.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,24 @@ Large L;
2020
void zeroInit() { int Z[3] = {0, 0, 0}; }
2121
// CHECK-LABEL: define dso_local void @_Z8zeroInitv
2222
// CHECK: %Z = alloca [3 x i32], align 4, !DIAssignID ![[ID_0:[0-9]+]]
23-
// CHECK-NEXT: #dbg_assign(i1 undef, ![[VAR_0:[0-9]+]], !DIExpression(), ![[ID_0]], ptr %Z, !DIExpression(),
23+
// CHECK-NEXT: #dbg_assign(i1 poison, ![[VAR_0:[0-9]+]], !DIExpression(), ![[ID_0]], ptr %Z, !DIExpression(),
2424
// CHECK: @llvm.memset{{.*}}, !DIAssignID ![[ID_1:[0-9]+]]
2525
// CHECK-NEXT: #dbg_assign(i8 0, ![[VAR_0]], !DIExpression(), ![[ID_1]], ptr %Z, !DIExpression(),
2626

2727
void memcpyInit() { int A[4] = {0, 1, 2, 3}; }
2828
// CHECK-LABEL: define dso_local void @_Z10memcpyInitv
2929
// CHECK: %A = alloca [4 x i32], align 16, !DIAssignID ![[ID_2:[0-9]+]]
30-
// CHECK-NEXT: #dbg_assign(i1 undef, ![[VAR_1:[0-9]+]], !DIExpression(), ![[ID_2]], ptr %A, !DIExpression(),
30+
// CHECK-NEXT: #dbg_assign(i1 poison, ![[VAR_1:[0-9]+]], !DIExpression(), ![[ID_2]], ptr %A, !DIExpression(),
3131
// CHECK: @llvm.memcpy{{.*}}, !DIAssignID ![[ID_3:[0-9]+]]
32-
// CHECK-NEXT: #dbg_assign(i1 undef, ![[VAR_1]], !DIExpression(), ![[ID_3]], ptr %A, !DIExpression(),
32+
// CHECK-NEXT: #dbg_assign(i1 poison, ![[VAR_1]], !DIExpression(), ![[ID_3]], ptr %A, !DIExpression(),
3333

3434
void setField() {
3535
Outer O;
3636
O.A.B = Value;
3737
}
3838
// CHECK-LABEL: define dso_local void @_Z8setFieldv
3939
// CHECK: %O = alloca %struct.Outer, align 4, !DIAssignID ![[ID_4:[0-9]+]]
40-
// CHECK-NEXT: #dbg_assign(i1 undef, ![[VAR_2:[0-9]+]], !DIExpression(), ![[ID_4]], ptr %O, !DIExpression(),
40+
// CHECK-NEXT: #dbg_assign(i1 poison, ![[VAR_2:[0-9]+]], !DIExpression(), ![[ID_4]], ptr %O, !DIExpression(),
4141
// CHECK: store i32 %0, ptr %B, align 4,{{.*}}!DIAssignID ![[ID_5:[0-9]+]]
4242
// CHECK-NEXT: #dbg_assign(i32 %0, ![[VAR_2]], !DIExpression(DW_OP_LLVM_fragment, 32, 32), ![[ID_5]], ptr %B, !DIExpression(),
4343

@@ -47,7 +47,7 @@ void unknownOffset() {
4747
}
4848
// CHECK-LABEL: define dso_local void @_Z13unknownOffsetv
4949
// CHECK: %A = alloca [2 x i32], align 4, !DIAssignID ![[ID_6:[0-9]+]]
50-
// CHECK-NEXT: #dbg_assign(i1 undef, ![[VAR_3:[0-9]+]], !DIExpression(), ![[ID_6]], ptr %A, !DIExpression(),
50+
// CHECK-NEXT: #dbg_assign(i1 poison, ![[VAR_3:[0-9]+]], !DIExpression(), ![[ID_6]], ptr %A, !DIExpression(),
5151

5252
Inner sharedAlloca() {
5353
if (Cond) {
@@ -60,16 +60,16 @@ Inner sharedAlloca() {
6060
}
6161
// CHECK-LABEL: define dso_local i64 @_Z12sharedAllocav
6262
// CHECK: %retval = alloca %struct.Inner, align 4, !DIAssignID ![[ID_7:[0-9]+]]
63-
// CHECK-NEXT: #dbg_assign(i1 undef, ![[VAR_4:[0-9]+]], !DIExpression(), ![[ID_7]], ptr %retval, !DIExpression(),
64-
// CHECK-NEXT: #dbg_assign(i1 undef, ![[VAR_5:[0-9]+]], !DIExpression(), ![[ID_7]], ptr %retval, !DIExpression(),
63+
// CHECK-NEXT: #dbg_assign(i1 poison, ![[VAR_4:[0-9]+]], !DIExpression(), ![[ID_7]], ptr %retval, !DIExpression(),
64+
// CHECK-NEXT: #dbg_assign(i1 poison, ![[VAR_5:[0-9]+]], !DIExpression(), ![[ID_7]], ptr %retval, !DIExpression(),
6565
// CHECK: if.then:
6666
// CHECK: call void @llvm.memcpy{{.*}}, !DIAssignID ![[ID_8:[0-9]+]]
67-
// CHECK-NEXT: #dbg_assign(i1 undef, ![[VAR_4]], !DIExpression(), ![[ID_8]], ptr %retval, !DIExpression(),
68-
// CHECK-NEXT: #dbg_assign(i1 undef, ![[VAR_5]], !DIExpression(), ![[ID_8]], ptr %retval, !DIExpression(),
67+
// CHECK-NEXT: #dbg_assign(i1 poison, ![[VAR_4]], !DIExpression(), ![[ID_8]], ptr %retval, !DIExpression(),
68+
// CHECK-NEXT: #dbg_assign(i1 poison, ![[VAR_5]], !DIExpression(), ![[ID_8]], ptr %retval, !DIExpression(),
6969
// CHECK: if.else:
7070
// CHECK: call void @llvm.memcpy{{.*}}, !DIAssignID ![[ID_9:[0-9]+]]
71-
// CHECK-NEXT: #dbg_assign(i1 undef, ![[VAR_4]], !DIExpression(), ![[ID_9]], ptr %retval, !DIExpression(),
72-
// CHECK-NEXT: #dbg_assign(i1 undef, ![[VAR_5]], !DIExpression(), ![[ID_9]], ptr %retval, !DIExpression(),
71+
// CHECK-NEXT: #dbg_assign(i1 poison, ![[VAR_4]], !DIExpression(), ![[ID_9]], ptr %retval, !DIExpression(),
72+
// CHECK-NEXT: #dbg_assign(i1 poison, ![[VAR_5]], !DIExpression(), ![[ID_9]], ptr %retval, !DIExpression(),
7373

7474
Large sret() {
7575
Large X = L;

clang/test/CodeGen/assignment-tracking/memcpy-fragment.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ void fragmentWhole()
2323
__builtin_memcpy(&dest.ch, &src, sizeof(char));
2424
}
2525
// CHECK: call void @llvm.memcpy{{.+}}, !DIAssignID ![[memberID:[0-9]+]]
26-
// CHECK-NEXT: #dbg_assign({{.*}}undef, !{{[0-9]+}}, !DIExpression(DW_OP_LLVM_fragment, 32, 8), ![[memberID]], ptr %ch, !DIExpression(),
26+
// CHECK-NEXT: #dbg_assign({{.*}}poison, !{{[0-9]+}}, !DIExpression(DW_OP_LLVM_fragment, 32, 8), ![[memberID]], ptr %ch, !DIExpression(),
2727

2828
// Write starting at a field and overlapping part of another.
2929
void fragmentWholeToPartial()
@@ -38,7 +38,7 @@ void fragmentWholeToPartial()
3838
__builtin_memcpy(&dest.num1, &src, 5);
3939
}
4040
// CHECK: call void @llvm.memcpy{{.+}}, !DIAssignID ![[exceed:[0-9]+]]
41-
// CHECK-NEXT: #dbg_assign({{.*}}undef, !{{[0-9]+}}, !DIExpression(DW_OP_LLVM_fragment, 0, 40), ![[exceed]], ptr %num1, !DIExpression(),
41+
// CHECK-NEXT: #dbg_assign({{.*}}poison, !{{[0-9]+}}, !DIExpression(DW_OP_LLVM_fragment, 0, 40), ![[exceed]], ptr %num1, !DIExpression(),
4242

4343
// Write starting between fields.
4444
void fragmentPartialToWhole()
@@ -54,4 +54,4 @@ void fragmentPartialToWhole()
5454
__builtin_memcpy((char*)&(dest.num2) + 3, &src, 5);
5555
}
5656
// CHECK: call void @llvm.memcpy{{.+}}, !DIAssignID ![[addendID:[0-9]+]]
57-
// CHECK-NEXT: #dbg_assign({{.*}}undef, !{{.*}}, !DIExpression(DW_OP_LLVM_fragment, 56, 40), ![[addendID]], ptr %add.ptr, !DIExpression(),
57+
// CHECK-NEXT: #dbg_assign({{.*}}poison, !{{.*}}, !DIExpression(DW_OP_LLVM_fragment, 56, 40), ![[addendID]], ptr %add.ptr, !DIExpression(),

clang/test/CodeGen/builtin-attributes.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ char* f2(char* a, char* b) {
2424
return __builtin_strstr(a, b);
2525
}
2626

27+
// Note: Use asm label to disable intrinsic lowering of modf.
28+
double modf(double x, double*) asm("modf");
29+
float modff(float x, float*) asm("modff");
30+
long double modfl(long double x, long double*) asm("modfl");
31+
2732
// frexp is NOT readnone. It writes to its pointer argument.
2833
//
2934
// CHECK: f3
@@ -55,9 +60,9 @@ int f3(double x) {
5560
frexp(x, &e);
5661
frexpf(x, &e);
5762
frexpl(x, &e);
58-
__builtin_modf(x, &e);
59-
__builtin_modff(x, &e);
60-
__builtin_modfl(x, &e);
63+
modf(x, &e);
64+
modff(x, &e);
65+
modfl(x, &e);
6166
__builtin_remquo(x, x, &e);
6267
__builtin_remquof(x, x, &e);
6368
__builtin_remquol(x, x, &e);

clang/test/CodeGen/math-builtins-long.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ void foo(long double f, long double *l, int *i, const char *c) {
5858
// PPCF128: call fp128 @ldexpf128(fp128 noundef %{{.+}}, {{(signext)?.+}})
5959
__builtin_ldexpl(f,f);
6060

61-
// F80: call x86_fp80 @modfl(x86_fp80 noundef %{{.+}}, ptr noundef %{{.+}})
62-
// PPC: call ppc_fp128 @modfl(ppc_fp128 noundef %{{.+}}, ptr noundef %{{.+}})
63-
// X86F128: call fp128 @modfl(fp128 noundef %{{.+}}, ptr noundef %{{.+}})
61+
// F80: call { x86_fp80, x86_fp80 } @llvm.modf.f80(x86_fp80 %{{.+}})
62+
// PPC: call { ppc_fp128, ppc_fp128 } @llvm.modf.ppcf128(ppc_fp128 %{{.+}})
63+
// X86F128: call { fp128, fp128 } @llvm.modf.f128(fp128 %{{.+}})
6464
// PPCF128: call fp128 @modff128(fp128 noundef %{{.+}}, ptr noundef %{{.+}})
6565
__builtin_modfl(f,l);
6666

clang/test/CodeGen/math-libcalls.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ void foo(double *d, float f, float *fp, long double *l, int *i, const char *c) {
8383

8484
modf(f,d); modff(f,fp); modfl(f,l);
8585

86-
// NO__ERRNO: declare double @modf(double noundef, ptr noundef) [[NOT_READNONE]]
87-
// NO__ERRNO: declare float @modff(float noundef, ptr noundef) [[NOT_READNONE]]
88-
// NO__ERRNO: declare x86_fp80 @modfl(x86_fp80 noundef, ptr noundef) [[NOT_READNONE]]
89-
// HAS_ERRNO: declare double @modf(double noundef, ptr noundef) [[NOT_READNONE]]
90-
// HAS_ERRNO: declare float @modff(float noundef, ptr noundef) [[NOT_READNONE]]
91-
// HAS_ERRNO: declare x86_fp80 @modfl(x86_fp80 noundef, ptr noundef) [[NOT_READNONE]]
86+
// NO__ERRNO: declare { double, double } @llvm.modf.f64(double) [[READNONE_INTRINSIC]]
87+
// NO__ERRNO: declare { float, float } @llvm.modf.f32(float) [[READNONE_INTRINSIC]]
88+
// NO__ERRNO: declare { x86_fp80, x86_fp80 } @llvm.modf.f80(x86_fp80) [[READNONE_INTRINSIC]]
89+
// HAS_ERRNO: declare { double, double } @llvm.modf.f64(double) [[READNONE_INTRINSIC]]
90+
// HAS_ERRNO: declare { float, float } @llvm.modf.f32(float) [[READNONE_INTRINSIC]]
91+
// HAS_ERRNO: declare { x86_fp80, x86_fp80 } @llvm.modf.f80(x86_fp80) [[READNONE_INTRINSIC]]
9292
// HAS_MAYTRAP: declare double @modf(double noundef, ptr noundef) [[NOT_READNONE]]
9393
// HAS_MAYTRAP: declare float @modff(float noundef, ptr noundef) [[NOT_READNONE]]
9494
// HAS_MAYTRAP: declare x86_fp80 @modfl(x86_fp80 noundef, ptr noundef) [[NOT_READNONE]]

clang/test/CodeGen/win-fp128.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// RUN: %clang_cc1 -triple x86_64-windows-gnu -emit-llvm -o - %s \
2+
// RUN: | FileCheck %s --check-prefix=CHECK-GNU64
3+
// __float128 is unsupported on MSVC
4+
5+
__float128 fp128_ret(void) { return 0; }
6+
// CHECK-GNU64: define dso_local <2 x i64> @fp128_ret()
7+
8+
__float128 fp128_args(__float128 a, __float128 b) { return a * b; }
9+
// CHECK-GNU64: define dso_local <2 x i64> @fp128_args(ptr noundef %0, ptr noundef %1)
10+
11+
void fp128_vararg(int a, ...) {
12+
// CHECK-GNU64-LABEL: define dso_local void @fp128_vararg
13+
__builtin_va_list ap;
14+
__builtin_va_start(ap, a);
15+
__float128 i = __builtin_va_arg(ap, __float128);
16+
// CHECK-GNU64: load ptr, ptr
17+
// CHECK-GNU64: load fp128, ptr
18+
__builtin_va_end(ap);
19+
}

lldb/test/API/lit.cfg.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,9 @@ def delete_module_cache(path):
179179
elif lldb_use_simulator == "tvos":
180180
lit_config.note("Running API tests on tvOS simulator")
181181
config.available_features.add("lldb-simulator-tvos")
182+
elif lldb_use_simulator == "qemu-user":
183+
lit_config.note("Running API tests on qemu-user simulator")
184+
config.available_features.add("lldb-simulator-qemu-user")
182185
else:
183186
lit_config.error("Unknown simulator id '{}'".format(lldb_use_simulator))
184187

@@ -285,6 +288,9 @@ def delete_module_cache(path):
285288
"tvos-simulator",
286289
]
287290

291+
if "lldb-simulator-qemu-user" in config.available_features:
292+
dotest_cmd += ["--platform-name", "qemu-user"]
293+
288294
if is_configured("enabled_plugins"):
289295
for plugin in config.enabled_plugins:
290296
dotest_cmd += ["--enable-plugin", plugin]

llvm/docs/ReleaseNotes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ Changes to the WebAssembly Backend
122122
Changes to the Windows Target
123123
-----------------------------
124124

125+
* `fp128` is now passed indirectly, meaning it uses the same calling convention
126+
as `i128`.
127+
125128
Changes to the X86 Backend
126129
--------------------------
127130

llvm/examples/Kaleidoscope/Chapter8/toy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1225,7 +1225,7 @@ int main() {
12251225
InitializeAllAsmPrinters();
12261226

12271227
auto TargetTriple = sys::getDefaultTargetTriple();
1228-
TheModule->setTargetTriple(TargetTriple);
1228+
TheModule->setTargetTriple(Triple(TargetTriple));
12291229

12301230
std::string Error;
12311231
auto Target = TargetRegistry::lookupTarget(TargetTriple, Error);

llvm/lib/AsmParser/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ add_llvm_component_library(LLVMAsmParser
1414
BinaryFormat
1515
Core
1616
Support
17+
TargetParser
1718
)

llvm/lib/IR/DebugInfo.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2177,8 +2177,8 @@ void at::trackAssignments(Function::iterator Start, Function::iterator End,
21772177
auto &Ctx = Start->getContext();
21782178
auto &Module = *Start->getModule();
21792179

2180-
// Undef type doesn't matter, so long as it isn't void. Let's just use i1.
2181-
auto *Undef = UndefValue::get(Type::getInt1Ty(Ctx));
2180+
// Poison type doesn't matter, so long as it isn't void. Let's just use i1.
2181+
auto *Poison = PoisonValue::get(Type::getInt1Ty(Ctx));
21822182
DIBuilder DIB(Module, /*AllowUnresolved*/ false);
21832183

21842184
// Scan the instructions looking for stores to local variables' storage.
@@ -2192,9 +2192,9 @@ void at::trackAssignments(Function::iterator Start, Function::iterator End,
21922192
if (auto *AI = dyn_cast<AllocaInst>(&I)) {
21932193
// We want to track the variable's stack home from its alloca's
21942194
// position onwards so we treat it as an assignment (where the stored
2195-
// value is Undef).
2195+
// value is poison).
21962196
Info = getAssignmentInfo(DL, AI);
2197-
ValueComponent = Undef;
2197+
ValueComponent = Poison;
21982198
DestComponent = AI;
21992199
} else if (auto *SI = dyn_cast<StoreInst>(&I)) {
22002200
Info = getAssignmentInfo(DL, SI);
@@ -2203,7 +2203,7 @@ void at::trackAssignments(Function::iterator Start, Function::iterator End,
22032203
} else if (auto *MI = dyn_cast<MemTransferInst>(&I)) {
22042204
Info = getAssignmentInfo(DL, MI);
22052205
// May not be able to represent this value easily.
2206-
ValueComponent = Undef;
2206+
ValueComponent = Poison;
22072207
DestComponent = MI->getOperand(0);
22082208
} else if (auto *MI = dyn_cast<MemSetInst>(&I)) {
22092209
Info = getAssignmentInfo(DL, MI);
@@ -2213,7 +2213,7 @@ void at::trackAssignments(Function::iterator Start, Function::iterator End,
22132213
if (ConstValue && ConstValue->isZero())
22142214
ValueComponent = ConstValue;
22152215
else
2216-
ValueComponent = Undef;
2216+
ValueComponent = Poison;
22172217
DestComponent = MI->getOperand(0);
22182218
} else {
22192219
// Not a store-like instruction.

0 commit comments

Comments
 (0)