aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/PTX/PTXAsmPrinter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove the PTX back-end and all of its artifacts (triple, etc.)Justin Holewinski2012-05-241-561/+0
| | | | | | | | This back-end was deprecated in favor of the NVPTX back-end. NV_CONTRIB git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157417 91177308-0d34-0410-b5e6-96231b3b80d8
* Reorder includes in Target backends to following coding standards. Remove ↵Craig Topper2012-03-171-1/+1
| | | | | | some superfluous forward declarations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152997 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dead code. Improve llvm_unreachable text. Simplify some control flow.Ahmed Charles2012-02-191-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150918 91177308-0d34-0410-b5e6-96231b3b80d8
* More dead code removal (using -Wunreachable-code)David Blaikie2012-01-201-3/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148578 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Continue to fix up the register mess.Justin Holewinski2011-12-061-47/+26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145947 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Encode registers as unsigned values in the MC asm printer instead of ↵Justin Holewinski2011-12-061-10/+28
| | | | | | using external symbols git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145946 91177308-0d34-0410-b5e6-96231b3b80d8
* allow non-device function calls in PTX when natively handling device-side printfDan Bailey2011-11-111-0/+30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144388 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify code. No functionality change.Benjamin Kramer2011-11-071-155/+91
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144012 91177308-0d34-0410-b5e6-96231b3b80d8
* fixed global array handling for ptx to use the correct bit widthsDan Bailey2011-11-031-12/+17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143640 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for a new extension to the .file directive:Nick Lewycky2011-10-171-2/+1
| | | | | | | | | | | .file filenumber "directory" "filename" This removes one join+split of the directory+filename in MC internals. Because bitcode files have independent fields for directory and filenames in debug info, this patch may change the .o files written by existing .bc files. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142300 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Print .ptr kernel attributes if PTX version >= 2.2Justin Holewinski2011-10-091-1/+37
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141508 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Various stylistic and code readability changes recommended by Jim Grosbach.Justin Holewinski2011-09-301-200/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140855 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Fix broken shared library buildJustin Holewinski2011-09-291-4/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140783 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Fix alignment logicJustin Holewinski2011-09-281-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140709 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: MC-ize the PTX backend (patch 2 of N)Justin Holewinski2011-09-281-8/+2
| | | | | | 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
* PTX: MC-ize the PTX back-end (patch 1 of N)Justin Holewinski2011-09-281-44/+61
| | | | | | | | 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
* PTX: Fix case where printed alignment could be 0Justin Holewinski2011-09-271-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140624 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Use external symbols to keep track of params and locals. This also fixesJustin Holewinski2011-09-271-23/+5
| | | | | | | 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
* PTX: Fix detection of stack load/store vs. global load/store, as well as fix theJustin Holewinski2011-09-261-2/+9
| | | | | | printing of local offsets git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140547 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Fix some lingering issues with stack allocationJustin Holewinski2011-09-261-1/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140535 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Unify handling of loads/storesJustin Holewinski2011-09-261-1/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140533 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Handle FrameIndex nodesJustin Holewinski2011-09-261-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140532 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Cleanup unused code in PTXMachineFunctionInfoJustin Holewinski2011-09-231-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140390 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Handle function call return valuesJustin Holewinski2011-09-231-9/+24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140386 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Start fixing function callsJustin Holewinski2011-09-231-1/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140378 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Generalize handling of .param typesJustin Holewinski2011-09-231-11/+21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140375 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Use .param space for device function return values on SM 2.0+, and attemptJustin Holewinski2011-09-221-34/+55
| | | | | | 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
* PTX: Fixup codegen to handle emission of virtual registers.Justin Holewinski2011-09-221-15/+60
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140307 91177308-0d34-0410-b5e6-96231b3b80d8
* Move TargetRegistry and TargetSelect from Target to Support where they belong.Evan Cheng2011-08-241-1/+1
| | | | | | | 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
* PTX: Add initial support for device function callsJustin Holewinski2011-08-091-1/+42
| | | | | | - Calls are supported on SM 2.0+ for function with no return values git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137125 91177308-0d34-0410-b5e6-96231b3b80d8
* land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner2011-07-181-6/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135375 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Reverting implementation of i8.Dan Bailey2011-06-251-2/+0
| | | | | | | | | | The .b8 operations in PTX are far more limiting than I first thought. The mov operation isn't even supported, so there's no way of converting a .pred value into a .b8 without going via .b16, which is not sensible. An improved implementation needs to use the fact that loads and stores automatically extend and truncate to implement support for EXTLOAD and TRUNCSTORE in order to correctly support boolean values. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133873 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Add support for i8 type and introduce associated .b8 registersDan Bailey2011-06-241-0/+2
| | | | | | | | The i8 type is required for boolean values, but can only use ld, st and mov instructions. The i1 type continues to be used for predicates. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133814 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Add preliminary support for outputting debug information in the form ofJustin Holewinski2011-06-241-0/+97
| | | | | | | | | | .file and .loc directives. Ideally, we would utilize the existing support in AsmPrinter for this, but I cannot find a way to get .file and .loc directives to print without the rest of the associated DWARF sections, which ptxas cannot handle. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133812 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Re-work target sm/compute selection and add some basic GPUJustin Holewinski2011-06-241-1/+1
| | | | | | targets: g80, gt200, gf100(fermi) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133799 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Always use registers for return values, but use .param space for deviceJustin Holewinski2011-06-231-13/+4
| | | | | | | | | | | parameters if SM >= 2.0 - Update test cases to be more robust against register allocation changes - Bump up the number of registers to 128 per type - Include Python script to re-generate register file with any number of registers git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133736 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Whitespace fixes and remove commented out codeJustin Holewinski2011-06-231-35/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133734 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Prevent DCE from eliminating st.param calls, and unify the handling ofJustin Holewinski2011-06-231-5/+23
| | | | | | | | st.param and ld.param FIXME: Test cases still need to be updated git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133733 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Use .param space for parameters in device functions for SM >= 2.0Justin Holewinski2011-06-231-1/+2
| | | | | | FIXME: DCE is eliminating the final st.param.x calls, figure out why git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133732 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Fix FrameIndex mapping bugJustin Holewinski2011-06-221-7/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133619 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Add .address_size directive if PTX version >= 2.3Justin Holewinski2011-06-221-0/+7
| | | | | | Patch by Wei-Ren Chen git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133589 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Add basic register spilling codeJustin Holewinski2011-06-201-0/+13
| | | | | | | | | | | | The current implementation generates stack loads/stores, which are really just mov instructions from/to "special" registers. This may not be the most efficient implementation, compared to an approach where the stack registers are directly folded into instructions, but this is easier to implement and I have yet to see a case where ptxas is unable to see through this kind of register usage and know what is really going on. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133443 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a FIXME by making GlobalVariable::getInitializer() return aJay Foad2011-06-191-1/+1
| | | | | | const Constant *. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133400 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Finish new calling convention implementationJustin Holewinski2011-06-161-43/+75
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133172 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Rename register classes for readability and combine int and fp registersJustin Holewinski2011-06-161-6/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133171 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Fix whitespace errorsJustin Holewinski2011-06-161-9/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133158 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: patch to AsmPrinterJustin Holewinski2011-04-281-22/+47
| | | | | | | | | - immediate value cast as long not int - handles initializer for constant array Patch by Dan Bailey git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130352 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Add intrinsics to list of built-in intrinsics, which allows them to beJustin Holewinski2011-04-201-1/+2
| | | | | | | | | | used by Clang. To help Clang integration, the PTX target has been split into two targets: ptx32 and ptx64, depending on the desired pointer size. - Add GCCBuiltin class to all intrinsics - Split PTX target into ptx32 and ptx64 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129851 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Fix various codegen issuesJustin Holewinski2011-03-181-1/+11
| | | | | | | | - Emit mad instead of mad.rn for shader model 1.0 - Emit explicit mov.u32 instructions for reading global variables - (most PTX instructions cannot take global variable immediates) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127895 91177308-0d34-0410-b5e6-96231b3b80d8
* ptx: fix parameter order that is reversedChe-Liang Chiou2011-03-181-5/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127874 91177308-0d34-0410-b5e6-96231b3b80d8