New testcase
[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: if as < %s  | opt -gcse -instcombine -dce | dis | grep sub
5 ; RUN: then exit 1
6 ; RUN: else exit 0
7 ; RUN: fi
8
9 implementation   ; Functions:
10
11 uint "vnum_test4"(uint* %data) {
12         %reg1101 = load uint* %data, uint 1
13         %reg1111 = load uint* %data, uint 3
14         %reg109 = mul uint %reg1101, %reg1111
15         %reg108 = mul uint %reg1111, %reg1101
16         %reg121 = sub uint %reg108, %reg109
17         ret uint %reg121
18 }