Commit Graph

190 Commits

Author SHA1 Message Date
Justin Holewinski
68226a4d46 PTX: Print .ptr kernel attributes if PTX version >= 2.2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141508 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-09 15:42:02 +00:00
Justin Holewinski
9a6eba6203 PTX: Implement signed division
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141306 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-06 20:00:33 +00:00
Peter Collingbourne
de8f33c199 Build system infrastructure for multiple tblgens.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141266 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-06 01:51:51 +00:00
Justin Holewinski
591c1c6754 PTX: Fixup a case where getRegClassFor() should be used instead of custom code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141199 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-05 18:32:25 +00:00
Duncan Sands
62c607b741 Ensure OpCode is not used uninitialized.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141184 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-05 15:13:13 +00:00
Duncan Sands
72478e6046 Comment out a variable that is only used in commented out code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141183 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-05 15:12:44 +00:00
Duncan Sands
37f80658b3 Remove a bunch of unused variables in the PTX backend (warned about by gcc-4.6).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141182 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-05 15:11:08 +00:00
Justin Holewinski
f51b7e5d74 PTX: Various stylistic and code readability changes recommended by Jim Grosbach.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140855 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-30 14:36:36 +00:00
Justin Holewinski
8c1dac54f2 PTX: Add programmable rounding mode specifier for int <-> fp conversion instrs.
Also take this opportunity to clean up the rounding mode pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140854 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-30 13:46:52 +00:00
Justin Holewinski
c90e149ee4 PTX: Attempt to cleanup/unify the handling of FP rounding modes. This requires
us to manually provide Pat<> definitions for all FP instruction patterns.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140849 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-30 12:54:43 +00:00
Justin Holewinski
2097d702d4 PTX: Fix broken shared library build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140783 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-29 14:25:48 +00:00
Justin Holewinski
d57c1bc0b6 PTX: Add new patterns for bitconvert and any_extend
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140753 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-29 01:13:12 +00:00
Justin Holewinski
cfab2be391 PTX: Fix alignment logic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140709 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-28 18:24:58 +00:00
Justin Holewinski
ed0e4c85c4 PTX: MC-ize the PTX backend (patch 2 of N)
Get rid of some of the no-longer-needed parts of PTXAsmPrinter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140698 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-28 14:32:06 +00:00
Justin Holewinski
d8e4ed2686 PTX: MC-ize the PTX back-end (patch 1 of N)
Lay some groundwork for converting to MC-based asm printer. This is the first
of probably many patches to bring the back-end back up-to-date with all of the
recent MC changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140697 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-28 14:32:04 +00:00
Benjamin Kramer
ca9215970d PTX: Simplify code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140680 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-28 04:32:36 +00:00
Benjamin Kramer
8adae0c940 PTX: Pass param name strings per const reference.
The copies caused use-after-free bugs on std::string implementations without COW (i.e. anything but libstdc++)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140679 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-28 04:08:02 +00:00
Justin Holewinski
332850d8cc PTX: Fix case where printed alignment could be 0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140624 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-27 19:25:49 +00:00
Justin Holewinski
f47dfba023 PTX: Use external symbols to keep track of params and locals. This also fixes
a couple of outstanding issues with frame objects occuring as instruction
operands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140616 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-27 18:12:55 +00:00
Justin Holewinski
13e0c805a2 PTX: Add support for sitofp in backend
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140593 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-27 01:04:47 +00:00
Justin Holewinski
22d54da918 PTX: Fix memcpy intrinsic to handle 64-bit pointers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140556 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-26 19:19:48 +00:00
Justin Holewinski
bc97f4402b PTX: Implement PTXSelectionDAGInfo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140549 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-26 18:57:27 +00:00
Justin Holewinski
63bce90c0d PTX: Implement ISD::ANY_EXTEND
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140548 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-26 18:57:24 +00:00
Justin Holewinski
63602ed876 PTX: Fix detection of stack load/store vs. global load/store, as well as fix the
printing of local offsets

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140547 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-26 18:57:22 +00:00
Justin Holewinski
22f3c59ec3 PTX: SM > 2.0 implies +double
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140536 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-26 16:20:36 +00:00
Justin Holewinski
58788503b8 PTX: Fix some lingering issues with stack allocation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140535 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-26 16:20:34 +00:00
Justin Holewinski
d5c3920f8d PTX: Split up the TableGen instruction definitions into logical units
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140534 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-26 16:20:31 +00:00
Justin Holewinski
c1d8fbd41a PTX: Unify handling of loads/stores
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140533 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-26 16:20:28 +00:00
Justin Holewinski
6b8990df42 PTX: Handle FrameIndex nodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140532 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-26 16:20:25 +00:00
Jakob Stoklund Olesen
74e2d6ea66 Clean up code after renaming LowerSubregs -> ExpandPostRAPseudos.
No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140470 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-25 16:46:08 +00:00
Justin Holewinski
a5745569b6 PTX: Fix parameter order bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140394 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-23 17:59:11 +00:00
Justin Holewinski
dc0baf9b40 PTX: Cleanup unused code in PTXMachineFunctionInfo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140390 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-23 17:15:53 +00:00
Justin Holewinski
d7070fe6df PTX: Fix another 80-column violation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140387 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-23 16:50:35 +00:00
Justin Holewinski
75d809599b PTX: Handle function call return values
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140386 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-23 16:48:41 +00:00
Justin Holewinski
e953a64cb5 PTX: Start fixing function calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140378 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-23 14:31:12 +00:00
Justin Holewinski
d3dec06447 PTX: Remove PTX calling convention files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140377 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-23 14:18:27 +00:00
Justin Holewinski
1cde87d202 [PATCH 2/2] PTXInstrInfo.td PTXIntrinsicInstrInfo.td 80 columns
From 5936c03172e251f12a0332d1033de5718e6e2091 Mon Sep 17 00:00:00 2001
---
 lib/Target/PTX/PTXInstrInfo.td          |  165 ++++++++++++++++++++----------
 lib/Target/PTX/PTXIntrinsicInstrInfo.td |   88 +++++++++++------
 2 files changed, 167 insertions(+), 86 deletions(-)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140376 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-23 14:18:24 +00:00
