summaryrefslogtreecommitdiff
path: root/test/CodeGen/NVPTX
diff options
context:
space:
mode:
authorJustin Holewinski <jholewinski@nvidia.com>2013-10-11 12:39:36 +0000
committerJustin Holewinski <jholewinski@nvidia.com>2013-10-11 12:39:36 +0000
commit43777c3150c1dd12c661f62d5d7c95bf9b04c16a (patch)
treef9e93da9fdd9d405be3d996b5d5fde342a85c0e9 /test/CodeGen/NVPTX
parent4fc2774b438c6c09f487362e53d5ac1a84edea73 (diff)
downloadllvm-43777c3150c1dd12c661f62d5d7c95bf9b04c16a.tar.gz
llvm-43777c3150c1dd12c661f62d5d7c95bf9b04c16a.tar.bz2
llvm-43777c3150c1dd12c661f62d5d7c95bf9b04c16a.tar.xz
Make AsmPrinter::emitImplicitDef a virtual method so targets can emit custom comments for implicit defs
For NVPTX, this fixes a crash where the emitImplicitDef implementation was expecting physical registers, while NVPTX uses virtual registers (with a couple of exceptions). Now, the implicit def comment will be emitted as a true PTX register name. Other targets can use this to customize the output of implicit def comments. Fixes PR17519 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192444 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/NVPTX')
-rw-r--r--test/CodeGen/NVPTX/implicit-def.ll9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/CodeGen/NVPTX/implicit-def.ll b/test/CodeGen/NVPTX/implicit-def.ll
new file mode 100644
index 0000000000..06d3d56204
--- /dev/null
+++ b/test/CodeGen/NVPTX/implicit-def.ll
@@ -0,0 +1,9 @@
+; RUN: llc < %s -O0 -march=nvptx -mcpu=sm_20 -asm-verbose=1 | FileCheck %s
+
+; CHECK: // implicit-def: %f[[F0:[0-9]+]]
+; CHECK: add.f32 %f{{[0-9]+}}, %f{{[0-9]+}}, %f[[F0]];
+define float @foo(float %a) {
+ %ret = fadd float %a, undef
+ ret float %ret
+}
+