summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/NVPTX
Commit message (Collapse)AuthorAgeFilesLines
...
* Rework the logic for setting the TargetName. This appears toEric Christopher2014-06-271-11/+5
| | | | | | be shorter and identical in goal. llvm-svn: 211845
* Remove caching of the target machine in NVPTXInstrInfo andEric Christopher2014-06-273-5/+4
| | | | | | update constructor accordingly. llvm-svn: 211840
* Remove comment that duplicated information in the constructorEric Christopher2014-06-271-6/+6
| | | | | | that it's after. llvm-svn: 211839
* Remove commented out code.Eric Christopher2014-06-271-8/+0
| | | | llvm-svn: 211838
* Remove extraneous parens and extraneous const cast (and fix theEric Christopher2014-06-271-3/+3
| | | | | | prototype for the function to patch what we were returning). llvm-svn: 211837
* Revert "Introduce a string_ostream string builder facilty"Alp Toker2014-06-261-1/+2
| | | | | | Temporarily back out commits r211749, r211752 and r211754. llvm-svn: 211814
* Introduce a string_ostream string builder faciltyAlp Toker2014-06-261-2/+1
| | | | | | | | | | | | | | | | | | | | string_ostream is a safe and efficient string builder that combines opaque stack storage with a built-in ostream interface. small_string_ostream<bytes> additionally permits an explicit stack storage size other than the default 128 bytes to be provided. Beyond that, storage is transferred to the heap. This convenient class can be used in most places an std::string+raw_string_ostream pair or SmallString<>+raw_svector_ostream pair would previously have been used, in order to guarantee consistent access without byte truncation. The patch also converts much of LLVM to use the new facility. These changes include several probable bug fixes for truncated output, a programming error that's no longer possible with the new interface. llvm-svn: 211749
* Move expression visitation logic up to MCStreamer.Rafael Espindola2014-06-251-1/+1
| | | | | | Remove the duplicate from MCRecordStreamer. No functionality change. llvm-svn: 211714
* Simplify the visitation of target expressions. No functionality change.Rafael Espindola2014-06-251-1/+1
| | | | llvm-svn: 211707
* Replace some assert(0)'s with llvm_unreachable.Craig Topper2014-06-181-3/+3
| | | | llvm-svn: 211141
* SelectionDAG: Don't use MVT::Other to determine legality of ISD::SELECT_CCTom Stellard2014-06-101-1/+7
| | | | | | | | | | | | | The SelectionDAG bad a special case for ISD::SELECT_CC, where it would allow targets to specify: setOperationAction(ISD::SELECT_CC, MVT::Other, Expand); to indicate that they wanted to expand ISD::SELECT_CC for all types. This wasn't applied correctly everywhere, and it makes writing new DAG patterns with ISD::SELECT_CC difficult. llvm-svn: 210541
* Fix typosAlp Toker2014-06-071-1/+1
| | | | llvm-svn: 210401
* Have TargetSelectionDAGInfo take a DataLayout initializer rather thanEric Christopher2014-06-061-1/+1
| | | | | | a TargetMachine since the only thing it wants is DataLayout. llvm-svn: 210366
* Allow alias to point to an arbitrary ConstantExpr.Rafael Espindola2014-06-031-1/+1
| | | | | | | | | | | | | | | | | | | | | This patch changes GlobalAlias to point to an arbitrary ConstantExpr and it is up to MC (or the system assembler) to decide if that expression is valid or not. This reduces our ability to diagnose invalid uses and how early we can spot them, but it also lets us do things like @test5 = alias inttoptr(i32 sub (i32 ptrtoint (i32* @test2 to i32), i32 ptrtoint (i32* @bar to i32)) to i32*) An important implication of this patch is that the notion of aliased global doesn't exist any more. The alias has to encode the information needed to access it in its metadata (linkage, visibility, type, etc). Another consequence to notice is that getSection has to return a "const char *". It could return a NullTerminatedStringRef if there was such a thing, but when that was proposed the decision was to just uses "const char*" for that. llvm-svn: 210062
* Update a couple of header inclusion guardsAlp Toker2014-05-311-3/+3
| | | | llvm-svn: 209980
* Test commit.Jingyue Wu2014-05-231-1/+1
| | | | | | The keyword "virtual" is not necessary. llvm-svn: 209501
* Target: change member from reference to pointerSaleem Abdulrasool2014-05-171-1/+1
| | | | | | | | | This is a preliminary step to help ease the construction of CallLoweringInfo. Changing the construction to a chained function pattern requires that the parameter be nullable. However, rather than copying the vector, save a pointer rather than the reference to permit a late binding of the arguments. llvm-svn: 209080
* Add an optimization that does CSE in a group of similar GEPs.Eli Bendersky2014-05-011-4/+17
| | | | | | | | | | | | | | This optimization merges the common part of a group of GEPs, so we can compute each pointer address by adding a simple offset to the common part. The optimization is currently only enabled for the NVPTX backend, where it has a large payoff on some benchmarks. Review: http://reviews.llvm.org/D3462 Patch by Jingyue Wu. llvm-svn: 207783
* Use makeArrayRef insted of calling ArrayRef<T> constructor directly. I ↵Craig Topper2014-04-301-6/+3
| | | | | | introduced most of these recently. llvm-svn: 207616
* De-virtualize or remove some methods that have no overrides nor override ↵Craig Topper2014-04-302-19/+0
| | | | | | anything. In some cases remove all together if there are no callers either. llvm-svn: 207610
* [C++11] Add 'override' keywords and remove 'virtual'. Additionally add ↵Craig Topper2014-04-2919-109/+113
| | | | | | 'final' and leave 'virtual' on some methods that are marked virtual without overriding anything and have no obvious overrides themselves. NVPTX edition llvm-svn: 207505
* [C++] Use 'nullptr'.Craig Topper2014-04-285-31/+31
| | | | llvm-svn: 207394
* Convert SelectionDAG::getMergeValues to use ArrayRef.Craig Topper2014-04-271-1/+1
| | | | llvm-svn: 207374
* Replace std::vector with SmallVector for some small, known size vectors.Craig Topper2014-04-261-4/+4
| | | | llvm-svn: 207330
* Convert getMemIntrinsicNode to take ArrayRef of SDValue instead of pointer ↵Craig Topper2014-04-261-29/+26
| | | | | | and size. llvm-svn: 207329
* Convert SelectionDAG::getNode methods to use ArrayRef<SDValue>.Craig Topper2014-04-261-21/+17
| | | | llvm-svn: 207327
* [C++] Use 'nullptr'. Target edition.Craig Topper2014-04-2511-148/+149
| | | | llvm-svn: 207197
* [Modules] Fix potential ODR violations by sinking the DEBUG_TYPEChandler Carruth2014-04-224-5/+8
| | | | | | | definition below all of the header #include lines, lib/Target/... edition. llvm-svn: 206842
* [cleanup] Fix two headers where we included a standard library headerChandler Carruth2014-04-221-2/+1
| | | | | | after including the generated code from tablegen. llvm-svn: 206841
* [cleanup] Fix another place where we were including the tablegen'ed codeChandler Carruth2014-04-221-2/+1
| | | | | | | of a '.inc' file before including actual headers. In this case we had both duplicated a header's include and were including a standard header. llvm-svn: 206840
* [cleanup] Lift using directives, DEBUG_TYPE definitions, and even someChandler Carruth2014-04-223-6/+7
| | | | | | | | | | | | system headers above the includes of generated '.inc' files that actually contain code. In a few targets this was already done pretty consistently, but it wasn't done *really* consistently anywhere. It is strictly cleaner IMO and necessary in a bunch of places where the DEBUG_TYPE is referenced from the generated code. Consistency with the necessary places trumps. Hopefully the build bots are OK with the movement of intrin.h... llvm-svn: 206838
* [Modules] Make Support/Debug.h modular. This requires it to not changeChandler Carruth2014-04-213-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | behavior based on other files defining DEBUG_TYPE, which means it cannot define DEBUG_TYPE at all. This is actually better IMO as it forces folks to define relevant DEBUG_TYPEs for their files. However, it requires all files that currently use DEBUG(...) to define a DEBUG_TYPE if they don't already. I've updated all such files in LLVM and will do the same for other upstream projects. This still leaves one important change in how LLVM uses the DEBUG_TYPE macro going forward: we need to only define the macro *after* header files have been #include-ed. Previously, this wasn't possible because Debug.h required the macro to be pre-defined. This commit removes that. By defining DEBUG_TYPE after the includes two things are fixed: - Header files that need to provide a DEBUG_TYPE for some inline code can do so by defining the macro before their inline code and undef-ing it afterward so the macro does not escape. - We no longer have rampant ODR violations due to including headers with different DEBUG_TYPE definitions. This may be mostly an academic violation today, but with modules these types of violations are easy to check for and potentially very relevant. Where necessary to suppor headers with DEBUG_TYPE, I have moved the definitions below the includes in this commit. I plan to move the rest of the DEBUG_TYPE macros in LLVM in subsequent commits; this one is big enough. The comments in Debug.h, which were hilariously out of date already, have been updated to reflect the recommended practice going forward. llvm-svn: 206822
* [Modules] Consolidate the DEBUG_TYPE defines in NVPTX to the top of theChandler Carruth2014-04-212-5/+1
| | | | | | cpp file rather than in the header and then again in the cpp file. llvm-svn: 206778
* [C++11] Replace OwningPtr with std::unique_ptr in places where it doesn't ↵Benjamin Kramer2014-04-211-1/+0
| | | | | | | | break the API. No functionality change. llvm-svn: 206740
* Convert SelectionDAG::getVTList to use ArrayRefCraig Topper2014-04-162-7/+7
| | | | llvm-svn: 206357
* Break PseudoSourceValue out of the Value hierarchy. It is now the root of ↵Nick Lewycky2014-04-151-3/+7
| | | | | | its own tree containing FixedStackPseudoSourceValue (which you can use isa/dyn_cast on) and MipsCallEntry (which you can't). Anything that needs to use either a PseudoSourceValue* and Value* is strongly encouraged to use a MachinePointerInfo instead. llvm-svn: 206255
* [NVPTX] Add preliminary intrinsics and codegen support for textures/surfacesJustin Holewinski2014-04-0914-20/+3855
| | | | | | This commit adds intrinsics and codegen support for the surface read/write and texture read instructions that take an explicit sampler parameter. Codegen operates on image handles at the PTX level, but falls back to direct replacement of handles with kernel arguments if image handles are not enabled. Note that image handles are explicitly disabled for all target architectures in this change (to be enabled later). llvm-svn: 205907
* [NVPTX] Add support for addrspacecast in global variable initializers, ↵Justin Holewinski2014-04-092-4/+69
| | | | | | including emitting generic() when casting to address space 0. llvm-svn: 205906
* [NVPTX] Add query support for read-write images and managed variablesJustin Holewinski2014-04-094-3/+52
| | | | | | This also fixes a bug in the annotation cache where the cache will not be cleared between modules if multiple modules are compiled in the same process. llvm-svn: 205905
* [C++11] Replace some comparisons with 'nullptr' with simple boolean checks ↵Craig Topper2014-04-091-1/+1
| | | | | | to reduce verbosity. llvm-svn: 205829
* Make consistent use of MCPhysReg instead of uint16_t throughout the tree.Craig Topper2014-04-042-3/+3
| | | | llvm-svn: 205610
* Optimize away unnecessary address casts.Eli Bendersky2014-04-034-0/+206
| | | | | | | | | Removes unnecessary casts from non-generic address spaces to the generic address space for certain code patterns. Patch by Jingyue Wu. llvm-svn: 205571
* Change shouldSplitVectorElementType to better match the description.Matt Arsenault2014-03-312-3/+3
| | | | | | Pass the entire vector type, and not just the element. llvm-svn: 205247
* PR19099 - revert r203483Eli Bendersky2014-03-312-48/+16
| | | | | | | Now that r205212 was committed, r203483 is no longer necessary; it was a temporary workaround that only handled a small number of the problematic cases. llvm-svn: 205216
* Fix for PR19099 - NVPTX produces invalid symbol names.Eli Bendersky2014-03-314-0/+89
| | | | | | | | This is a more thorough fix for the issue than r203483. An IR pass will run before NVPTX codegen to make sure there are no invalid symbol names that can't be consumed by the ptxas assembler. llvm-svn: 205212
* Removes the NVPTXSplitBBatBar pass.Eli Bendersky2014-03-244-118/+0
| | | | | | | This pass is a historic remnant and actually causes less efficient code to be generated in some cases. llvm-svn: 204620
* [NVPTX] Add isel patterns for addrspacecastJustin Holewinski2014-03-242-0/+64
| | | | llvm-svn: 204600
* remove a bunch of unused private methodsNuno Lopes2014-03-232-23/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | found with a smarter version of -Wunused-member-function that I'm playwing with. Appologies in advance if I removed someone's WIP code. include/llvm/CodeGen/MachineSSAUpdater.h | 1 include/llvm/IR/DebugInfo.h | 3 lib/CodeGen/MachineSSAUpdater.cpp | 10 -- lib/CodeGen/PostRASchedulerList.cpp | 1 lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 10 -- lib/IR/DebugInfo.cpp | 12 -- lib/MC/MCAsmStreamer.cpp | 2 lib/Support/YAMLParser.cpp | 39 --------- lib/TableGen/TGParser.cpp | 16 --- lib/TableGen/TGParser.h | 1 lib/Target/AArch64/AArch64TargetTransformInfo.cpp | 9 -- lib/Target/ARM/ARMCodeEmitter.cpp | 12 -- lib/Target/ARM/ARMFastISel.cpp | 84 -------------------- lib/Target/Mips/MipsCodeEmitter.cpp | 11 -- lib/Target/Mips/MipsConstantIslandPass.cpp | 12 -- lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp | 21 ----- lib/Target/NVPTX/NVPTXISelDAGToDAG.h | 2 lib/Target/PowerPC/PPCFastISel.cpp | 1 lib/Transforms/Instrumentation/AddressSanitizer.cpp | 2 lib/Transforms/Instrumentation/BoundsChecking.cpp | 2 lib/Transforms/Instrumentation/MemorySanitizer.cpp | 1 lib/Transforms/Scalar/LoopIdiomRecognize.cpp | 8 - lib/Transforms/Scalar/SCCP.cpp | 1 utils/TableGen/CodeEmitterGen.cpp | 2 24 files changed, 2 insertions(+), 261 deletions(-) llvm-svn: 204560
* [C++11] Change DebugInfoFinder to use range-based loopsAlon Mishne2014-03-181-8/+2
| | | | | | Also changes the iterators to return actual DI type over MDNode. llvm-svn: 204130
* Make sure NVPTX doesn't emit symbol names that aren't valid in PTX.Eli Bendersky2014-03-102-16/+48
| | | | | | | | | | NVPTX, like the other backends, relies on generic symbol name sanitizing done by MCSymbol. However, the ptxas assembler is more stringent and disallows some additional characters in symbol names. See PR19099 for more details. llvm-svn: 203483
OpenPOWER on IntegriCloud