Justin Holewinski
27f08fc619 PTX: Generalize handling of .param types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140375 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-23 14:18:22 +00:00
Justin Holewinski
04b5ebc74c PTX: Cleanup unused code in the PTXMFInfoExtract pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140374 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-23 14:18:19 +00:00
Justin Holewinski
7c9dd62441 PTX: Remove physical register defs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140310 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-22 16:45:48 +00:00
Justin Holewinski
5422a0f166 PTX: Use .param space for device function return values on SM 2.0+, and attempt
to fix up parameter passing on SM < 2.0

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140309 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-22 16:45:46 +00:00
Justin Holewinski
05591be5ed PTX: Fix style issues
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140308 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-22 16:45:43 +00:00
Justin Holewinski
297984d7c6 PTX: Fixup codegen to handle emission of virtual registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140307 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-22 16:45:40 +00:00
Justin Holewinski
40466cc758 PTX: Customize codegen passes in backend
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140306 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-22 16:45:37 +00:00
Justin Holewinski
247ee00bce PTX: Add new PTX-specific register allocator that keeps virtual registers
instead of allocating physical registers.

This is part of a work-in-progress overhaul of the PTX register allocation scheme.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140305 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-22 16:45:33 +00:00
Owen Anderson
98c5ddabca Don't attach annotations to MCInst's. Instead, have the disassembler return, and the printer accept, an annotation string which can be passed through if the client cares about annotations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139876 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 23:38:46 +00:00
Duncan Sands
28b77e968d Add codegen support for vector select (in the IR this means a select
with a vector condition); such selects become VSELECT codegen nodes.
This patch also removes VSETCC codegen nodes, unifying them with SETCC
nodes (codegen was actually often using SETCC for vector SETCC already).
This ensures that various DAG combiner optimizations kick in for vector
comparisons.  Passes dragonegg bootstrap with no testsuite regressions
(nightly testsuite as well as "make check-all").  Patch mostly by
Nadav Rotem.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139159 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-06 19:07:46 +00:00
Benjamin Kramer
36a16015ac Don't drop alignment info on local common symbols.
- On COFF the .lcomm directive has an alignment argument.
- On ELF we fall back to .local + .comm

Based on a patch by NAKAMURA Takumi.

Fixes PR9337, PR9483 and PR10128.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138976 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-01 23:04:27 +00:00
Evan Cheng
3e74d6fdd2 Move TargetRegistry and TargetSelect from Target to Support where they belong.
These are strictly utilities for registering targets and components.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138450 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-24 18:08:43 +00:00
Evan Cheng
7801136b95 Some refactoring so TargetRegistry.h no longer has to include any files
from MC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138367 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-23 20:15:21 +00:00