[PATCH] D11393: [X86] Allow X86::COND_NE_OR_P and X86::COND_NP_OR_E to be reversed.

David Li via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 22 11:48:29 PST 2016


davidxl added a comment.

For the new suggested test case, I am thinking a code with

%cmp = fcmp une float %f, 0.000000e+00
 br i1 %cmp, label %if.then, label %if.end

With the branch probably annotated with profile data to enable the reordering we want.


================
Comment at: test/CodeGen/X86/block-placement.ll:669
@@ -669,4 +668,3 @@
 ; CHECK: %entry
-; CHECK: %foo
 ; CHECK: %bar
 ; CHECK: %exit
----------------
congh wrote:
> davidxl wrote:
> > use check-next for more strict checking.
> However, we cannot use CHECK-NEXT here. The output is:
> 
> 
> ```
> unanalyzable_branch_to_best_succ:       # @unanalyzable_branch_to_best_succ
> 	.cfi_startproc
> # BB#0:                                 # %entry
> 	subl	$12, %esp
> .Ltmp39:
> 	.cfi_def_cfa_offset 16
> 	testb	$1, 16(%esp)
> 	je	.LBB16_1
> .LBB16_2:                               # %bar
> 	calll	f
> .LBB16_3:                               # %exit
> 	addl	$12, %esp
> 	retl
> .LBB16_1:                               # %foo
> 	fldz
> 	fucomp	%st(0)
> 	fnstsw	%ax
> 	sahf
> 	jne	.LBB16_2
> 	jnp	.LBB16_3
> 	jmp	.LBB16_2
> ```
Can you use the following to enforce the order..

; CHECK-DAG:  #entry
; CHECK-NOT:  <something>
; CHECK-DAG: #bar 




http://reviews.llvm.org/D11393





More information about the llvm-commits mailing list