Skip to content

Commit 76a3098

Browse files
updated hip and aarch64 testcase
1 parent 89e68b2 commit 76a3098

File tree

2 files changed

+13
-21
lines changed

2 files changed

+13
-21
lines changed

clang/test/Headers/__clang_hip_math.hip

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8734,47 +8734,42 @@ extern "C" __device__ float test___powf(float x, float y) {
87348734
}
87358735

87368736
// DEFAULT-LABEL: define dso_local noundef float @test___saturatef(
8737-
// DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
8737+
// DEFAULT-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR2:[0-9]+]] {
87388738
// DEFAULT-NEXT: [[ENTRY:.*:]]
87398739
// DEFAULT-NEXT: [[CMP_I:%.*]] = fcmp contract olt float [[X]], 0.000000e+00
8740-
// DEFAULT-NEXT: [[CMP1_I:%.*]] = fcmp contract ogt float [[X]], 1.000000e+00
8741-
// DEFAULT-NEXT: [[COND_I:%.*]] = select contract i1 [[CMP1_I]], float 1.000000e+00, float [[X]]
8740+
// DEFAULT-NEXT: [[COND_I:%.*]] = tail call contract float @llvm.minnum.f32(float [[X]], float 1.000000e+00)
87428741
// DEFAULT-NEXT: [[COND5_I:%.*]] = select contract i1 [[CMP_I]], float 0.000000e+00, float [[COND_I]]
87438742
// DEFAULT-NEXT: ret float [[COND5_I]]
87448743
//
87458744
// FINITEONLY-LABEL: define dso_local nofpclass(nan inf) float @test___saturatef(
8746-
// FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
8745+
// FINITEONLY-SAME: float noundef nofpclass(nan inf) [[X:%.*]]) local_unnamed_addr #[[ATTR2:[0-9]+]] {
87478746
// FINITEONLY-NEXT: [[ENTRY:.*:]]
87488747
// FINITEONLY-NEXT: [[CMP_I:%.*]] = fcmp nnan ninf contract olt float [[X]], 0.000000e+00
8749-
// FINITEONLY-NEXT: [[CMP1_I:%.*]] = fcmp nnan ninf contract ogt float [[X]], 1.000000e+00
8750-
// FINITEONLY-NEXT: [[COND_I:%.*]] = select nnan ninf contract i1 [[CMP1_I]], float 1.000000e+00, float [[X]]
8748+
// FINITEONLY-NEXT: [[COND_I:%.*]] = tail call nnan ninf contract float @llvm.minnum.f32(float nofpclass(nan inf) [[X]], float 1.000000e+00)
87518749
// FINITEONLY-NEXT: [[COND5_I:%.*]] = select nnan ninf contract i1 [[CMP_I]], float 0.000000e+00, float [[COND_I]]
87528750
// FINITEONLY-NEXT: ret float [[COND5_I]]
87538751
//
87548752
// APPROX-LABEL: define dso_local noundef float @test___saturatef(
8755-
// APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
8753+
// APPROX-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR2:[0-9]+]] {
87568754
// APPROX-NEXT: [[ENTRY:.*:]]
87578755
// APPROX-NEXT: [[CMP_I:%.*]] = fcmp contract olt float [[X]], 0.000000e+00
8758-
// APPROX-NEXT: [[CMP1_I:%.*]] = fcmp contract ogt float [[X]], 1.000000e+00
8759-
// APPROX-NEXT: [[COND_I:%.*]] = select contract i1 [[CMP1_I]], float 1.000000e+00, float [[X]]
8756+
// APPROX-NEXT: [[COND_I:%.*]] = tail call contract float @llvm.minnum.f32(float [[X]], float 1.000000e+00)
87608757
// APPROX-NEXT: [[COND5_I:%.*]] = select contract i1 [[CMP_I]], float 0.000000e+00, float [[COND_I]]
87618758
// APPROX-NEXT: ret float [[COND5_I]]
87628759
//
87638760
// NCRDIV-LABEL: define dso_local noundef float @test___saturatef(
8764-
// NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR3]] {
8761+
// NCRDIV-SAME: float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR2:[0-9]+]] {
87658762
// NCRDIV-NEXT: [[ENTRY:.*:]]
87668763
// NCRDIV-NEXT: [[CMP_I:%.*]] = fcmp contract olt float [[X]], 0.000000e+00
8767-
// NCRDIV-NEXT: [[CMP1_I:%.*]] = fcmp contract ogt float [[X]], 1.000000e+00
8768-
// NCRDIV-NEXT: [[COND_I:%.*]] = select contract i1 [[CMP1_I]], float 1.000000e+00, float [[X]]
8764+
// NCRDIV-NEXT: [[COND_I:%.*]] = tail call contract float @llvm.minnum.f32(float [[X]], float 1.000000e+00)
87698765
// NCRDIV-NEXT: [[COND5_I:%.*]] = select contract i1 [[CMP_I]], float 0.000000e+00, float [[COND_I]]
87708766
// NCRDIV-NEXT: ret float [[COND5_I]]
87718767
//
87728768
// AMDGCNSPIRV-LABEL: define spir_func noundef float @test___saturatef(
8773-
// AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR3]] {
8769+
// AMDGCNSPIRV-SAME: float noundef [[X:%.*]]) local_unnamed_addr addrspace(4) #[[ATTR2:[0-9]+]] {
87748770
// AMDGCNSPIRV-NEXT: [[ENTRY:.*:]]
87758771
// AMDGCNSPIRV-NEXT: [[CMP_I:%.*]] = fcmp contract olt float [[X]], 0.000000e+00
8776-
// AMDGCNSPIRV-NEXT: [[CMP1_I:%.*]] = fcmp contract ogt float [[X]], 1.000000e+00
8777-
// AMDGCNSPIRV-NEXT: [[COND_I:%.*]] = select contract i1 [[CMP1_I]], float 1.000000e+00, float [[X]]
8772+
// AMDGCNSPIRV-NEXT: [[COND_I:%.*]] = tail call contract addrspace(4) float @llvm.minnum.f32(float [[X]], float 1.000000e+00)
87788773
// AMDGCNSPIRV-NEXT: [[COND5_I:%.*]] = select contract i1 [[CMP_I]], float 0.000000e+00, float [[COND_I]]
87798774
// AMDGCNSPIRV-NEXT: ret float [[COND5_I]]
87808775
//

