blob: d4814dc62609870dec6214292fac52f9684b51f4 [file] [log] [blame]
Simon Pilgrimfc4d4b22016-07-19 13:35:11 +00001; RUN: llc < %s -mtriple=arm64-eabi | FileCheck %s
Tim Northover5b06f272014-04-03 09:36:05 +00002
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
Robert Loughera9bf2462014-04-15 18:34:24 +00007; FIXME: This test is xfailed because it relies on an optimization that has
8; been reverted (see PR17975).
9; XFAIL: *
10
Tim Northover5b06f272014-04-03 09:36:05 +000011define void @foo(i64* nocapture %d) {
12; CHECK-LABEL: foo:
13; CHECK: rorv
David Blaikiea79ac142015-02-27 21:17:42 +000014 %tmp = load i64, i64* undef, align 8
Tim Northover5b06f272014-04-03 09:36:05 +000015 %sub397 = sub i64 0, %tmp
16 %and398 = and i64 %sub397, 4294967295
17 %shr404 = lshr i64 %and398, 0
18 %or405 = or i64 0, %shr404
19 %xor406 = xor i64 %or405, 0
20 %xor417 = xor i64 0, %xor406
21 %xor428 = xor i64 0, %xor417
22 %sub430 = sub i64 %xor417, 0
23 %and431 = and i64 %sub430, 4294967295
24 %and432 = and i64 %xor428, 31
25 %sub433 = sub i64 32, %and432
26 %shl434 = shl i64 %and431, %sub433
27 %shr437 = lshr i64 %and431, %and432
28 %or438 = or i64 %shl434, %shr437
29 %xor439 = xor i64 %or438, %xor428
30 %sub441 = sub i64 %xor439, 0
31 store i64 %sub441, i64* %d, align 8
32 ret void
33}