From: Tim Northover Date: Wed, 12 Oct 2016 22:48:36 +0000 (+0000) Subject: GlobalISel: mark G_BRCOND on s1 as legal. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=110db83eac2270a276aeefebde58cad70d449bee;p=llvm GlobalISel: mark G_BRCOND on s1 as legal. It's going to be a TBNZ (at -O0) anyway, so the high bits don't matter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284070 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/AArch64/AArch64MachineLegalizer.cpp b/lib/Target/AArch64/AArch64MachineLegalizer.cpp index adda760cb1d..4f921e8d8ef 100644 --- a/lib/Target/AArch64/AArch64MachineLegalizer.cpp +++ b/lib/Target/AArch64/AArch64MachineLegalizer.cpp @@ -156,9 +156,8 @@ AArch64MachineLegalizer::AArch64MachineLegalizer() { } // Control-flow - setAction({G_BRCOND, s32}, Legal); - for (auto Ty : {s1, s8, s16}) - setAction({G_BRCOND, Ty}, WidenScalar); + for (auto Ty : {s1, s8, s16, s32}) + setAction({G_BRCOND, Ty}, Legal); // Select for (auto Ty : {s1, s8, s16, s32, s64}) diff --git a/test/CodeGen/AArch64/GlobalISel/legalize-simple.mir b/test/CodeGen/AArch64/GlobalISel/legalize-simple.mir index 29cc49ff9d9..1817a910151 100644 --- a/test/CodeGen/AArch64/GlobalISel/legalize-simple.mir +++ b/test/CodeGen/AArch64/GlobalISel/legalize-simple.mir @@ -47,6 +47,7 @@ registers: - { id: 30, class: _ } - { id: 31, class: _ } - { id: 32, class: _ } + - { id: 33, class: _ } body: | bb.0.entry: liveins: %x0, %x1, %x2, %x3 @@ -58,8 +59,7 @@ body: | %1(p0) = G_INTTOPTR %0 %2(s64) = G_PTRTOINT %1 - ; CHECK: [[TST32:%[0-9]+]](s32) = G_ANYEXT %3 - ; CHECK: G_BRCOND [[TST32]](s32), %bb.1.next + ; CHECK: G_BRCOND %3(s1), %bb.1.next %3(s1) = G_TRUNC %0 G_BRCOND %3, %bb.1.next