[PATCH] D33115: AMDGPU/GlobalISel: Mark 32-bit integer constants as legal
Tom Stellard via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri May 12 10:00:12 PDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL302919: AMDGPU/GlobalISel: Mark 32-bit integer constants as legal (authored by tstellar).
Changed prior to commit:
https://reviews.llvm.org/D33115?vs=98720&id=98794#toc
Repository:
rL LLVM
https://reviews.llvm.org/D33115
Files:
llvm/trunk/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
llvm/trunk/test/CodeGen/AMDGPU/GlobalISel/legalize-constant.mir
Index: llvm/trunk/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
===================================================================
--- llvm/trunk/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
@@ -33,6 +33,7 @@
const LLT P1 = LLT::pointer(1, 64);
const LLT P2 = LLT::pointer(2, 64);
+ setAction({G_CONSTANT, S32}, Legal);
setAction({G_CONSTANT, S64}, Legal);
setAction({G_GEP, P1}, Legal);
Index: llvm/trunk/test/CodeGen/AMDGPU/GlobalISel/legalize-constant.mir
===================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/GlobalISel/legalize-constant.mir
+++ llvm/trunk/test/CodeGen/AMDGPU/GlobalISel/legalize-constant.mir
@@ -0,0 +1,20 @@
+# RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=fiji -O0 -run-pass=legalizer -global-isel %s -o - | FileCheck %s
+
+--- |
+ define void @test_constant() {
+ entry:
+ ret void
+ }
+...
+
+---
+name: test_constant
+registers:
+ - { id: 0, class: _ }
+body: |
+ bb.0.entry:
+ ; CHECK-LABEL: name: test_constant
+ ; CHECK: %0(s32) = G_CONSTANT i32 5
+
+ %0(s32) = G_CONSTANT i32 5
+...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33115.98794.patch
Type: text/x-patch
Size: 1156 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170512/80d24a37/attachment.bin>
More information about the llvm-commits
mailing list