diff options
author | Juergen Ributzka <juergen@apple.com> | 2014-11-18 19:58:59 +0000 |
---|---|---|
committer | Juergen Ributzka <juergen@apple.com> | 2014-11-18 19:58:59 +0000 |
commit | 4328fd94b05d7364aa8b97fc2ded53573d5e9caf (patch) | |
tree | 9adcc7451ff575dbce488e50909e4803fd342be6 /llvm/test/CodeGen/AArch64/fast-isel-shift.ll | |
parent | 306baae3c4367c1efabface51d2773c4172e19bc (diff) | |
download | bcm5719-llvm-4328fd94b05d7364aa8b97fc2ded53573d5e9caf.tar.gz bcm5719-llvm-4328fd94b05d7364aa8b97fc2ded53573d5e9caf.zip |
[FastISel][AArch64] Fix shift-immediate emission for "zero" shifts.
This change emits a COPY for a shift-immediate with a "zero" shift value.
This fixes PR21594 where we emitted a shift instruction with an incorrect
immediate operand.
llvm-svn: 222247
Diffstat (limited to 'llvm/test/CodeGen/AArch64/fast-isel-shift.ll')
-rw-r--r-- | llvm/test/CodeGen/AArch64/fast-isel-shift.ll | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/llvm/test/CodeGen/AArch64/fast-isel-shift.ll b/llvm/test/CodeGen/AArch64/fast-isel-shift.ll index e4a3b860d2e..fd3ee27a4b6 100644 --- a/llvm/test/CodeGen/AArch64/fast-isel-shift.ll +++ b/llvm/test/CodeGen/AArch64/fast-isel-shift.ll @@ -1,4 +1,4 @@ -; RUN: llc -fast-isel -fast-isel-abort -mtriple=arm64-apple-darwin -verify-machineinstrs < %s | FileCheck %s +; RUN: llc -fast-isel -fast-isel-abort -mtriple=aarch64-apple-darwin -verify-machineinstrs < %s | FileCheck %s ; CHECK-LABEL: lsl_zext_i1_i16 ; CHECK: ubfiz {{w[0-9]*}}, {{w[0-9]*}}, #4, #1 @@ -404,3 +404,26 @@ define i32 @shift_test1(i8 %a) { ret i32 %3 } +; Test zero shifts + +; CHECK-LABEL: shl_zero +; CHECK-NOT: lsl +define i32 @shl_zero(i32 %a) { + %1 = shl i32 %a, 0 + ret i32 %1 +} + +; CHECK-LABEL: lshr_zero +; CHECK-NOT: lsr +define i32 @lshr_zero(i32 %a) { + %1 = lshr i32 %a, 0 + ret i32 %1 +} + +; CHECK-LABEL: ashr_zero +; CHECK-NOT: asr +define i32 @ashr_zero(i32 %a) { + %1 = ashr i32 %a, 0 + ret i32 %1 +} + |