Skip to content

Commit 931f0c4

Browse files
author
z1_cciauto
authored
merge main into amd-staging (llvm#2361)
2 parents a5f3740 + 28856fe commit 931f0c4

File tree

76 files changed

+1423
-945
lines changed

Some content is hidden

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

76 files changed

+1423
-945
lines changed

clang/lib/CodeGen/CGExpr.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2507,8 +2507,9 @@ void CodeGenFunction::EmitStoreThroughLValue(RValue Src, LValue Dst,
25072507
Vec = Builder.CreateBitCast(Vec, IRStoreTy);
25082508
}
25092509

2510-
Builder.CreateStore(Vec, Dst.getVectorAddress(),
2511-
Dst.isVolatileQualified());
2510+
auto *I = Builder.CreateStore(Vec, Dst.getVectorAddress(),
2511+
Dst.isVolatileQualified());
2512+
addInstToCurrentSourceAtom(I, Vec);
25122513
return;
25132514
}
25142515

@@ -2530,8 +2531,9 @@ void CodeGenFunction::EmitStoreThroughLValue(RValue Src, LValue Dst,
25302531
llvm::Instruction *Load = Builder.CreateLoad(Dst.getMatrixAddress());
25312532
llvm::Value *Vec =
25322533
Builder.CreateInsertElement(Load, Src.getScalarVal(), Idx, "matins");
2533-
Builder.CreateStore(Vec, Dst.getMatrixAddress(),
2534-
Dst.isVolatileQualified());
2534+
auto *I = Builder.CreateStore(Vec, Dst.getMatrixAddress(),
2535+
Dst.isVolatileQualified());
2536+
addInstToCurrentSourceAtom(I, Vec);
25352537
return;
25362538
}
25372539

@@ -2672,7 +2674,8 @@ void CodeGenFunction::EmitStoreThroughBitfieldLValue(RValue Src, LValue Dst,
26722674
}
26732675

26742676
// Write the new value back out.
2675-
Builder.CreateStore(SrcVal, Ptr, Dst.isVolatileQualified());
2677+
auto *I = Builder.CreateStore(SrcVal, Ptr, Dst.isVolatileQualified());
2678+
addInstToCurrentSourceAtom(I, SrcVal);
26762679

26772680
// Return the new value of the bit-field, if requested.
26782681
if (Result) {

clang/lib/Sema/SemaExpr.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1874,9 +1874,11 @@ ExprResult Sema::CreateGenericSelectionExpr(
18741874

18751875
if (D != 0) {
18761876
Diag(Types[i]->getTypeLoc().getBeginLoc(), D)
1877-
<< Types[i]->getTypeLoc().getSourceRange()
1878-
<< Types[i]->getType();
1879-
TypeErrorFound = true;
1877+
<< Types[i]->getTypeLoc().getSourceRange() << Types[i]->getType();
1878+
if (getDiagnostics().getDiagnosticLevel(
1879+
D, Types[i]->getTypeLoc().getBeginLoc()) >=
1880+
DiagnosticsEngine::Error)
1881+
TypeErrorFound = true;
18801882
}
18811883

18821884
// C11 6.5.1.1p2 "No two generic associations in the same generic

clang/test/C/C2y/n3409.c

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
// RUN: %clang_cc1 -verify -std=c2y -pedantic %s
2-
// RUN: %clang_cc1 -verify=pre-c2y -std=c2y -Wpre-c2y-compat %s
3-
// RUN: %clang_cc1 -verify=ext -std=c23 -pedantic %s
4-
// expected-no-diagnostics
1+
// RUN: %clang_cc1 -verify -std=c2y -pedantic -Wno-unused %s
2+
// RUN: %clang_cc1 -verify=expected,pre-c2y -std=c2y -Wpre-c2y-compat -Wno-unused %s
3+
// RUN: %clang_cc1 -verify=expected,ext -std=c23 -pedantic -Wno-unused %s
54

65
/* WG14 N3409: Clang 21
76
* Slay Some Earthly Demons X
@@ -34,3 +33,25 @@ void foo() {
3433
// C23 and earlier.
3534
return x; // ext-warning {{void function 'foo' should not return void expression}}
3635
}
36+
37+
38+
// Ensure we behave correctly with incomplete types. See GH141549.
39+
static_assert(
40+
_Generic(
41+
void, /* ext-warning {{passing a type argument as the first operand to '_Generic' is a C2y extension}}
42+
pre-c2y-warning {{passing a type argument as the first operand to '_Generic' is incompatible with C standards before C2y}}
43+
*/
44+
void : 1,
45+
default : 0
46+
)
47+
);
48+
49+
static_assert(
50+
_Generic( // expected-error {{static assertion failed}}
51+
12,
52+
void : 1, /* ext-warning {{incomplete type 'void' in a '_Generic' association is a C2y extension}}
53+
pre-c2y-warning {{use of incomplete type 'void' in a '_Generic' association is incompatible with C standards before C2y}}
54+
*/
55+
default : 0
56+
)
57+
);
Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,34 @@
1-
// RUN: %clang_cc1 -triple x86_64-linux-gnu -gkey-instructions -x c++ %s -debug-info-kind=line-tables-only -emit-llvm -o - \
1+
// RUN: %clang_cc1 -triple x86_64-linux-gnu -gkey-instructions -x c++ %s -debug-info-kind=line-tables-only -emit-llvm -o - -fenable-matrix \
22
// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank
33

