Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 1 | ; Coalescing from R32 to a subset R32_. Once another register coalescer bug is |
| 2 | ; fixed, the movb should go away as well. |
| 3 | |
| 4 | ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -relocation-model=static | \ |
Dan Gohman | 65fa0cd | 2007-08-15 13:45:35 +0000 | [diff] [blame^] | 5 | ; RUN: grep movl |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 6 | |
| 7 | %B = external global uint |
| 8 | %C = external global ushort* |
| 9 | |
| 10 | void %test(uint %A) { |
| 11 | %A = cast uint %A to ubyte |
| 12 | %tmp2 = load uint* %B |
| 13 | %tmp3 = and ubyte %A, 16 |
| 14 | %tmp4 = shl uint %tmp2, ubyte %tmp3 |
| 15 | store uint %tmp4, uint* %B |
| 16 | %tmp6 = shr uint %A, ubyte 3 |
| 17 | %tmp = load ushort** %C |
| 18 | %tmp8 = cast ushort* %tmp to uint |
| 19 | %tmp9 = add uint %tmp8, %tmp6 |
| 20 | %tmp9 = cast uint %tmp9 to ushort* |
| 21 | store ushort* %tmp9, ushort** %C |
| 22 | ret void |
| 23 | } |