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

Cong Hou via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 22 11:26:28 PST 2016


congh marked 5 inline comments as done.
congh added a comment.

In http://reviews.llvm.org/D11393#332842, @davidxl wrote:

> Can we also add a test case that test this:
>
> jcc1   BB1
>  jncc2 BB2
>
> BB1:     // cold
>  ...
> BB2:
>  ..
>
> can be ordered 
>  correctly  into
>  jxxx ...
>  jxxx ...
> BB2:
>  ...
> BB1:


Can we write LLVM IR to express this test case?


================
Comment at: test/CodeGen/X86/block-placement.ll:669
@@ -669,4 +668,3 @@
 ; CHECK: %entry
-; CHECK: %foo
 ; CHECK: %bar
 ; CHECK: %exit
----------------
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
```


http://reviews.llvm.org/D11393





More information about the llvm-commits mailing list