GlobalISel: mark selects legal

llvm-svn: 279840
This commit is contained in:
Tim Northover 2016-08-26 17:46:03 +00:00
parent 5d0eaa4e79
commit 1d18a99a53
2 changed files with 22 additions and 0 deletions

View File

@ -141,6 +141,12 @@ AArch64MachineLegalizer::AArch64MachineLegalizer() {
for (auto Ty : {s1, s8, s16})
setAction({G_BRCOND, Ty}, WidenScalar);
// Select
for (auto Ty : {s1, s8, s16, s32, s64})
setAction({G_SELECT, Ty}, Legal);
setAction({G_SELECT, 1, s1}, Legal);
// Pointer-handling
setAction({G_FRAME_INDEX, p0}, Legal);

View File

@ -39,6 +39,11 @@ registers:
- { id: 22, class: _ }
- { id: 23, class: _ }
- { id: 24, class: _ }
- { id: 25, class: _ }
- { id: 26, class: _ }
- { id: 27, class: _ }
- { id: 28, class: _ }
- { id: 29, class: _ }
body: |
bb.0.entry:
liveins: %x0, %x1, %x2, %x3
@ -101,4 +106,15 @@ body: |
%22(64) = G_SITOFP { s64, s16 } %7
%23(64) = G_UITOFP { s64, s32 } %4
%24(64) = G_SITOFP { s64, s64 } %0
; CHECK: %25(1) = G_SELECT { s1, s1 } %10, %10, %5
; CHECK: %26(8) = G_SELECT { s8, s1 } %10, %6, %11
; CHECK: %27(16) = G_SELECT { s16, s1 } %10, %12, %7
; CHECK: %28(32) = G_SELECT { s32, s1 } %10, %15, %16
; CHECK: %29(64) = G_SELECT { s64, s1 } %10, %9, %24
%25(1) = G_SELECT { s1, s1 } %10, %10, %5
%26(8) = G_SELECT { s8, s1 } %10, %6, %11
%27(16) = G_SELECT { s16, s1 } %10, %12, %7
%28(32) = G_SELECT { s32, s1 } %10, %15, %16
%29(64) = G_SELECT { s64, s1 } %10, %9, %24
...