new bswap idiom
[oota-llvm.git] / test / Transforms / GCSE / 2002-05-14-OperandSwap.ll
1 ; This entire chain of computation should be optimized away, but
2 ; wasn't because the two multiplies were not detected as being identical.
3 ;
4 ; RUN: llvm-as < %s  | opt -gcse -instcombine -dce | llvm-dis | not grep sub
5
6 implementation   ; Functions:
7
8 uint "vnum_test4"(uint* %data) {
9         %idx1 = getelementptr uint* %data, uint 1
10         %idx2 = getelementptr uint* %data, uint 3
11         %reg1101 = load uint* %idx1
12         %reg1111 = load uint* %idx2
13         %reg109 = mul uint %reg1101, %reg1111
14         %reg108 = mul uint %reg1111, %reg1101
15         %reg121 = sub uint %reg108, %reg109
16         ret uint %reg121
17 }