xref: /llvm-project/llvm/test/Transforms/LoopVectorize/fcmp-vectorize.ll (revision 2e14900db9a8c2e03f9933ed2222825454905214)
1*2e14900dSBjorn Pettersson; RUN: opt -passes=loop-vectorize -force-vector-width=4 -force-vector-interleave=1 -S %s | FileCheck %s
2cee313d2SEric Christopher
3cee313d2SEric Christopher; Avoid crashing while trying to vectorize fcmp that can be folded to vector of
4cee313d2SEric Christopher; i1 true.
5cee313d2SEric Christopherdefine void @test1() {
6872f7000SDávid Bolvanský; CHECK-LABEL: test1(
7872f7000SDávid Bolvanský; CHECK-LABEL: vector.body:
8872f7000SDávid Bolvanský; CHECK-NEXT:    %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
9872f7000SDávid Bolvanský; CHECK:         %index.next = add nuw i32 %index, 4
10cee313d2SEric Christopher
11cee313d2SEric Christopherentry:
12cee313d2SEric Christopher  br label %loop
13cee313d2SEric Christopher
14cee313d2SEric Christopherloop:                                              ; preds = %loop, %entry
15cee313d2SEric Christopher  %iv = phi i32 [ 0, %entry ], [ %ivnext, %loop ]
16cee313d2SEric Christopher  %fcmp = fcmp uno float 0.000000e+00, 0.000000e+00
17cee313d2SEric Christopher  %ivnext = add nsw i32 %iv, 1
18cee313d2SEric Christopher  %cnd = icmp sgt i32 %iv, 142
19cee313d2SEric Christopher  br i1 %cnd, label %exit, label %loop
20cee313d2SEric Christopher
21cee313d2SEric Christopherexit:                                              ; preds = %loop
22cee313d2SEric Christopher  ret void
23cee313d2SEric Christopher}
24