summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/jump_sign.ll
diff options
context:
space:
mode:
authorManman Ren <mren@apple.com>2012-07-09 18:57:12 +0000
committerManman Ren <mren@apple.com>2012-07-09 18:57:12 +0000
commit6209364834a4c0ca720d3fcc9ef7fa4c1fb39ecc (patch)
treedbc2b4ad71d75e1867db2dd6e787306f25468e1a /test/CodeGen/X86/jump_sign.ll
parent241b77fa451f8076e47c37212028454ad52ece15 (diff)
downloadllvm-6209364834a4c0ca720d3fcc9ef7fa4c1fb39ecc.tar.gz
llvm-6209364834a4c0ca720d3fcc9ef7fa4c1fb39ecc.tar.bz2
llvm-6209364834a4c0ca720d3fcc9ef7fa4c1fb39ecc.tar.xz
X86: implement functions to analyze & synthesize CMOV|SET|Jcc
getCondFromSETOpc, getCondFromCMovOpc, getSETFromCond, getCMovFromCond No functional change intended. If we want to update the condition code of CMOV|SET|Jcc, we first analyze the opcode to get the condition code, then update the condition code, finally synthesize the new opcode form the new condition code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159955 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/jump_sign.ll')
-rw-r--r--test/CodeGen/X86/jump_sign.ll17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/CodeGen/X86/jump_sign.ll b/test/CodeGen/X86/jump_sign.ll
index e84f49c8a1..b868218eca 100644
--- a/test/CodeGen/X86/jump_sign.ll
+++ b/test/CodeGen/X86/jump_sign.ll
@@ -120,6 +120,23 @@ if.then:
if.else:
ret i32 %sub
}
+define i32 @l3(i32 %a, i32 %b) nounwind {
+entry:
+; CHECK: l3:
+; CHECK: sub
+; CHECK-NOT: cmp
+; CHECK: jge
+ %cmp = icmp sgt i32 %b, %a
+ %sub = sub nsw i32 %a, %b
+ br i1 %cmp, label %if.then, label %if.else
+
+if.then:
+ ret i32 %sub
+
+if.else:
+ %add = add nsw i32 %sub, 1
+ ret i32 %add
+}
; rdar://11540023
define i32 @n(i32 %x, i32 %y) nounwind {
entry: