diff options
| author | Tim Northover <tnorthover@apple.com> | 2016-07-22 20:03:43 +0000 |
|---|---|---|
| committer | Tim Northover <tnorthover@apple.com> | 2016-07-22 20:03:43 +0000 |
| commit | 33b07d6725ab32e20ebeb62707be21c35a66390c (patch) | |
| tree | 3347fbfe37618df37e8da560e0e29c65fda6d3c1 /llvm/test/CodeGen | |
| parent | e4a4f33daf7f05a058d7d72e5a3019f1194b597b (diff) | |
| download | bcm5719-llvm-33b07d6725ab32e20ebeb62707be21c35a66390c.tar.gz bcm5719-llvm-33b07d6725ab32e20ebeb62707be21c35a66390c.zip | |
GlobalISel: implement legalization pass, with just one transformation.
This adds the actual MachineLegalizeHelper to do the work and a trivial pass
wrapper that legalizes all instructions in a MachineFunction. Currently the
only transformation supported is splitting up a vector G_ADD into one acting on
smaller vectors.
llvm-svn: 276461
Diffstat (limited to 'llvm/test/CodeGen')
| -rw-r--r-- | llvm/test/CodeGen/AArch64/GlobalISel/legalize-add.mir | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AArch64/GlobalISel/legalize-add.mir b/llvm/test/CodeGen/AArch64/GlobalISel/legalize-add.mir new file mode 100644 index 00000000000..cf777eea604 --- /dev/null +++ b/llvm/test/CodeGen/AArch64/GlobalISel/legalize-add.mir @@ -0,0 +1,34 @@ +# RUN: llc -O0 -run-pass=legalize-mir -global-isel %s -o - 2>&1 | FileCheck %s +# REQUIRES: global-isel + +--- | + target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128" + target triple = "aarch64-apple-ios" + define void @test_vector_add() { + entry: + ret void + } +... + +--- +name: test_vector_add +isSSA: true +registers: + - { id: 0, class: _ } + - { id: 1, class: _ } + - { id: 2, class: _ } +body: | + bb.0.entry: + liveins: %q0, %q1, %q2, %q3 + ; CHECK-LABEL: name: test_vector_add + ; CHECK-DAG: [[LHS_LO:%.*]](128), [[LHS_HI:%.*]](128) = G_EXTRACT <2 x s64> %0, 0, 128 + ; CHECK-DAG: [[RHS_LO:%.*]](128), [[RHS_HI:%.*]](128) = G_EXTRACT <2 x s64> %1, 0, 128 + ; CHECK: [[RES_LO:%.*]](128) = G_ADD <2 x s64> [[LHS_LO]], [[RHS_LO]] + ; CHECK: [[RES_HI:%.*]](128) = G_ADD <2 x s64> [[LHS_HI]], [[RHS_HI]] + ; CHECK: %2(256) = G_SEQUENCE <4 x s64> [[RES_LO]], [[RES_HI]] + + %0(256) = G_SEQUENCE <4 x s64> %q0, %q1 + %1(256) = G_SEQUENCE <4 x s64> %q2, %q3 + %2(256) = G_ADD <4 x s64> %0, %1 + %q0, %q1 = G_EXTRACT <2 x s64> %2, 0, 128 +... |