4-
// RUN: %clang_cc1 -triple x86_64-linux-gnu -gkey-instructions -x c %s -debug-info-kind=line-tables-only -emit-llvm -o - \
4+
// RUN: %clang_cc1 -triple x86_64-linux-gnu -gkey-instructions -x c %s -debug-info-kind=line-tables-only -emit-llvm -o - -fenable-matrix \
55
// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank
66

7+
__attribute__((ext_vector_type(1))) char c;
8+
typedef float m5x5 __attribute__((matrix_type(5, 5)));
9+
m5x5 m;
710
typedef struct { int a, b, c; } Struct;
811
void fun(Struct a) {
912
// CHECK: call void @llvm.memcpy{{.*}}, !dbg [[G1R1:!.*]]
1013
Struct b = a;
1114

1215
// CHECK: call void @llvm.memcpy{{.*}}, !dbg [[G2R1:!.*]]
1316
b = a;
17+
18+
// CHECK: %2 = load <1 x i8>, ptr @c
19+
// CHECK: %vecins = insertelement <1 x i8> %2, i8 0, i32 0, !dbg [[G3R2:!.*]]
20+
// CHECK: store <1 x i8> %vecins, ptr @c{{.*}}, !dbg [[G3R1:!.*]]
21+
c[0] = 0;
22+
23+
// CHECK: %3 = load <25 x float>, ptr @m, align 4
24+
// CHECK: %matins = insertelement <25 x float> %3, float 0.000000e+00, i64 0, !dbg [[G4R2:!.*]]
25+
// CHECK: store <25 x float> %matins, ptr @m{{.*}}, !dbg [[G4R1:!.*]]
26+
m[0][0] = 0;
1427
}
1528

1629
// CHECK: [[G1R1]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 1)
1730
// CHECK: [[G2R1]] = !DILocation({{.*}}, atomGroup: 2, atomRank: 1)
31+
// CHECK: [[G3R2]] = !DILocation({{.*}}, atomGroup: 3, atomRank: 2)
32+
// CHECK: [[G3R1]] = !DILocation({{.*}}, atomGroup: 3, atomRank: 1)
33+
// CHECK: [[G4R2]] = !DILocation({{.*}}, atomGroup: 4, atomRank: 2)
34+
// CHECK: [[G4R1]] = !DILocation({{.*}}, atomGroup: 4, atomRank: 1)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// RUN: %clang_cc1 -triple x86_64-linux-gnu -gkey-instructions %s -debug-info-kind=line-tables-only -emit-llvm -o - \
2+
// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank
3+
4+
// Check assignments to bitfield members are given source atom groups, as this
5+
// has distinct codegen codepath to other variable/member assignments.
6+
7+
struct S { int a:3; };
8+
9+
void foo(int x, S s) {
10+
// CHECK: %bf.set = or i8 %bf.clear, %bf.value, !dbg [[G1R2:!.*]]
11+
// CHECK: store i8 %bf.set, ptr %s, align 4, !dbg [[G1R1:!.*]]
12+
s.a = x;
13+
}
14+
15+
// CHECK: [[G1R2]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 2)
16+
// CHECK: [[G1R1]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 1)