llvm/test/Transforms/PhaseOrdering/AArch64/hoisting-sinking-required-for-vectorization.ll

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,8 @@ define void @loop(ptr %X, ptr %Y) {
5454
; CHECK-NEXT: [[WIDE_LOAD8:%.*]] = load <2 x double>, ptr [[TMP2]], align 8
5555
; CHECK-NEXT: [[TMP3:%.*]] = fcmp olt <2 x double> [[WIDE_LOAD]], zeroinitializer
5656
; CHECK-NEXT: [[TMP4:%.*]] = fcmp olt <2 x double> [[WIDE_LOAD8]], zeroinitializer
57-
; CHECK-NEXT: [[TMP5:%.*]] = fcmp ogt <2 x double> [[WIDE_LOAD]], splat (double 6.000000e+00)
58-
; CHECK-NEXT: [[TMP6:%.*]] = fcmp ogt <2 x double> [[WIDE_LOAD8]], splat (double 6.000000e+00)
59-
; CHECK-NEXT: [[TMP7:%.*]] = select <2 x i1> [[TMP5]], <2 x double> splat (double 6.000000e+00), <2 x double> [[WIDE_LOAD]]
60-
; CHECK-NEXT: [[TMP8:%.*]] = select <2 x i1> [[TMP6]], <2 x double> splat (double 6.000000e+00), <2 x double> [[WIDE_LOAD8]]
57+
; CHECK-NEXT: [[TMP7:%.*]] = tail call <2 x double> @llvm.minnum.v2f64(<2 x double> [[WIDE_LOAD]], <2 x double> splat (double 6.000000e+00))
58+
; CHECK-NEXT: [[TMP8:%.*]] = tail call <2 x double> @llvm.minnum.v2f64(<2 x double> [[WIDE_LOAD8]], <2 x double> splat (double 6.000000e+00))
6159
; CHECK-NEXT: [[TMP9:%.*]] = select <2 x i1> [[TMP3]], <2 x double> zeroinitializer, <2 x double> [[TMP7]]
6260
; CHECK-NEXT: [[TMP10:%.*]] = select <2 x i1> [[TMP4]], <2 x double> zeroinitializer, <2 x double> [[TMP8]]
6361
; CHECK-NEXT: [[TMP11:%.*]] = getelementptr inbounds nuw double, ptr [[X]], i64 [[INDEX]]
@@ -74,8 +72,7 @@ define void @loop(ptr %X, ptr %Y) {
7472
; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds nuw double, ptr [[Y]], i64 [[INDVARS_IV]]
7573
; CHECK-NEXT: [[TMP14:%.*]] = load double, ptr [[ARRAYIDX]], align 8
7674
; CHECK-NEXT: [[CMP_I:%.*]] = fcmp olt double [[TMP14]], 0.000000e+00
77-
; CHECK-NEXT: [[CMP1_I:%.*]] = fcmp ogt double [[TMP14]], 6.000000e+00
78-
; CHECK-NEXT: [[DOTV_I:%.*]] = select i1 [[CMP1_I]], double 6.000000e+00, double [[TMP14]]
75+
; CHECK-NEXT: [[DOTV_I:%.*]] = tail call double @llvm.minnum.f64(double [[TMP14]], double 6.000000e+00)
7976
; CHECK-NEXT: [[RETVAL_0_I:%.*]] = select i1 [[CMP_I]], double 0.000000e+00, double [[DOTV_I]]
8077
; CHECK-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds nuw double, ptr [[X]], i64 [[INDVARS_IV]]
8178
; CHECK-NEXT: store double [[RETVAL_0_I]], ptr [[ARRAYIDX2]], align 8

0 commit comments

Comments
 (0)