]> granicus.if.org Git - llvm/commitdiff
[X86MacroFusion][NFC] Add a bulldozer test.
authorClement Courbet <courbet@google.com>
Wed, 27 Mar 2019 17:44:16 +0000 (17:44 +0000)
committerClement Courbet <courbet@google.com>
Wed, 27 Mar 2019 17:44:16 +0000 (17:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357099 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/LoopStrengthReduce/X86/macro-fuse-cmp.ll

index ba0da164916bfe024f11c0816f526f7b323cde1f..21a1799fc7cadd1363561355f6b7fd79bc505ff7 100644 (file)
@@ -1,5 +1,6 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
 ; RUN: opt < %s -loop-reduce -mcpu=btver2  -S | FileCheck %s --check-prefix=JAG
+; RUN: opt < %s -loop-reduce -mcpu=bdver2  -S | FileCheck %s --check-prefix=BUL
 ; RUN: opt < %s -loop-reduce -mcpu=haswell -S | FileCheck %s --check-prefix=HSW
 
 ; RUN: llc < %s                    | FileCheck %s --check-prefix=BASE
@@ -41,6 +42,28 @@ define void @maxArray(double* noalias nocapture %x, double* noalias nocapture re
 ; JAG:       exit:
 ; JAG-NEXT:    ret void
 ;
+; BUL-LABEL: @maxArray(
+; BUL-NEXT:  entry:
+; BUL-NEXT:    br label [[VECTOR_BODY:%.*]]
+; BUL:       vector.body:
+; BUL-NEXT:    [[INDEX:%.*]] = phi i64 [ 0, [[ENTRY:%.*]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ]
+; BUL-NEXT:    [[SCEVGEP4:%.*]] = getelementptr double, double* [[X:%.*]], i64 [[INDEX]]
+; BUL-NEXT:    [[SCEVGEP45:%.*]] = bitcast double* [[SCEVGEP4]] to <2 x double>*
+; BUL-NEXT:    [[SCEVGEP:%.*]] = getelementptr double, double* [[Y:%.*]], i64 [[INDEX]]
+; BUL-NEXT:    [[SCEVGEP1:%.*]] = bitcast double* [[SCEVGEP]] to <2 x double>*
+; BUL-NEXT:    [[XVAL:%.*]] = load <2 x double>, <2 x double>* [[SCEVGEP45]], align 8
+; BUL-NEXT:    [[YVAL:%.*]] = load <2 x double>, <2 x double>* [[SCEVGEP1]], align 8
+; BUL-NEXT:    [[CMP:%.*]] = fcmp ogt <2 x double> [[YVAL]], [[XVAL]]
+; BUL-NEXT:    [[MAX:%.*]] = select <2 x i1> [[CMP]], <2 x double> [[YVAL]], <2 x double> [[XVAL]]
+; BUL-NEXT:    [[SCEVGEP2:%.*]] = getelementptr double, double* [[X]], i64 [[INDEX]]
+; BUL-NEXT:    [[SCEVGEP23:%.*]] = bitcast double* [[SCEVGEP2]] to <2 x double>*
+; BUL-NEXT:    store <2 x double> [[MAX]], <2 x double>* [[SCEVGEP23]], align 8
+; BUL-NEXT:    [[INDEX_NEXT]] = add i64 [[INDEX]], 2
+; BUL-NEXT:    [[DONE:%.*]] = icmp eq i64 [[INDEX_NEXT]], 65536
+; BUL-NEXT:    br i1 [[DONE]], label [[EXIT:%.*]], label [[VECTOR_BODY]]
+; BUL:       exit:
+; BUL-NEXT:    ret void
+;
 ; HSW-LABEL: @maxArray(
 ; HSW-NEXT:  entry:
 ; HSW-NEXT:    br label [[VECTOR_BODY:%.*]]
@@ -77,7 +100,6 @@ define void @maxArray(double* noalias nocapture %x, double* noalias nocapture re
 ; BASE-NEXT:    jne .LBB0_1
 ; BASE-NEXT:  # %bb.2: # %exit
 ; BASE-NEXT:    retq
-;
 ; FUSE-LABEL: maxArray:
 ; FUSE:       # %bb.0: # %entry
 ; FUSE-NEXT:    xorl %eax, %eax