clang/test/SemaCXX/generic-selection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ void func(struct S s) {
8181
// is an elaborated type specifier followed by the association's value and
8282
// it should work the same as in C.
8383
(void)_Generic(s, struct S : 1);
84-
(void)_Generic(s, struct T : 1);
84+
(void)_Generic(s, struct T : 1); // expected-error {{controlling expression type 'struct S' not compatible with any generic association type}}
8585

8686
// The rest of these cases test that we still produce a reasonable diagnostic
8787
// when referencing an unknown type or trying to define a type in other ways.

clang/tools/include-mapping/test.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def testParseSymbolPage_SingleHeader(self):
5252
</tr>
5353
</tbody></table>
5454
"""
55-
self.assertEqual(_ParseSymbolPage(html, "foo"), set(["<cmath>"]))
55+
self.assertEqual(_ParseSymbolPage(html, "foo", "foo"), set(["<cmath>"]))
5656

5757
def testParseSymbolPage_MulHeaders(self):
5858
# Defined in header <cstddef>
@@ -92,7 +92,9 @@ def testParseSymbolPage_MulHeaders(self):
9292
</tr>
9393
</tbody></table>
9494
"""
95-
self.assertEqual(_ParseSymbolPage(html, "foo"), set(["<cstdio>", "<cstdlib>"]))
95+
self.assertEqual(
96+
_ParseSymbolPage(html, "foo", "foo"), set(["<cstdio>", "<cstdlib>"])
97+
)
9698

9799
def testParseSymbolPage_MulHeadersInSameDiv(self):
98100
# Multile <code> blocks in a Div.
@@ -118,7 +120,7 @@ def testParseSymbolPage_MulHeadersInSameDiv(self):
118120
</tbody></table>
119121
"""
120122
self.assertEqual(
121-
_ParseSymbolPage(html, "foo"), set(["<algorithm>", "<utility>"])
123+
_ParseSymbolPage(html, "foo", "foo"), set(["<algorithm>", "<utility>"])
122124
)
123125

124126
def testParseSymbolPage_MulSymbolsInSameTd(self):
@@ -142,8 +144,10 @@ def testParseSymbolPage_MulSymbolsInSameTd(self):
142144
</tr>
143145
</tbody></table>
144146
"""
145-
self.assertEqual(_ParseSymbolPage(html, "int8_t"), set(["<cstdint>"]))
146-
self.assertEqual(_ParseSymbolPage(html, "int16_t"), set(["<cstdint>"]))
147+
self.assertEqual(_ParseSymbolPage(html, "int8_t", "int8_t"), set(["<cstdint>"]))
148+
self.assertEqual(
149+
_ParseSymbolPage(html, "int16_t", "int16_t"), set(["<cstdint>"])
150+
)
147151

148152

149153
if __name__ == "__main__":

flang/test/Intrinsics/math-codegen.fir

Lines changed: 162 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -378,13 +378,167 @@ func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
378378
func.func private @llvm.round.f32(f32) -> f32
379379
func.func private @llvm.round.f64(f64) -> f64
380380

381+
//--- asin_fast.fir
382+
// RUN: fir-opt %t/asin_fast.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/asin_fast.fir
383+
// CHECK: @_QPtest_real4
384+
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.asin({{%[A-Za-z0-9._]+}}) : (f32) -> f32
385+
386+
// CHECK: @_QPtest_real8
387+
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.asin({{%[A-Za-z0-9._]+}}) : (f64) -> f64
388+
389+
func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
390+
%0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
391+
%1 = fir.load %arg0 : !fir.ref<f32>
392+
%2 = math.asin %1 : f32
393+
fir.store %2 to %0 : !fir.ref<f32>
394+
%3 = fir.load %0 : !fir.ref<f32>
395+
return %3 : f32
396+
}
397+
func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
398+
%0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
399+
%1 = fir.load %arg0 : !fir.ref<f64>
400+
%2 = math.asin %1 : f64
401+
fir.store %2 to %0 : !fir.ref<f64>
402+
%3 = fir.load %0 : !fir.ref<f64>
403+
return %3 : f64
404+
}
405+
406+
//--- asin_relaxed.fir
407+
// RUN: fir-opt %t/asin_relaxed.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/asin_relaxed.fir
408+
// CHECK: @_QPtest_real4
409+
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.asin({{%[A-Za-z0-9._]+}}) : (f32) -> f32
410+
411+
// CHECK: @_QPtest_real8
412+
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.asin({{%[A-Za-z0-9._]+}}) : (f64) -> f64
413+
414+
func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
415+
%0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
416+
%1 = fir.load %arg0 : !fir.ref<f32>
417+
%2 = math.asin %1 : f32
418+
fir.store %2 to %0 : !fir.ref<f32>
419+
%3 = fir.load %0 : !fir.ref<f32>
420+
return %3 : f32
421+
}
422+
func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
423+
%0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
424+
%1 = fir.load %arg0 : !fir.ref<f64>
425+
%2 = math.asin %1 : f64
426+
fir.store %2 to %0 : !fir.ref<f64>
427+
%3 = fir.load %0 : !fir.ref<f64>
428+
return %3 : f64
429+
}
430+
431+
//--- asin_precise.fir
432+
// RUN: fir-opt %t/asin_precise.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/asin_precise.fir
433+
// CHECK: @_QPtest_real4
434+
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @asinf({{%[A-Za-z0-9._]+}}) : (f32) -> f32
435+
436+
// CHECK: @_QPtest_real8
437+
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @asin({{%[A-Za-z0-9._]+}}) : (f64) -> f64
438+
439+
func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
440+
%0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
441+
%1 = fir.load %arg0 : !fir.ref<f32>
442+
%2 = fir.call @asinf(%1) : (f32) -> f32
443+
fir.store %2 to %0 : !fir.ref<f32>
444+
%3 = fir.load %0 : !fir.ref<f32>
445+
return %3 : f32
446+
}
447+
func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
448+
%0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
449+
%1 = fir.load %arg0 : !fir.ref<f64>
450+
%2 = fir.call @asin(%1) : (f64) -> f64
451+
fir.store %2 to %0 : !fir.ref<f64>
452+
%3 = fir.load %0 : !fir.ref<f64>
453+
return %3 : f64
454+
}
455+
func.func private @asinf(f32) -> f32
456+
func.func private @asin(f64) -> f64
457+
458+
//--- acos_fast.fir
459+
// RUN: fir-opt %t/acos_fast.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/acos_fast.fir
460+
// CHECK: @_QPtest_real4
461+
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.acos({{%[A-Za-z0-9._]+}}) : (f32) -> f32
462+
463+
// CHECK: @_QPtest_real8
464+
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.acos({{%[A-Za-z0-9._]+}}) : (f64) -> f64
465+
466+
func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
467+
%0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
468+
%1 = fir.load %arg0 : !fir.ref<f32>
469+
%2 = math.acos %1 : f32
470+
fir.store %2 to %0 : !fir.ref<f32>
471+
%3 = fir.load %0 : !fir.ref<f32>
472+
return %3 : f32
473+
}
474+
func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
475+
%0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
476+
%1 = fir.load %arg0 : !fir.ref<f64>
477+
%2 = math.acos %1 : f64
478+
fir.store %2 to %0 : !fir.ref<f64>
479+
%3 = fir.load %0 : !fir.ref<f64>
480+
return %3 : f64
481+
}
482+
483+
//--- acos_relaxed.fir
484+
// RUN: fir-opt %t/acos_relaxed.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/acos_relaxed.fir
485+
// CHECK: @_QPtest_real4
486+
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.acos({{%[A-Za-z0-9._]+}}) : (f32) -> f32
487+
488+
// CHECK: @_QPtest_real8
489+
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.acos({{%[A-Za-z0-9._]+}}) : (f64) -> f64
490+
491+
func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
492+
%0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
493+
%1 = fir.load %arg0 : !fir.ref<f32>
494+
%2 = math.acos %1 : f32
495+
fir.store %2 to %0 : !fir.ref<f32>
496+
%3 = fir.load %0 : !fir.ref<f32>
497+
return %3 : f32
498+
}
499+
func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
500+
%0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
501+
%1 = fir.load %arg0 : !fir.ref<f64>
502+
%2 = math.acos %1 : f64
503+
fir.store %2 to %0 : !fir.ref<f64>
504+
%3 = fir.load %0 : !fir.ref<f64>
505+
return %3 : f64
506+
}
507+
508+
//--- acos_precise.fir
509+
// RUN: fir-opt %t/acos_precise.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/acos_precise.fir
510+
// CHECK: @_QPtest_real4
511+
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @acosf({{%[A-Za-z0-9._]+}}) : (f32) -> f32
512+
513+
// CHECK: @_QPtest_real8
514+
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @acos({{%[A-Za-z0-9._]+}}) : (f64) -> f64
515+
516+
func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
517+
%0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
518+
%1 = fir.load %arg0 : !fir.ref<f32>
519+
%2 = fir.call @acosf(%1) : (f32) -> f32
520+
fir.store %2 to %0 : !fir.ref<f32>
521+
%3 = fir.load %0 : !fir.ref<f32>
522+
return %3 : f32
523+
}
524+
func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
525+
%0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
526+
%1 = fir.load %arg0 : !fir.ref<f64>
527+
%2 = fir.call @acos(%1) : (f64) -> f64
528+
fir.store %2 to %0 : !fir.ref<f64>
529+
%3 = fir.load %0 : !fir.ref<f64>
530+
return %3 : f64
531+
}
532+
func.func private @acosf(f32) -> f32
533+
func.func private @acos(f64) -> f64
534+
381535
//--- atan_fast.fir
382536
// RUN: fir-opt %t/atan_fast.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/atan_fast.fir
383537
// CHECK: @_QPtest_real4
384-
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @atanf({{%[A-Za-z0-9._]+}}) : (f32) -> f32
538+
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.atan({{%[A-Za-z0-9._]+}}) : (f32) -> f32
385539

