File: 2003-12-19-MergeReturn.llx

package info (click to toggle)
llvm 2.2-12
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 38,648 kB
  • ctags: 28,258
  • sloc: cpp: 215,479; sh: 12,132; ansic: 10,002; yacc: 5,525; perl: 2,352; ml: 1,580; makefile: 956; pascal: 718; lex: 602; exp: 320; ada: 193; lisp: 160; csh: 116; objc: 59; python: 59; tcl: 20
file content (28 lines) | stat: -rw-r--r-- 747 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
; This testcase was failing because without merging the return blocks, ADCE
; didn't know that it could get rid of the then.0 block.

; RUN: llvm-upgrade < %s | llvm-as | opt -adce | llvm-dis | not grep load


implementation   ; Functions:

void %main(uint %argc, sbyte** %argv) {
entry:
	call void %__main( )
	%tmp.1 = setle uint %argc, 5		; <bool> [#uses=1]
	br bool %tmp.1, label %then.0, label %return

then.0:		; preds = %entry
	%tmp.8 = load sbyte** %argv		; <sbyte*> [#uses=1]
	%tmp.10 = load sbyte* %tmp.8		; <sbyte> [#uses=1]
	%tmp.11 = seteq sbyte %tmp.10, 98		; <bool> [#uses=1]
	br bool %tmp.11, label %then.1, label %return

then.1:		; preds = %then.0
	ret void

return:		; preds = %entry, %then.0
	ret void
}

declare void %__main()