From 7de1d327f134286d8049adc7b06f92447b4bbecd Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Fri, 7 Jun 2013 22:55:05 +0000 Subject: [PATCH] Add missing zextloadi1 to i64 patterns. PR16721. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183587 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/Sparc/SparcInstr64Bit.td | 3 +++ test/CodeGen/SPARC/64bit.ll | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/lib/Target/Sparc/SparcInstr64Bit.td b/lib/Target/Sparc/SparcInstr64Bit.td index a37b1583dc8..9821ff402e3 100644 --- a/lib/Target/Sparc/SparcInstr64Bit.td +++ b/lib/Target/Sparc/SparcInstr64Bit.td @@ -239,6 +239,9 @@ def LDXri : F3_2<3, 0b001011, [(set i64:$dst, (load ADDRri:$addr))]>; // Extending loads to i64. +def : Pat<(i64 (zextloadi1 ADDRrr:$addr)), (LDUBrr ADDRrr:$addr)>; +def : Pat<(i64 (zextloadi1 ADDRri:$addr)), (LDUBri ADDRri:$addr)>; + def : Pat<(i64 (zextloadi8 ADDRrr:$addr)), (LDUBrr ADDRrr:$addr)>; def : Pat<(i64 (zextloadi8 ADDRri:$addr)), (LDUBri ADDRri:$addr)>; def : Pat<(i64 (extloadi8 ADDRrr:$addr)), (LDUBrr ADDRrr:$addr)>; diff --git a/test/CodeGen/SPARC/64bit.ll b/test/CodeGen/SPARC/64bit.ll index c8569419a21..a5ea4d90671 100644 --- a/test/CodeGen/SPARC/64bit.ll +++ b/test/CodeGen/SPARC/64bit.ll @@ -161,6 +161,14 @@ define i64 @loads(i64* %p, i32* %q, i32* %r, i16* %s) { ret i64 %x3 } +; CHECK: load_bool +; CHECK: ldub [%i0], %i0 +define i64 @load_bool(i1* %p) { + %a = load i1* %p + %b = zext i1 %a to i64 + ret i64 %b +} + ; CHECK: stores ; CHECK: ldx [%i0+8], [[R:%[goli][0-7]]] ; CHECK: stx [[R]], [%i0+16]