| ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --filter "call.*@" --version 6 |
| ; RUN: opt -vector-library=LIBMVEC -passes=inject-tli-mappings,loop-vectorize -force-vector-width=2 -force-vector-interleave=1 -S < %s | FileCheck %s --check-prefixes=CHECK-VF2 |
| ; RUN: opt -vector-library=LIBMVEC -passes=inject-tli-mappings,loop-vectorize -force-vector-width=4 -force-vector-interleave=1 -S < %s | FileCheck %s --check-prefixes=CHECK-VF4 |
| ; RUN: opt -vector-library=LIBMVEC -passes=inject-tli-mappings,loop-vectorize -force-vector-width=8 -force-vector-interleave=1 -S < %s | FileCheck %s --check-prefixes=CHECK-VF8 |
| target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" |
| target triple = "x86_64-unknown-linux-gnu" |
| |
| define void @exp_f32(ptr nocapture %varray) { |
| ; CHECK-VF2-LABEL: define void @exp_f32( |
| ; CHECK-VF2-SAME: ptr captures(none) [[VARRAY:%.*]]) { |
| ; CHECK-VF2: [[TMP2:%.*]] = tail call fast float @__expf_finite(float [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] |
| ; CHECK-VF2: [[TMP4:%.*]] = tail call fast float @__expf_finite(float [[TMP3:%.*]]) #[[ATTR0]] |
| ; |
| ; CHECK-VF4-LABEL: define void @exp_f32( |
| ; CHECK-VF4-SAME: ptr captures(none) [[VARRAY:%.*]]) { |
| ; CHECK-VF4: [[TMP1:%.*]] = call fast <4 x float> @_ZGVbN4v___expf_finite(<4 x float> [[TMP0:%.*]]) |
| ; |
| ; CHECK-VF8-LABEL: define void @exp_f32( |
| ; CHECK-VF8-SAME: ptr captures(none) [[VARRAY:%.*]]) { |
| ; CHECK-VF8: [[TMP1:%.*]] = call fast <8 x float> @_ZGVdN8v___expf_finite(<8 x float> [[TMP0:%.*]]) |
| ; |
| entry: |
| br label %for.body |
| |
| for.body: |
| %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] |
| %tmp = trunc i64 %indvars.iv to i32 |
| %conv = sitofp i32 %tmp to float |
| %call = tail call fast float @__expf_finite(float %conv) |
| %arrayidx = getelementptr inbounds float, ptr %varray, i64 %indvars.iv |
| store float %call, ptr %arrayidx, align 4 |
| %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 |
| %exitcond = icmp eq i64 %indvars.iv.next, 1000 |
| br i1 %exitcond, label %for.end, label %for.body |
| |
| for.end: |
| ret void |
| } |
| |
| define void @exp_f64(ptr nocapture %varray) { |
| ; CHECK-VF2-LABEL: define void @exp_f64( |
| ; CHECK-VF2-SAME: ptr captures(none) [[VARRAY:%.*]]) { |
| ; CHECK-VF2: [[TMP1:%.*]] = call fast <2 x double> @_ZGVbN2v___exp_finite(<2 x double> [[TMP0:%.*]]) |
| ; |
| ; CHECK-VF4-LABEL: define void @exp_f64( |
| ; CHECK-VF4-SAME: ptr captures(none) [[VARRAY:%.*]]) { |
| ; CHECK-VF4: [[TMP1:%.*]] = call fast <4 x double> @_ZGVdN4v___exp_finite(<4 x double> [[TMP0:%.*]]) |
| ; |
| ; CHECK-VF8-LABEL: define void @exp_f64( |
| ; CHECK-VF8-SAME: ptr captures(none) [[VARRAY:%.*]]) { |
| ; CHECK-VF8: [[TMP2:%.*]] = tail call fast double @__exp_finite(double [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] |
| ; CHECK-VF8: [[TMP4:%.*]] = tail call fast double @__exp_finite(double [[TMP3:%.*]]) #[[ATTR0]] |
| ; CHECK-VF8: [[TMP6:%.*]] = tail call fast double @__exp_finite(double [[TMP5:%.*]]) #[[ATTR0]] |
| ; CHECK-VF8: [[TMP8:%.*]] = tail call fast double @__exp_finite(double [[TMP7:%.*]]) #[[ATTR0]] |
| ; CHECK-VF8: [[TMP10:%.*]] = tail call fast double @__exp_finite(double [[TMP9:%.*]]) #[[ATTR0]] |
| ; CHECK-VF8: [[TMP12:%.*]] = tail call fast double @__exp_finite(double [[TMP11:%.*]]) #[[ATTR0]] |
| ; CHECK-VF8: [[TMP14:%.*]] = tail call fast double @__exp_finite(double [[TMP13:%.*]]) #[[ATTR0]] |
| ; CHECK-VF8: [[TMP16:%.*]] = tail call fast double @__exp_finite(double [[TMP15:%.*]]) #[[ATTR0]] |
| ; |
| entry: |
| br label %for.body |
| |
| for.body: |
| %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] |
| %tmp = trunc i64 %indvars.iv to i32 |
| %conv = sitofp i32 %tmp to double |
| %call = tail call fast double @__exp_finite(double %conv) |
| %arrayidx = getelementptr inbounds double, ptr %varray, i64 %indvars.iv |
| store double %call, ptr %arrayidx, align 4 |
| %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 |
| %exitcond = icmp eq i64 %indvars.iv.next, 1000 |
| br i1 %exitcond, label %for.end, label %for.body |
| |
| for.end: |
| ret void |
| } |
| |
| define void @log_f32(ptr nocapture %varray) { |
| ; CHECK-VF2-LABEL: define void @log_f32( |
| ; CHECK-VF2-SAME: ptr captures(none) [[VARRAY:%.*]]) { |
| ; CHECK-VF2: [[TMP2:%.*]] = tail call fast float @__logf_finite(float [[TMP1:%.*]]) #[[ATTR1:[0-9]+]] |
| ; CHECK-VF2: [[TMP4:%.*]] = tail call fast float @__logf_finite(float [[TMP3:%.*]]) #[[ATTR1]] |
| ; |
| ; CHECK-VF4-LABEL: define void @log_f32( |
| ; CHECK-VF4-SAME: ptr captures(none) [[VARRAY:%.*]]) { |
| ; CHECK-VF4: [[TMP1:%.*]] = call fast <4 x float> @_ZGVbN4v___logf_finite(<4 x float> [[TMP0:%.*]]) |
| ; |
| ; CHECK-VF8-LABEL: define void @log_f32( |
| ; CHECK-VF8-SAME: ptr captures(none) [[VARRAY:%.*]]) { |
| ; CHECK-VF8: [[TMP1:%.*]] = call fast <8 x float> @_ZGVdN8v___logf_finite(<8 x float> [[TMP0:%.*]]) |
| ; |
| entry: |
| br label %for.body |
| |
| for.body: |
| %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] |
| %tmp = trunc i64 %indvars.iv to i32 |
| %conv = sitofp i32 %tmp to float |
| %call = tail call fast float @__logf_finite(float %conv) |
| %arrayidx = getelementptr inbounds float, ptr %varray, i64 %indvars.iv |
| store float %call, ptr %arrayidx, align 4 |
| %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 |
| %exitcond = icmp eq i64 %indvars.iv.next, 1000 |
| br i1 %exitcond, label %for.end, label %for.body |
| |
| for.end: |
| ret void |
| } |
| |
| define void @log_f64(ptr nocapture %varray) { |
| ; CHECK-VF2-LABEL: define void @log_f64( |
| ; CHECK-VF2-SAME: ptr captures(none) [[VARRAY:%.*]]) { |
| ; CHECK-VF2: [[TMP1:%.*]] = call fast <2 x double> @_ZGVbN2v___log_finite(<2 x double> [[TMP0:%.*]]) |
| ; |
| ; CHECK-VF4-LABEL: define void @log_f64( |
| ; CHECK-VF4-SAME: ptr captures(none) [[VARRAY:%.*]]) { |
| ; CHECK-VF4: [[TMP1:%.*]] = call fast <4 x double> @_ZGVdN4v___log_finite(<4 x double> [[TMP0:%.*]]) |
| ; |
| ; CHECK-VF8-LABEL: define void @log_f64( |
| ; CHECK-VF8-SAME: ptr captures(none) [[VARRAY:%.*]]) { |
| ; CHECK-VF8: [[TMP2:%.*]] = tail call fast double @__log_finite(double [[TMP1:%.*]]) #[[ATTR1:[0-9]+]] |
| ; CHECK-VF8: [[TMP4:%.*]] = tail call fast double @__log_finite(double [[TMP3:%.*]]) #[[ATTR1]] |
| ; CHECK-VF8: [[TMP6:%.*]] = tail call fast double @__log_finite(double [[TMP5:%.*]]) #[[ATTR1]] |
| ; CHECK-VF8: [[TMP8:%.*]] = tail call fast double @__log_finite(double [[TMP7:%.*]]) #[[ATTR1]] |
| ; CHECK-VF8: [[TMP10:%.*]] = tail call fast double @__log_finite(double [[TMP9:%.*]]) #[[ATTR1]] |
| ; CHECK-VF8: [[TMP12:%.*]] = tail call fast double @__log_finite(double [[TMP11:%.*]]) #[[ATTR1]] |
| ; CHECK-VF8: [[TMP14:%.*]] = tail call fast double @__log_finite(double [[TMP13:%.*]]) #[[ATTR1]] |
| ; CHECK-VF8: [[TMP16:%.*]] = tail call fast double @__log_finite(double [[TMP15:%.*]]) #[[ATTR1]] |
| ; |
| entry: |
| br label %for.body |
| |
| for.body: |
| %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] |
| %tmp = trunc i64 %indvars.iv to i32 |
| %conv = sitofp i32 %tmp to double |
| %call = tail call fast double @__log_finite(double %conv) |
| %arrayidx = getelementptr inbounds double, ptr %varray, i64 %indvars.iv |
| store double %call, ptr %arrayidx, align 4 |
| %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 |
| %exitcond = icmp eq i64 %indvars.iv.next, 1000 |
| br i1 %exitcond, label %for.end, label %for.body |
| |
| for.end: |
| ret void |
| } |
| |
| |
| define void @pow_f32(ptr nocapture %varray, ptr nocapture readonly %exp) { |
| ; CHECK-VF2-LABEL: define void @pow_f32( |
| ; CHECK-VF2-SAME: ptr captures(none) [[VARRAY:%.*]], ptr readonly captures(none) [[EXP:%.*]]) { |
| ; CHECK-VF2: [[TMP6:%.*]] = tail call fast float @__powf_finite(float [[TMP4:%.*]], float [[TMP5:%.*]]) #[[ATTR2:[0-9]+]] |
| ; CHECK-VF2: [[TMP9:%.*]] = tail call fast float @__powf_finite(float [[TMP7:%.*]], float [[TMP8:%.*]]) #[[ATTR2]] |
| ; CHECK-VF2: [[I2:%.*]] = tail call fast float @__powf_finite(float [[CONV:%.*]], float [[I1:%.*]]) #[[ATTR2]] |
| ; |
| ; CHECK-VF4-LABEL: define void @pow_f32( |
| ; CHECK-VF4-SAME: ptr captures(none) [[VARRAY:%.*]], ptr readonly captures(none) [[EXP:%.*]]) { |
| ; CHECK-VF4: [[TMP3:%.*]] = call fast <4 x float> @_ZGVbN4vv___powf_finite(<4 x float> [[TMP1:%.*]], <4 x float> [[WIDE_LOAD:%.*]]) |
| ; CHECK-VF4: [[I2:%.*]] = tail call fast float @__powf_finite(float [[CONV:%.*]], float [[I1:%.*]]) #[[ATTR0:[0-9]+]] |
| ; |
| ; CHECK-VF8-LABEL: define void @pow_f32( |
| ; CHECK-VF8-SAME: ptr captures(none) [[VARRAY:%.*]], ptr readonly captures(none) [[EXP:%.*]]) { |
| ; CHECK-VF8: [[TMP3:%.*]] = call fast <8 x float> @_ZGVdN8vv___powf_finite(<8 x float> [[TMP1:%.*]], <8 x float> [[WIDE_LOAD:%.*]]) |
| ; CHECK-VF8: [[I2:%.*]] = tail call fast float @__powf_finite(float [[CONV:%.*]], float [[I1:%.*]]) #[[ATTR2:[0-9]+]] |
| ; |
| entry: |
| br label %for.body |
| |
| for.body: |
| %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] |
| %tmp = trunc i64 %indvars.iv to i32 |
| %conv = sitofp i32 %tmp to float |
| %arrayidx = getelementptr inbounds float, ptr %exp, i64 %indvars.iv |
| %i1 = load float, ptr %arrayidx, align 4 |
| %i2 = tail call fast float @__powf_finite(float %conv, float %i1) |
| %arrayidx2 = getelementptr inbounds float, ptr %varray, i64 %indvars.iv |
| store float %i2, ptr %arrayidx2, align 4 |
| %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 |
| %exitcond = icmp eq i64 %indvars.iv.next, 1000 |
| br i1 %exitcond, label %for.end, label %for.body |
| |
| for.end: |
| ret void |
| } |
| |
| define void @pow_f64(ptr nocapture %varray, ptr nocapture readonly %exp) { |
| ; CHECK-VF2-LABEL: define void @pow_f64( |
| ; CHECK-VF2-SAME: ptr captures(none) [[VARRAY:%.*]], ptr readonly captures(none) [[EXP:%.*]]) { |
| ; CHECK-VF2: [[TMP3:%.*]] = call fast <2 x double> @_ZGVbN2vv___pow_finite(<2 x double> [[TMP1:%.*]], <2 x double> [[WIDE_LOAD:%.*]]) |
| ; CHECK-VF2: [[I2:%.*]] = tail call fast double @__pow_finite(double [[CONV:%.*]], double [[I1:%.*]]) #[[ATTR3:[0-9]+]] |
| ; |
| ; CHECK-VF4-LABEL: define void @pow_f64( |
| ; CHECK-VF4-SAME: ptr captures(none) [[VARRAY:%.*]], ptr readonly captures(none) [[EXP:%.*]]) { |
| ; CHECK-VF4: [[TMP3:%.*]] = call fast <4 x double> @_ZGVdN4vv___pow_finite(<4 x double> [[TMP1:%.*]], <4 x double> [[WIDE_LOAD:%.*]]) |
| ; CHECK-VF4: [[I2:%.*]] = tail call fast double @__pow_finite(double [[CONV:%.*]], double [[I1:%.*]]) #[[ATTR1:[0-9]+]] |
| ; |
| ; CHECK-VF8-LABEL: define void @pow_f64( |
| ; CHECK-VF8-SAME: ptr captures(none) [[VARRAY:%.*]], ptr readonly captures(none) [[EXP:%.*]]) { |
| ; CHECK-VF8: [[TMP6:%.*]] = tail call fast double @__pow_finite(double [[TMP4:%.*]], double [[TMP5:%.*]]) #[[ATTR3:[0-9]+]] |
| ; CHECK-VF8: [[TMP9:%.*]] = tail call fast double @__pow_finite(double [[TMP7:%.*]], double [[TMP8:%.*]]) #[[ATTR3]] |
| ; CHECK-VF8: [[TMP12:%.*]] = tail call fast double @__pow_finite(double [[TMP10:%.*]], double [[TMP11:%.*]]) #[[ATTR3]] |
| ; CHECK-VF8: [[TMP15:%.*]] = tail call fast double @__pow_finite(double [[TMP13:%.*]], double [[TMP14:%.*]]) #[[ATTR3]] |
| ; CHECK-VF8: [[TMP18:%.*]] = tail call fast double @__pow_finite(double [[TMP16:%.*]], double [[TMP17:%.*]]) #[[ATTR3]] |
| ; CHECK-VF8: [[TMP21:%.*]] = tail call fast double @__pow_finite(double [[TMP19:%.*]], double [[TMP20:%.*]]) #[[ATTR3]] |
| ; CHECK-VF8: [[TMP24:%.*]] = tail call fast double @__pow_finite(double [[TMP22:%.*]], double [[TMP23:%.*]]) #[[ATTR3]] |
| ; CHECK-VF8: [[TMP27:%.*]] = tail call fast double @__pow_finite(double [[TMP25:%.*]], double [[TMP26:%.*]]) #[[ATTR3]] |
| ; CHECK-VF8: [[I2:%.*]] = tail call fast double @__pow_finite(double [[CONV:%.*]], double [[I1:%.*]]) #[[ATTR3]] |
| ; |
| entry: |
| br label %for.body |
| |
| for.body: |
| %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] |
| %tmp = trunc i64 %indvars.iv to i32 |
| %conv = sitofp i32 %tmp to double |
| %arrayidx = getelementptr inbounds double, ptr %exp, i64 %indvars.iv |
| %i1 = load double, ptr %arrayidx, align 4 |
| %i2 = tail call fast double @__pow_finite(double %conv, double %i1) |
| %arrayidx2 = getelementptr inbounds double, ptr %varray, i64 %indvars.iv |
| store double %i2, ptr %arrayidx2, align 4 |
| %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 |
| %exitcond = icmp eq i64 %indvars.iv.next, 1000 |
| br i1 %exitcond, label %for.end, label %for.body |
| |
| for.end: |
| ret void |
| } |
| |
| declare float @__expf_finite(float) #0 |
| declare double @__exp_finite(double) #0 |
| declare float @__logf_finite(float) #0 |
| declare double @__log_finite(double) #0 |
| declare float @__powf_finite(float, float) #0 |
| declare double @__pow_finite(double, double) #0 |