Files
clang-p2996/llvm/test/Transforms/SLPVectorizer/X86/reduce-constants.ll
Alexey Bataev c411965820 [SLP]Fix PR61224: Compiler hits infinite loop.
IRBuilder in many cases is able to fold constant code automatically,
but in some cases (for some intrinsics) it cannot do it. Need to perform
manual calculation, if constant provided in these corner cases, to avoid
infinite loop.
2023-03-06 13:46:41 -08:00

19 lines
783 B
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -mtriple=x86_64 -passes=slp-vectorizer < %s | FileCheck %s
define double @test(double %m, double %a) {
; CHECK-LABEL: @test(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[TMP0:%.*]] = call fast double @llvm.maxnum.f64(double 0.000000e+00, double [[M:%.*]])
; CHECK-NEXT: [[TMP1:%.*]] = call fast double @llvm.maxnum.f64(double [[TMP0]], double [[A:%.*]])
; CHECK-NEXT: ret double [[TMP1]]
;
entry:
%c = tail call fast double @llvm.maxnum.f64(double %m, double 0.000000e+00)
%c1 = tail call fast double @llvm.maxnum.f64(double %a, double %c)
%c2 = tail call fast double @llvm.maxnum.f64(double %c1, double 0.000000e+00)
ret double %c2
}
declare double @llvm.maxnum.f64(double, double)