386540
// CHECK: @_QPtest_real8
387-
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @atan({{%[A-Za-z0-9._]+}}) : (f64) -> f64
541+
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.atan({{%[A-Za-z0-9._]+}}) : (f64) -> f64
388542

389543
func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
390544
%0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
@@ -406,10 +560,10 @@ func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
406560
//--- atan_relaxed.fir
407561
// RUN: fir-opt %t/atan_relaxed.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/atan_relaxed.fir
408562
// CHECK: @_QPtest_real4
409-
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @atanf({{%[A-Za-z0-9._]+}}) : (f32) -> f32
563+
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.atan({{%[A-Za-z0-9._]+}}) : (f32) -> f32
410564

411565
// CHECK: @_QPtest_real8
412-
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @atan({{%[A-Za-z0-9._]+}}) : (f64) -> f64
566+
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.atan({{%[A-Za-z0-9._]+}}) : (f64) -> f64
413567

414568
func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
415569
%0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
@@ -458,10 +612,10 @@ func.func private @atan(f64) -> f64
458612
//--- atan2_fast.fir
459613
// RUN: fir-opt %t/atan2_fast.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/atan2_fast.fir
460614
// CHECK: @_QPtest_real4
461-
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @atan2f({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f32, f32) -> f32
615+
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.atan2({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f32, f32) -> f32
462616

463617
// CHECK: @_QPtest_real8
464-
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @atan2({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f64, f64) -> f64
618+
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.atan2({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f64, f64) -> f64
465619

466620
func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}, %arg1: !fir.ref<f32> {fir.bindc_name = "y"}) -> f32 {
467621
%0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
@@ -485,10 +639,10 @@ func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}, %arg1: !fi
485639
//--- atan2_relaxed.fir
486640
// RUN: fir-opt %t/atan2_relaxed.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/atan2_relaxed.fir
487641
// CHECK: @_QPtest_real4
488-
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @atan2f({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f32, f32) -> f32
642+
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.atan2({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f32, f32) -> f32
489643

490644
// CHECK: @_QPtest_real8
491-
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @atan2({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f64, f64) -> f64
645+
// CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.atan2({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f64, f64) -> f64
492646

493647
func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}, %arg1: !fir.ref<f32> {fir.bindc_name = "y"}) -> f32 {
494648
%0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}

0 commit comments

Comments
 (0)