ARM64: fix fmsub patterns which assumed accum operand was first
[oota-llvm.git] / test / CodeGen / ARM64 / regress-interphase-shift.ll
1 ; RUN: llc -march=arm64 -o - %s | FileCheck %s
2
3 ; This is mostly a "don't assert" test. The type of the RHS of a shift depended
4 ; on the phase of legalization, which led to the creation of an unexpected and
5 ; unselectable "rotr" node: (i32 (rotr i32, i64)).
6
7 define void @foo(i64* nocapture %d) {
8 ; CHECK-LABEL: foo:
9 ; CHECK: rorv
10   %tmp = load i64* undef, align 8
11   %sub397 = sub i64 0, %tmp
12   %and398 = and i64 %sub397, 4294967295
13   %shr404 = lshr i64 %and398, 0
14   %or405 = or i64 0, %shr404
15   %xor406 = xor i64 %or405, 0
16   %xor417 = xor i64 0, %xor406
17   %xor428 = xor i64 0, %xor417
18   %sub430 = sub i64 %xor417, 0
19   %and431 = and i64 %sub430, 4294967295
20   %and432 = and i64 %xor428, 31
21   %sub433 = sub i64 32, %and432
22   %shl434 = shl i64 %and431, %sub433
23   %shr437 = lshr i64 %and431, %and432
24   %or438 = or i64 %shl434, %shr437
25   %xor439 = xor i64 %or438, %xor428
26   %sub441 = sub i64 %xor439, 0
27   store i64 %sub441, i64* %d, align 8
28   ret void
29 }