From 205065ae0ccbc0c4910746c216df8d5e523ee159 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 23 Feb 2006 05:17:43 +0000 Subject: [PATCH] add a small and simple case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26326 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/README.txt | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/lib/Target/X86/README.txt b/lib/Target/X86/README.txt index f479712d7c5..941d52294b9 100644 --- a/lib/Target/X86/README.txt +++ b/lib/Target/X86/README.txt @@ -506,3 +506,31 @@ and ISD::FMAX node types? //===---------------------------------------------------------------------===// Select (add, x, GlobalAddress) to ADD32ri, etc. when it's appropriate. + +//===---------------------------------------------------------------------===// + +The first BB of this code: + +declare bool %foo() +int %bar() { + %V = call bool %foo() + br bool %V, label %T, label %F +T: + ret int 1 +F: + call bool %foo() + ret int 12 +} + +compiles to: + +_bar: + subl $12, %esp + call L_foo$stub + xorb $1, %al + testb %al, %al + jne LBB_bar_2 # F + +It would be better to emit "cmp %al, 1" than a xor and test. + +