1; RUN: opt -vector-library=SVML -inject-tli-mappings -loop-vectorize -force-vector-width=4 -force-vector-interleave=1 -mattr=avx -S < %s | FileCheck %s 2 3target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 4target triple = "x86_64-unknown-linux-gnu" 5 6declare double @sin(double) #0 7declare float @sinf(float) #0 8declare double @llvm.sin.f64(double) #0 9declare float @llvm.sin.f32(float) #0 10 11declare double @cos(double) #0 12declare float @cosf(float) #0 13declare double @llvm.cos.f64(double) #0 14declare float @llvm.cos.f32(float) #0 15 16declare double @pow(double, double) #0 17declare float @powf(float, float) #0 18declare double @llvm.pow.f64(double, double) #0 19declare float @llvm.pow.f32(float, float) #0 20 21declare double @exp(double) #0 22declare float @expf(float) #0 23declare double @llvm.exp.f64(double) #0 24declare float @llvm.exp.f32(float) #0 25 26declare double @log(double) #0 27declare float @logf(float) #0 28declare double @llvm.log.f64(double) #0 29declare float @llvm.log.f32(float) #0 30 31declare double @log2(double) #0 32declare float @log2f(float) #0 33declare double @llvm.log2.f64(double) #0 34declare float @llvm.log2.f32(float) #0 35 36declare double @log10(double) #0 37declare float @log10f(float) #0 38declare double @llvm.log10.f64(double) #0 39declare float @llvm.log10.f32(float) #0 40 41declare double @sqrt(double) #0 42declare float @sqrtf(float) #0 43 44declare double @exp2(double) #0 45declare float @exp2f(float) #0 46declare double @llvm.exp2.f64(double) #0 47declare float @llvm.exp2.f32(float) #0 48 49define void @sin_f64(double* nocapture %varray) { 50; CHECK-LABEL: @sin_f64( 51; CHECK: [[TMP5:%.*]] = call <4 x double> @__svml_sin4(<4 x double> [[TMP4:%.*]]) 52; CHECK: ret void 53; 54entry: 55 br label %for.body 56 57for.body: 58 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] 59 %tmp = trunc i64 %iv to i32 60 %conv = sitofp i32 %tmp to double 61 %call = tail call double @sin(double %conv) 62 %arrayidx = getelementptr inbounds double, double* %varray, i64 %iv 63 store double %call, double* %arrayidx, align 4 64 %iv.next = add nuw nsw i64 %iv, 1 65 %exitcond = icmp eq i64 %iv.next, 1000 66 br i1 %exitcond, label %for.end, label %for.body 67 68for.end: 69 ret void 70} 71 72define void @sin_f32(float* nocapture %varray) { 73; CHECK-LABEL: @sin_f32( 74; CHECK: [[TMP5:%.*]] = call <4 x float> @__svml_sinf4(<4 x float> [[TMP4:%.*]]) 75; CHECK: ret void 76; 77entry: 78 br label %for.body 79 80for.body: 81 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] 82 %tmp = trunc i64 %iv to i32 83 %conv = sitofp i32 %tmp to float 84 %call = tail call float @sinf(float %conv) 85 %arrayidx = getelementptr inbounds float, float* %varray, i64 %iv 86 store float %call, float* %arrayidx, align 4 87 %iv.next = add nuw nsw i64 %iv, 1 88 %exitcond = icmp eq i64 %iv.next, 1000 89 br i1 %exitcond, label %for.end, label %for.body 90 91for.end: 92 ret void 93} 94 95define void @sin_f64_intrinsic(double* nocapture %varray) { 96; CHECK-LABEL: @sin_f64_intrinsic( 97; CHECK: [[TMP5:%.*]] = call <4 x double> @__svml_sin4(<4 x double> [[TMP4:%.*]]) 98; CHECK: ret void 99; 100entry: 101 br label %for.body 102 103for.body: 104 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] 105 %tmp = trunc i64 %iv to i32 106 %conv = sitofp i32 %tmp to double 107 %call = tail call double @llvm.sin.f64(double %conv) 108 %arrayidx = getelementptr inbounds double, double* %varray, i64 %iv 109 store double %call, double* %arrayidx, align 4 110 %iv.next = add nuw nsw i64 %iv, 1 111 %exitcond = icmp eq i64 %iv.next, 1000 112 br i1 %exitcond, label %for.end, label %for.body 113 114for.end: 115 ret void 116} 117 118define void @sin_f32_intrinsic(float* nocapture %varray) { 119; CHECK-LABEL: @sin_f32_intrinsic( 120; CHECK: [[TMP5:%.*]] = call <4 x float> @__svml_sinf4(<4 x float> [[TMP4:%.*]]) 121; CHECK: ret void 122; 123entry: 124 br label %for.body 125 126for.body: 127 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] 128 %tmp = trunc i64 %iv to i32 129 %conv = sitofp i32 %tmp to float 130 %call = tail call float @llvm.sin.f32(float %conv) 131 %arrayidx = getelementptr inbounds float, float* %varray, i64 %iv 132 store float %call, float* %arrayidx, align 4 133 %iv.next = add nuw nsw i64 %iv, 1 134 %exitcond = icmp eq i64 %iv.next, 1000 135 br i1 %exitcond, label %for.end, label %for.body 136 137for.end: 138 ret void 139} 140 141define void @cos_f64(double* nocapture %varray) { 142; CHECK-LABEL: @cos_f64( 143; CHECK: [[TMP5:%.*]] = call <4 x double> @__svml_cos4(<4 x double> [[TMP4:%.*]]) 144; CHECK: ret void 145; 146entry: 147 br label %for.body 148 149for.body: 150 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] 151 %tmp = trunc i64 %iv to i32 152 %conv = sitofp i32 %tmp to double 153 %call = tail call double @cos(double %conv) 154 %arrayidx = getelementptr inbounds double, double* %varray, i64 %iv 155 store double %call, double* %arrayidx, align 4 156 %iv.next = add nuw nsw i64 %iv, 1 157 %exitcond = icmp eq i64 %iv.next, 1000 158 br i1 %exitcond, label %for.end, label %for.body 159 160for.end: 161 ret void 162} 163 164define void @cos_f32(float* nocapture %varray) { 165; CHECK-LABEL: @cos_f32( 166; CHECK: [[TMP5:%.*]] = call <4 x float> @__svml_cosf4(<4 x float> [[TMP4:%.*]]) 167; CHECK: ret void 168; 169entry: 170 br label %for.body 171 172for.body: 173 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] 174 %tmp = trunc i64 %iv to i32 175 %conv = sitofp i32 %tmp to float 176 %call = tail call float @cosf(float %conv) 177 %arrayidx = getelementptr inbounds float, float* %varray, i64 %iv 178 store float %call, float* %arrayidx, align 4 179 %iv.next = add nuw nsw i64 %iv, 1 180 %exitcond = icmp eq i64 %iv.next, 1000 181 br i1 %exitcond, label %for.end, label %for.body 182 183for.end: 184 ret void 185} 186 187define void @cos_f64_intrinsic(double* nocapture %varray) { 188; CHECK-LABEL: @cos_f64_intrinsic( 189; CHECK: [[TMP5:%.*]] = call <4 x double> @__svml_cos4(<4 x double> [[TMP4:%.*]]) 190; CHECK: ret void 191; 192entry: 193 br label %for.body 194 195for.body: 196 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] 197 %tmp = trunc i64 %iv to i32 198 %conv = sitofp i32 %tmp to double 199 %call = tail call double @llvm.cos.f64(double %conv) 200 %arrayidx = getelementptr inbounds double, double* %varray, i64 %iv 201 store double %call, double* %arrayidx, align 4 202 %iv.next = add nuw nsw i64 %iv, 1 203 %exitcond = icmp eq i64 %iv.next, 1000 204 br i1 %exitcond, label %for.end, label %for.body 205 206for.end: 207 ret void 208} 209 210define void @cos_f32_intrinsic(float* nocapture %varray) { 211; CHECK-LABEL: @cos_f32_intrinsic( 212; CHECK: [[TMP5:%.*]] = call <4 x float> @__svml_cosf4(<4 x float> [[TMP4:%.*]]) 213; CHECK: ret void 214; 215entry: 216 br label %for.body 217 218for.body: 219 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] 220 %tmp = trunc i64 %iv to i32 221 %conv = sitofp i32 %tmp to float 222 %call = tail call float @llvm.cos.f32(float %conv) 223 %arrayidx = getelementptr inbounds float, float* %varray, i64 %iv 224 store float %call, float* %arrayidx, align 4 225 %iv.next = add nuw nsw i64 %iv, 1 226 %exitcond = icmp eq i64 %iv.next, 1000 227 br i1 %exitcond, label %for.end, label %for.body 228 229for.end: 230 ret void 231} 232 233define void @pow_f64(double* nocapture %varray, double* nocapture readonly %exp) { 234; CHECK-LABEL: @pow_f64( 235; CHECK: [[TMP8:%.*]] = call <4 x double> @__svml_pow4(<4 x double> [[TMP4:%.*]], <4 x double> [[WIDE_LOAD:%.*]]) 236; CHECK: ret void 237; 238entry: 239 br label %for.body 240 241for.body: 242 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] 243 %tmp = trunc i64 %iv to i32 244 %conv = sitofp i32 %tmp to double 245 %arrayidx = getelementptr inbounds double, double* %exp, i64 %iv 246 %tmp1 = load double, double* %arrayidx, align 4 247 %tmp2 = tail call double @pow(double %conv, double %tmp1) 248 %arrayidx2 = getelementptr inbounds double, double* %varray, i64 %iv 249 store double %tmp2, double* %arrayidx2, align 4 250 %iv.next = add nuw nsw i64 %iv, 1 251 %exitcond = icmp eq i64 %iv.next, 1000 252 br i1 %exitcond, label %for.end, label %for.body 253 254for.end: 255 ret void 256} 257 258define void @pow_f64_intrinsic(double* nocapture %varray, double* nocapture readonly %exp) { 259; CHECK-LABEL: @pow_f64_intrinsic( 260; CHECK: [[TMP8:%.*]] = call <4 x double> @__svml_pow4(<4 x double> [[TMP4:%.*]], <4 x double> [[WIDE_LOAD:%.*]]) 261; CHECK: ret void 262; 263entry: 264 br label %for.body 265 266for.body: 267 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] 268 %tmp = trunc i64 %iv to i32 269 %conv = sitofp i32 %tmp to double 270 %arrayidx = getelementptr inbounds double, double* %exp, i64 %iv 271 %tmp1 = load double, double* %arrayidx, align 4 272 %tmp2 = tail call double @llvm.pow.f64(double %conv, double %tmp1) 273 %arrayidx2 = getelementptr inbounds double, double* %varray, i64 %iv 274 store double %tmp2, double* %arrayidx2, align 4 275 %iv.next = add nuw nsw i64 %iv, 1 276 %exitcond = icmp eq i64 %iv.next, 1000 277 br i1 %exitcond, label %for.end, label %for.body 278 279for.end: 280 ret void 281} 282 283define void @pow_f32(float* nocapture %varray, float* nocapture readonly %exp) { 284; CHECK-LABEL: @pow_f32( 285; CHECK: [[TMP8:%.*]] = call <4 x float> @__svml_powf4(<4 x float> [[TMP4:%.*]], <4 x float> [[WIDE_LOAD:%.*]]) 286; CHECK: ret void 287; 288entry: 289 br label %for.body 290 291for.body: 292 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] 293 %tmp = trunc i64 %iv to i32 294 %conv = sitofp i32 %tmp to float 295 %arrayidx = getelementptr inbounds float, float* %exp, i64 %iv 296 %tmp1 = load float, float* %arrayidx, align 4 297 %tmp2 = tail call float @powf(float %conv, float %tmp1) 298 %arrayidx2 = getelementptr inbounds float, float* %varray, i64 %iv 299 store float %tmp2, float* %arrayidx2, align 4 300 %iv.next = add nuw nsw i64 %iv, 1 301 %exitcond = icmp eq i64 %iv.next, 1000 302 br i1 %exitcond, label %for.end, label %for.body 303 304for.end: 305 ret void 306} 307 308define void @pow_f32_intrinsic(float* nocapture %varray, float* nocapture readonly %exp) { 309; CHECK-LABEL: @pow_f32_intrinsic( 310; CHECK: [[TMP8:%.*]] = call <4 x float> @__svml_powf4(<4 x float> [[TMP4:%.*]], <4 x float> [[WIDE_LOAD:%.*]]) 311; CHECK: ret void 312; 313entry: 314 br label %for.body 315 316for.body: 317 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] 318 %tmp = trunc i64 %iv to i32 319 %conv = sitofp i32 %tmp to float 320 %arrayidx = getelementptr inbounds float, float* %exp, i64 %iv 321 %tmp1 = load float, float* %arrayidx, align 4 322 %tmp2 = tail call float @llvm.pow.f32(float %conv, float %tmp1) 323 %arrayidx2 = getelementptr inbounds float, float* %varray, i64 %iv 324 store float %tmp2, float* %arrayidx2, align 4 325 %iv.next = add nuw nsw i64 %iv, 1 326 %exitcond = icmp eq i64 %iv.next, 1000 327 br i1 %exitcond, label %for.end, label %for.body 328 329for.end: 330 ret void 331} 332 333define void @exp_f64(double* nocapture %varray) { 334; CHECK-LABEL: @exp_f64( 335; CHECK: [[TMP5:%.*]] = call <4 x double> @__svml_exp4(<4 x double> [[TMP4:%.*]]) 336; CHECK: ret void 337; 338entry: 339 br label %for.body 340 341for.body: 342 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] 343 %tmp = trunc i64 %iv to i32 344 %conv = sitofp i32 %tmp to double 345 %call = tail call double @exp(double %conv) 346 %arrayidx = getelementptr inbounds double, double* %varray, i64 %iv 347 store double %call, double* %arrayidx, align 4 348 %iv.next = add nuw nsw i64 %iv, 1 349 %exitcond = icmp eq i64 %iv.next, 1000 350 br i1 %exitcond, label %for.end, label %for.body 351 352for.end: 353 ret void 354} 355 356define void @exp_f32(float* nocapture %varray) { 357; CHECK-LABEL: @exp_f32( 358; CHECK: [[TMP5:%.*]] = call <4 x float> @__svml_expf4(<4 x float> [[TMP4:%.*]]) 359; CHECK: ret void 360; 361entry: 362 br label %for.body 363 364for.body: 365 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] 366 %tmp = trunc i64 %iv to i32 367 %conv = sitofp i32 %tmp to float 368 %call = tail call float @expf(float %conv) 369 %arrayidx = getelementptr inbounds float, float* %varray, i64 %iv 370 store float %call, float* %arrayidx, align 4 371 %iv.next = add nuw nsw i64 %iv, 1 372 %exitcond = icmp eq i64 %iv.next, 1000 373 br i1 %exitcond, label %for.end, label %for.body 374 375for.end: 376 ret void 377} 378 379define void @exp_f64_intrinsic(double* nocapture %varray) { 380; CHECK-LABEL: @exp_f64_intrinsic( 381; CHECK: [[TMP5:%.*]] = call <4 x double> @__svml_exp4(<4 x double> [[TMP4:%.*]]) 382; CHECK: ret void 383; 384entry: 385 br label %for.body 386 387for.body: 388 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] 389 %tmp = trunc i64 %iv to i32 390 %conv = sitofp i32 %tmp to double 391 %call = tail call double @llvm.exp.f64(double %conv) 392 %arrayidx = getelementptr inbounds double, double* %varray, i64 %iv 393 store double %call, double* %arrayidx, align 4 394 %iv.next = add nuw nsw i64 %iv, 1 395 %exitcond = icmp eq i64 %iv.next, 1000 396 br i1 %exitcond, label %for.end, label %for.body 397 398for.end: 399 ret void 400} 401 402define void @exp_f32_intrinsic(float* nocapture %varray) { 403; CHECK-LABEL: @exp_f32_intrinsic( 404; CHECK: [[TMP5:%.*]] = call <4 x float> @__svml_expf4(<4 x float> [[TMP4:%.*]]) 405; CHECK: ret void 406; 407entry: 408 br label %for.body 409 410for.body: 411 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] 412 %tmp = trunc i64 %iv to i32 413 %conv = sitofp i32 %tmp to float 414 %call = tail call float @llvm.exp.f32(float %conv) 415 %arrayidx = getelementptr inbounds float, float* %varray, i64 %iv 416 store float %call, float* %arrayidx, align 4 417 %iv.next = add nuw nsw i64 %iv, 1 418 %exitcond = icmp eq i64 %iv.next, 1000 419 br i1 %exitcond, label %for.end, label %for.body 420 421for.end: 422 ret void 423} 424 425define void @log_f64(double* nocapture %varray) { 426; CHECK-LABEL: @log_f64( 427; CHECK: [[TMP5:%.*]] = call <4 x double> @__svml_log4(<4 x double> [[TMP4:%.*]]) 428; CHECK: ret void 429; 430entry: 431 br label %for.body 432 433for.body: 434 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] 435 %tmp = trunc i64 %iv to i32 436 %conv = sitofp i32 %tmp to double 437 %call = tail call double @log(double %conv) 438 %arrayidx = getelementptr inbounds double, double* %varray, i64 %iv 439 store double %call, double* %arrayidx, align 4 440 %iv.next = add nuw nsw i64 %iv, 1 441 %exitcond = icmp eq i64 %iv.next, 1000 442 br i1 %exitcond, label %for.end, label %for.body 443 444for.end: 445 ret void 446} 447 448define void @log_f32(float* nocapture %varray) { 449; CHECK-LABEL: @log_f32( 450; CHECK: [[TMP5:%.*]] = call <4 x float> @__svml_logf4(<4 x float> [[TMP4:%.*]]) 451; CHECK: ret void 452; 453entry: 454 br label %for.body 455 456for.body: 457 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] 458 %tmp = trunc i64 %iv to i32 459 %conv = sitofp i32 %tmp to float 460 %call = tail call float @logf(float %conv) 461 %arrayidx = getelementptr inbounds float, float* %varray, i64 %iv 462 store float %call, float* %arrayidx, align 4 463 %iv.next = add nuw nsw i64 %iv, 1 464 %exitcond = icmp eq i64 %iv.next, 1000 465 br i1 %exitcond, label %for.end, label %for.body 466 467for.end: 468 ret void 469} 470 471define void @log_f64_intrinsic(double* nocapture %varray) { 472; CHECK-LABEL: @log_f64_intrinsic( 473; CHECK: [[TMP5:%.*]] = call <4 x double> @__svml_log4(<4 x double> [[TMP4:%.*]]) 474; CHECK: ret void 475; 476entry: 477 br label %for.body 478 479for.body: 480 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] 481 %tmp = trunc i64 %iv to i32 482 %conv = sitofp i32 %tmp to double 483 %call = tail call double @llvm.log.f64(double %conv) 484 %arrayidx = getelementptr inbounds double, double* %varray, i64 %iv 485 store double %call, double* %arrayidx, align 4 486 %iv.next = add nuw nsw i64 %iv, 1 487 %exitcond = icmp eq i64 %iv.next, 1000 488 br i1 %exitcond, label %for.end, label %for.body 489 490for.end: 491 ret void 492} 493 494define void @log_f32_intrinsic(float* nocapture %varray) { 495; CHECK-LABEL: @log_f32_intrinsic( 496; CHECK: [[TMP5:%.*]] = call <4 x float> @__svml_logf4(<4 x float> [[TMP4:%.*]]) 497; CHECK: ret void 498; 499entry: 500 br label %for.body 501 502for.body: 503 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] 504 %tmp = trunc i64 %iv to i32 505 %conv = sitofp i32 %tmp to float 506 %call = tail call float @llvm.log.f32(float %conv) 507 %arrayidx = getelementptr inbounds float, float* %varray, i64 %iv 508 store float %call, float* %arrayidx, align 4 509 %iv.next = add nuw nsw i64 %iv, 1 510 %exitcond = icmp eq i64 %iv.next, 1000 511 br i1 %exitcond, label %for.end, label %for.body 512 513for.end: 514 ret void 515} 516 517define void @log2_f64(double* nocapture %varray) { 518; CHECK-LABEL: @log2_f64( 519; CHECK: [[TMP5:%.*]] = call <4 x double> @__svml_log24(<4 x double> [[TMP4:%.*]]) 520; CHECK: ret void 521; 522entry: 523 br label %for.body 524 525for.body: 526 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] 527 %tmp = trunc i64 %iv to i32 528 %conv = sitofp i32 %tmp to double 529 %call = tail call double @log2(double %conv) 530 %arrayidx = getelementptr inbounds double, double* %varray, i64 %iv 531 store double %call, double* %arrayidx, align 4 532 %iv.next = add nuw nsw i64 %iv, 1 533 %exitcond = icmp eq i64 %iv.next, 1000 534 br i1 %exitcond, label %for.end, label %for.body 535 536for.end: 537 ret void 538} 539 540define void @log2_f32(float* nocapture %varray) { 541; CHECK-LABEL: @log2_f32( 542; CHECK: [[TMP5:%.*]] = call <4 x float> @__svml_log2f4(<4 x float> [[TMP4:%.*]]) 543; CHECK: ret void 544; 545entry: 546 br label %for.body 547 548for.body: 549 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] 550 %tmp = trunc i64 %iv to i32 551 %conv = sitofp i32 %tmp to float 552 %call = tail call float @log2f(float %conv) 553 %arrayidx = getelementptr inbounds float, float* %varray, i64 %iv 554 store float %call, float* %arrayidx, align 4 555 %iv.next = add nuw nsw i64 %iv, 1 556 %exitcond = icmp eq i64 %iv.next, 1000 557 br i1 %exitcond, label %for.end, label %for.body 558 559for.end: 560 ret void 561} 562 563define void @log2_f64_intrinsic(double* nocapture %varray) { 564; CHECK-LABEL: @log2_f64_intrinsic( 565; CHECK: [[TMP5:%.*]] = call <4 x double> @__svml_log24(<4 x double> [[TMP4:%.*]]) 566; CHECK: ret void 567; 568entry: 569 br label %for.body 570 571for.body: 572 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] 573 %tmp = trunc i64 %iv to i32 574 %conv = sitofp i32 %tmp to double 575 %call = tail call double @llvm.log2.f64(double %conv) 576 %arrayidx = getelementptr inbounds double, double* %varray, i64 %iv 577 store double %call, double* %arrayidx, align 4 578 %iv.next = add nuw nsw i64 %iv, 1 579 %exitcond = icmp eq i64 %iv.next, 1000 580 br i1 %exitcond, label %for.end, label %for.body 581 582for.end: 583 ret void 584} 585 586define void @log2_f32_intrinsic(float* nocapture %varray) { 587; CHECK-LABEL: @log2_f32_intrinsic( 588; CHECK: [[TMP5:%.*]] = call <4 x float> @__svml_log2f4(<4 x float> [[TMP4:%.*]]) 589; CHECK: ret void 590; 591entry: 592 br label %for.body 593 594for.body: 595 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] 596 %tmp = trunc i64 %iv to i32 597 %conv = sitofp i32 %tmp to float 598 %call = tail call float @llvm.log2.f32(float %conv) 599 %arrayidx = getelementptr inbounds float, float* %varray, i64 %iv 600 store float %call, float* %arrayidx, align 4 601 %iv.next = add nuw nsw i64 %iv, 1 602 %exitcond = icmp eq i64 %iv.next, 1000 603 br i1 %exitcond, label %for.end, label %for.body 604 605for.end: 606 ret void 607} 608 609define void @log10_f64(double* nocapture %varray) { 610; CHECK-LABEL: @log10_f64( 611; CHECK: [[TMP5:%.*]] = call <4 x double> @__svml_log104(<4 x double> [[TMP4:%.*]]) 612; CHECK: ret void 613; 614entry: 615 br label %for.body 616 617for.body: 618 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] 619 %tmp = trunc i64 %iv to i32 620 %conv = sitofp i32 %tmp to double 621 %call = tail call double @log10(double %conv) 622 %arrayidx = getelementptr inbounds double, double* %varray, i64 %iv 623 store double %call, double* %arrayidx, align 4 624 %iv.next = add nuw nsw i64 %iv, 1 625 %exitcond = icmp eq i64 %iv.next, 1000 626 br i1 %exitcond, label %for.end, label %for.body 627 628for.end: 629 ret void 630} 631 632define void @log10_f32(float* nocapture %varray) { 633; CHECK-LABEL: @log10_f32( 634; CHECK: [[TMP5:%.*]] = call <4 x float> @__svml_log10f4(<4 x float> [[TMP4:%.*]]) 635; CHECK: ret void 636; 637entry: 638 br label %for.body 639 640for.body: 641 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] 642 %tmp = trunc i64 %iv to i32 643 %conv = sitofp i32 %tmp to float 644 %call = tail call float @log10f(float %conv) 645 %arrayidx = getelementptr inbounds float, float* %varray, i64 %iv 646 store float %call, float* %arrayidx, align 4 647 %iv.next = add nuw nsw i64 %iv, 1 648 %exitcond = icmp eq i64 %iv.next, 1000 649 br i1 %exitcond, label %for.end, label %for.body 650 651for.end: 652 ret void 653} 654 655define void @log10_f64_intrinsic(double* nocapture %varray) { 656; CHECK-LABEL: @log10_f64_intrinsic( 657; CHECK: [[TMP5:%.*]] = call <4 x double> @__svml_log104(<4 x double> [[TMP4:%.*]]) 658; CHECK: ret void 659; 660entry: 661 br label %for.body 662 663for.body: 664 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] 665 %tmp = trunc i64 %iv to i32 666 %conv = sitofp i32 %tmp to double 667 %call = tail call double @llvm.log10.f64(double %conv) 668 %arrayidx = getelementptr inbounds double, double* %varray, i64 %iv 669 store double %call, double* %arrayidx, align 4 670 %iv.next = add nuw nsw i64 %iv, 1 671 %exitcond = icmp eq i64 %iv.next, 1000 672 br i1 %exitcond, label %for.end, label %for.body 673 674for.end: 675 ret void 676} 677 678define void @log10_f32_intrinsic(float* nocapture %varray) { 679; CHECK-LABEL: @log10_f32_intrinsic( 680; CHECK: [[TMP5:%.*]] = call <4 x float> @__svml_log10f4(<4 x float> [[TMP4:%.*]]) 681; CHECK: ret void 682; 683entry: 684 br label %for.body 685 686for.body: 687 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] 688 %tmp = trunc i64 %iv to i32 689 %conv = sitofp i32 %tmp to float 690 %call = tail call float @llvm.log10.f32(float %conv) 691 %arrayidx = getelementptr inbounds float, float* %varray, i64 %iv 692 store float %call, float* %arrayidx, align 4 693 %iv.next = add nuw nsw i64 %iv, 1 694 %exitcond = icmp eq i64 %iv.next, 1000 695 br i1 %exitcond, label %for.end, label %for.body 696 697for.end: 698 ret void 699} 700 701define void @sqrt_f64(double* nocapture %varray) { 702; CHECK-LABEL: @sqrt_f64( 703; CHECK: [[TMP5:%.*]] = call <4 x double> @__svml_sqrt4(<4 x double> [[TMP4:%.*]]) 704; CHECK: ret void 705; 706entry: 707 br label %for.body 708 709for.body: 710 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] 711 %tmp = trunc i64 %iv to i32 712 %conv = sitofp i32 %tmp to double 713 %call = tail call double @sqrt(double %conv) 714 %arrayidx = getelementptr inbounds double, double* %varray, i64 %iv 715 store double %call, double* %arrayidx, align 4 716 %iv.next = add nuw nsw i64 %iv, 1 717 %exitcond = icmp eq i64 %iv.next, 1000 718 br i1 %exitcond, label %for.end, label %for.body 719 720for.end: 721 ret void 722} 723 724define void @sqrt_f32(float* nocapture %varray) { 725; CHECK-LABEL: @sqrt_f32( 726; CHECK: [[TMP5:%.*]] = call <4 x float> @__svml_sqrtf4(<4 x float> [[TMP4:%.*]]) 727; CHECK: ret void 728; 729entry: 730 br label %for.body 731 732for.body: 733 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] 734 %tmp = trunc i64 %iv to i32 735 %conv = sitofp i32 %tmp to float 736 %call = tail call float @sqrtf(float %conv) 737 %arrayidx = getelementptr inbounds float, float* %varray, i64 %iv 738 store float %call, float* %arrayidx, align 4 739 %iv.next = add nuw nsw i64 %iv, 1 740 %exitcond = icmp eq i64 %iv.next, 1000 741 br i1 %exitcond, label %for.end, label %for.body 742 743for.end: 744 ret void 745} 746 747define void @exp2_f64(double* nocapture %varray) { 748; CHECK-LABEL: @exp2_f64( 749; CHECK: [[TMP5:%.*]] = call <4 x double> @__svml_exp24(<4 x double> [[TMP4:%.*]]) 750; CHECK: ret void 751; 752entry: 753 br label %for.body 754 755for.body: 756 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] 757 %tmp = trunc i64 %iv to i32 758 %conv = sitofp i32 %tmp to double 759 %call = tail call double @exp2(double %conv) 760 %arrayidx = getelementptr inbounds double, double* %varray, i64 %iv 761 store double %call, double* %arrayidx, align 4 762 %iv.next = add nuw nsw i64 %iv, 1 763 %exitcond = icmp eq i64 %iv.next, 1000 764 br i1 %exitcond, label %for.end, label %for.body 765 766for.end: 767 ret void 768} 769 770define void @exp2_f32(float* nocapture %varray) { 771; CHECK-LABEL: @exp2_f32( 772; CHECK: [[TMP5:%.*]] = call <4 x float> @__svml_exp2f4(<4 x float> [[TMP4:%.*]]) 773; CHECK: ret void 774; 775entry: 776 br label %for.body 777 778for.body: 779 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] 780 %tmp = trunc i64 %iv to i32 781 %conv = sitofp i32 %tmp to float 782 %call = tail call float @exp2f(float %conv) 783 %arrayidx = getelementptr inbounds float, float* %varray, i64 %iv 784 store float %call, float* %arrayidx, align 4 785 %iv.next = add nuw nsw i64 %iv, 1 786 %exitcond = icmp eq i64 %iv.next, 1000 787 br i1 %exitcond, label %for.end, label %for.body 788 789for.end: 790 ret void 791} 792 793define void @exp2_f64_intrinsic(double* nocapture %varray) { 794; CHECK-LABEL: @exp2_f64_intrinsic( 795; CHECK: [[TMP5:%.*]] = call <4 x double> @__svml_exp24(<4 x double> [[TMP4:%.*]]) 796; CHECK: ret void 797; 798entry: 799 br label %for.body 800 801for.body: 802 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] 803 %tmp = trunc i64 %iv to i32 804 %conv = sitofp i32 %tmp to double 805 %call = tail call double @llvm.exp2.f64(double %conv) 806 %arrayidx = getelementptr inbounds double, double* %varray, i64 %iv 807 store double %call, double* %arrayidx, align 4 808 %iv.next = add nuw nsw i64 %iv, 1 809 %exitcond = icmp eq i64 %iv.next, 1000 810 br i1 %exitcond, label %for.end, label %for.body 811 812for.end: 813 ret void 814} 815 816define void @exp2_f32_intrinsic(float* nocapture %varray) { 817; CHECK-LABEL: @exp2_f32_intrinsic( 818; CHECK: [[TMP5:%.*]] = call <4 x float> @__svml_exp2f4(<4 x float> [[TMP4:%.*]]) 819; CHECK: ret void 820; 821entry: 822 br label %for.body 823 824for.body: 825 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] 826 %tmp = trunc i64 %iv to i32 827 %conv = sitofp i32 %tmp to float 828 %call = tail call float @llvm.exp2.f32(float %conv) 829 %arrayidx = getelementptr inbounds float, float* %varray, i64 %iv 830 store float %call, float* %arrayidx, align 4 831 %iv.next = add nuw nsw i64 %iv, 1 832 %exitcond = icmp eq i64 %iv.next, 1000 833 br i1 %exitcond, label %for.end, label %for.body 834 835for.end: 836 ret void 837} 838 839attributes #0 = { nounwind readnone } 840