[llvm] r281196 - AVX-512: Added a test case that should be optimized in the future. NFC.

Elena Demikhovsky via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 11 23:26:03 PDT 2016


Author: delena
Date: Mon Sep 12 01:26:03 2016
New Revision: 281196

URL: http://llvm.org/viewvc/llvm-project?rev=281196&view=rev
Log:
AVX-512: Added a test case that should be optimized in the future. NFC.


Modified:
    llvm/trunk/test/CodeGen/X86/avx512-i1test.ll

Modified: llvm/trunk/test/CodeGen/X86/avx512-i1test.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/avx512-i1test.ll?rev=281196&r1=281195&r2=281196&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/avx512-i1test.ll (original)
+++ llvm/trunk/test/CodeGen/X86/avx512-i1test.ll Mon Sep 12 01:26:03 2016
@@ -1,30 +1,30 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=knl | FileCheck %s
+; RUN: llc < %s -mattr=+avx512f | FileCheck %s  --check-prefix=CHECK --check-prefix=KNL
+; RUN: llc < %s -mattr=+avx512f -mattr=+avx512vl -mattr=+avx512bw -mattr=+avx512dq | FileCheck %s  --check-prefix=CHECK --check-prefix=SKX
 
-; ModuleID = 'bugpoint-reduced-simplified.bc'
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
 define void @func() {
 ; CHECK-LABEL: func:
-; CHECK:       ## BB#0: ## %L_10
+; CHECK:       # BB#0: # %L_10
 ; CHECK-NEXT:    xorl %eax, %eax
 ; CHECK-NEXT:    testb %al, %al
-; CHECK-NEXT:    je LBB0_1
-; CHECK-NEXT:  ## BB#4: ## %L_30
+; CHECK-NEXT:    je .LBB0_1
+; CHECK-NEXT:  # BB#4: # %L_30
 ; CHECK-NEXT:    retq
-; CHECK-NEXT:  LBB0_1: ## %bb56
+; CHECK-NEXT:  .LBB0_1: # %bb56
 ; CHECK-NEXT:    xorl %eax, %eax
-; CHECK-NEXT:    jmp LBB0_2
+; CHECK-NEXT:    jmp .LBB0_2
 ; CHECK-NEXT:    .p2align 4, 0x90
-; CHECK-NEXT:  LBB0_3: ## %bb35
-; CHECK-NEXT:    ## in Loop: Header=BB0_2 Depth=1
+; CHECK-NEXT:  .LBB0_3: # %bb35
+; CHECK-NEXT:    # in Loop: Header=BB0_2 Depth=1
 ; CHECK-NEXT:    testb %al, %al
-; CHECK-NEXT:  LBB0_2: ## %bb33
-; CHECK-NEXT:    ## =>This Inner Loop Header: Depth=1
+; CHECK-NEXT:  .LBB0_2: # %bb33
+; CHECK-NEXT:    # =>This Inner Loop Header: Depth=1
 ; CHECK-NEXT:    testb %al, %al
-; CHECK-NEXT:    jne LBB0_2
-; CHECK-NEXT:    jmp LBB0_3
+; CHECK-NEXT:    jne .LBB0_2
+; CHECK-NEXT:    jmp .LBB0_3
 bb1:
   br i1 undef, label %L_10, label %L_10
 
@@ -60,3 +60,38 @@ bb51:
 L_30:                                             ; preds = %bb51, %L_10
   ret void
 }
+
+; The following test generates suboptimal code on AVX-512
+; PR 28175
+define i64 @func2(i1 zeroext %i, i32 %j) {
+; CHECK-LABEL: func2:
+; CHECK:       # BB#0: # %entry
+; CHECK-NEXT:    testl %esi, %esi
+; CHECK-NEXT:    je .LBB1_1
+; CHECK-NEXT:  # BB#2: # %if.then
+; CHECK-NEXT:    jmp bar # TAILCALL
+; CHECK-NEXT:  .LBB1_1: # %return
+; CHECK-NEXT:    andl $1, %edi
+; CHECK-NEXT:    kmovw %edi, %k0
+; CHECK-NEXT:    kmovw %k0, %eax
+; CHECK-NEXT:    orq $-2, %rax
+; CHECK-NEXT:    retq
+entry:
+  %tobool = icmp eq i32 %j, 0
+  br i1 %tobool, label %if.end, label %if.then
+
+if.then:                                          ; preds = %entry
+  %call = tail call i64 @bar()
+  br label %return
+
+if.end:                                           ; preds = %entry
+  %conv = zext i1 %i to i64
+  %or = or i64 %conv, -2
+  br label %return
+
+return:                                           ; preds = %if.end, %if.then
+  %or.sink = phi i64 [ %or, %if.end ], [ %call, %if.then ]
+  ret i64 %or.sink
+}
+
+declare i64 @bar()




More information about the llvm-commits mailing list