[llvm] r279840 - GlobalISel: mark selects legal
Tim Northover via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 26 10:46:04 PDT 2016
Author: tnorthover
Date: Fri Aug 26 12:46:03 2016
New Revision: 279840
URL: http://llvm.org/viewvc/llvm-project?rev=279840&view=rev
Log:
GlobalISel: mark selects legal
Modified:
llvm/trunk/lib/Target/AArch64/AArch64MachineLegalizer.cpp
llvm/trunk/test/CodeGen/AArch64/GlobalISel/legalize-simple.mir
Modified: llvm/trunk/lib/Target/AArch64/AArch64MachineLegalizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64MachineLegalizer.cpp?rev=279840&r1=279839&r2=279840&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64MachineLegalizer.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64MachineLegalizer.cpp Fri Aug 26 12:46:03 2016
@@ -141,6 +141,12 @@ AArch64MachineLegalizer::AArch64MachineL
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);
Modified: llvm/trunk/test/CodeGen/AArch64/GlobalISel/legalize-simple.mir
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/GlobalISel/legalize-simple.mir?rev=279840&r1=279839&r2=279840&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/GlobalISel/legalize-simple.mir (original)
+++ llvm/trunk/test/CodeGen/AArch64/GlobalISel/legalize-simple.mir Fri Aug 26 12:46:03 2016
@@ -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
...
More information about the llvm-commits
mailing list