[AArch64] Implement the isZExtFree APIs.
[oota-llvm.git] / test / CodeGen / AArch64 / free-zext.ll
1 ; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu | FileCheck %s
2
3 define i64 @test_free_zext(i8* %a, i16* %b) {
4 ; CHECK-LABEL: test_free_zext
5 ; CHECK: ldrb w0, [x0]
6 ; CHECK: ldrh w1, [x1]
7 ; CHECK: add x0, x1, x0
8   %1 = load i8* %a, align 1
9   %conv = zext i8 %1 to i64
10   %2 = load i16* %b, align 2
11   %conv1 = zext i16 %2 to i64
12   %add = add nsw i64 %conv1, %conv
13   ret i64 %add
14 }