File: 2006-01-19-ISelFoldingBug.ll

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 (16 lines) | stat: -rw-r--r-- 459 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | \
; RUN:   grep shld | count 1
;
; Check that the isel does not fold the shld, which already folds a load
; and has two uses, into a store.
%A = external global uint

uint %test5(uint %B, ubyte %C) {
	%tmp.1 = load uint *%A;
	%tmp.2 = shl uint %tmp.1, ubyte %C
	%tmp.3 = sub ubyte 32, %C
	%tmp.4 = shr uint %B, ubyte %tmp.3
	%tmp.5 = or uint %tmp.4, %tmp.2
	store uint %tmp.5, uint* %A
	ret uint %tmp.5
}