brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 25ac510 Raw
30 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 52; RUN: opt -passes='default<O1>' -S < %s | FileCheck %s3 4; Following test must generate fabs intrinsic. It goes through following stages5; 1. SROA propagates the nsz function attribute on the phi node.6; 2. SimplifyCFG pass converts phi node to select.7; 3. InstCombine converts select with nsz flag into fabs intrinsic.8 9define double @fabs_fcmp_olt_nsz_func_attr(double %0, double %1) "no-signed-zeros-fp-math"="true" {10; CHECK-LABEL: define double @fabs_fcmp_olt_nsz_func_attr(11; CHECK-SAME: double [[TMP0:%.*]], double [[TMP1:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {12; CHECK-NEXT:  [[ENTRY:.*:]]13; CHECK-NEXT:    [[X_0:%.*]] = tail call nnan nsz double @llvm.fabs.f64(double [[TMP0]])14; CHECK-NEXT:    ret double [[X_0]]15entry:16  %x = alloca double17  store	double %0, ptr %x18  %cmp = fcmp nnan nsz olt double %0, 0.000000e+0019  br i1 %cmp, label %if.then, label %return20 21if.then:                         ; preds = %entry22  %fneg = fneg nnan nsz double %023  store double %fneg, ptr %x24  br label %return25 26return:                          ; preds = %entry, %if.then27  %ret = load double, ptr %x28  ret double %ret29}30