For PR1319:
[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-upgrade < %s | llvm-as | opt -gcse -instcombine -dce | \
5 ; RUN:    llvm-dis | not grep sub
6
7 implementation   ; Functions:
8
9 uint "vnum_test4"(uint* %data) {
10         %idx1 = getelementptr uint* %data, uint 1
11         %idx2 = getelementptr uint* %data, uint 3
12         %reg1101 = load uint* %idx1
13         %reg1111 = load uint* %idx2
14         %reg109 = mul uint %reg1101, %reg1111
15         %reg108 = mul uint %reg1111, %reg1101
16         %reg121 = sub uint %reg108, %reg109
17         ret uint %reg121
18 }