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.

llvm-svn: 284070
This commit is contained in:
Tim Northover 2016-10-12 22:48:36 +00:00
parent 1edd169e4b
commit 6aacd27cd7
2 changed files with 4 additions and 5 deletions

View File

@ -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})

View File

@ -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