summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* [DAGCombiner] Add support for FCEIL, FFLOOR and FTRUNC vector constant foldingSimon Pilgrim2015-04-062-6/+7
| | | | | | Differential Revision: http://reviews.llvm.org/D8715 llvm-svn: 234179
* [DAGCombiner] Merge FMUL Scalar and Vector constant canonicalization to RHS. ↵Simon Pilgrim2015-04-051-8/+2
| | | | | | NFCI. llvm-svn: 234118
* [opaque pointer type] More GEP API migrationsDavid Blaikie2015-04-041-17/+26
| | | | llvm-svn: 234108
* less space; NFCSanjay Patel2015-04-041-1/+0
| | | | llvm-svn: 234106
* Implement unique sections with an unique ID.Rafael Espindola2015-04-041-7/+14
| | | | | | | | | | | This allows the compiler/assembly programmer to switch back to a section. This in turn fixes the bootstrap failure on powerpc (tested on gcc110) without changing the ppc codegen at all. I will try to cleanup the various getELFSection overloads in a followup patch. Just using a default argument now would lead to ambiguities. llvm-svn: 234099
* [DAGCombiner] Canonicalize vector constants for ADD/MUL/AND/OR/XOR ↵Simon Pilgrim2015-04-041-6/+11
| | | | | | | | re-association Scalar integers are commuted to move constants to the RHS for re-association - this ensures vectors do the same. llvm-svn: 234092
* [WinEH] Fill out CatchHigh in the TryBlockMapDavid Majnemer2015-04-032-6/+9
| | | | | | Now all fields in the WinEH xdata have been filled out. llvm-svn: 234067
* [WinEH] Fill out .xdata for catch objectsDavid Majnemer2015-04-034-12/+17
| | | | | | | This add support for catching an exception such that an exception object available to the catch handler will be initialized by the runtime. llvm-svn: 234062
* [WinEH] Sink UnwindHelp completely out of IRDavid Majnemer2015-04-032-25/+0
| | | | | | | | We don't need to represent UnwindHelp in IR. Instead, we can use the knowledge that we are emitting the parent function to decide if we should create the UnwindHelp stack object. llvm-svn: 234061
* Fixing a memory leak in WinEHPrepareAndrew Kaylor2015-04-031-0/+2
| | | | llvm-svn: 234059
* [opaque pointer type] More GEP IRBuilder API migrations...David Blaikie2015-04-031-3/+5
| | | | llvm-svn: 234058
* Fixing a build errorAndrew Kaylor2015-04-031-1/+1
| | | | llvm-svn: 234045
* Fixing build warnings.Andrew Kaylor2015-04-031-2/+0
| | | | llvm-svn: 234043
* [WinEH] Handle nested landing pads in outlined catch handlersAndrew Kaylor2015-04-032-55/+247
| | | | | | Differential Revision: http://reviews.llvm.org/D8596 llvm-svn: 234041
* CodeGen: Assert that inlined-at locations agreeDuncan P. N. Exon Smith2015-04-0311-35/+51
| | | | | | | | | | | | | | | | | As a follow-up to r234021, assert that a debug info intrinsic variable's `MDLocalVariable::getInlinedAt()` always matches the `MDLocation::getInlinedAt()` of its `!dbg` attachment. The goal here is to get rid of `MDLocalVariable::getInlinedAt()` entirely (PR22778), but I'll let these assertions bake for a while first. If you have an out-of-tree backend that just broke, you're probably attaching the wrong `DebugLoc` to a `DBG_VALUE` instruction. The one you want is the location that was attached to the corresponding `@llvm.dbg.declare` or `@llvm.dbg.value` call that you started with. llvm-svn: 234038
* [WinEH] Fold cast into assertion based on review feedbackReid Kleckner2015-04-031-3/+2
| | | | llvm-svn: 234034
* SelectionDAG: Use specialized metadata nodes in EmitFuncArgumentDbgValue(), NFCDuncan P. N. Exon Smith2015-04-032-14/+12
| | | | | | | Use `MDLocalVariable` and `MDExpression` directly for the arguments of `EmitFuncArgumentDbgValue()` to simplify a follow-up patch. llvm-svn: 234026
* CodeGen: Fix MachineInstr::print() for DBG_VALUEDuncan P. N. Exon Smith2015-04-031-2/+2
| | | | | | | Grab the `MDLocalVariable` from the second-to-last argument; the last argument is an `MDExpression`, and mixing them up will crash. llvm-svn: 234019
* [MachineLICM] Small cleanup: Constify and rangeify.Daniel Jasper2015-04-031-12/+9
| | | | | | NFC. llvm-svn: 234018
* [DAGCombiner] Combine shuffles of BUILD_VECTOR and SCALAR_TO_VECTORSimon Pilgrim2015-04-031-0/+37
| | | | | | | | This patch attempts to fold the shuffling of 'scalar source' inputs - BUILD_VECTOR and SCALAR_TO_VECTOR nodes - if the shuffle node is the only user. This folds away a lot of unnecessary shuffle nodes, and allows quite a bit of constant folding that was being missed. Differential Revision: http://reviews.llvm.org/D8516 llvm-svn: 234004
* Fix unused variable in NDEBUG buildsReid Kleckner2015-04-021-0/+1
| | | | llvm-svn: 233978
* [WinEH] Make llvm.eh.actions use frameescape indices for catch paramsReid Kleckner2015-04-021-9/+44
| | | | | | | | | | | | | | | | | | This makes it possible to use the same representation of llvm.eh.actions in outlined handlers as we use in the parent function because i32's are just constants that can be copied freely between functions. I had to add a sentinel alloca to the list of child allocas so that we don't try to sink the catch object into the handler. Normally, one would use nullptr for this kind of thing, but TinyPtrVector doesn't support null elements. More than that, it's elements have to have a suitable alignment. Therefore, I settled on this for my sentinel: AllocaInst *getCatchObjectSentinel() { return static_cast<AllocaInst *>(nullptr) + 1; } llvm-svn: 233947
* [opaque pointer type] API migration for GEP constant factoriesDavid Blaikie2015-04-022-2/+3
| | | | | | | | | | | | | Require the pointee type to be passed explicitly and assert that it is correct. For now it's possible to pass nullptr here (and I've done so in a few places in this patch) but eventually that will be disallowed once all clients have been updated or removed. It'll be a long road to get all the way there... but if you have the cahnce to update your callers to pass the type explicitly without depending on a pointer's element type, that would be a good thing to do soon and a necessary thing to do eventually. llvm-svn: 233938
* [gcroot] Remove unused items from an enumPhilip Reames2015-04-021-4/+0
| | | | | | These two were never implemented for gcroot, so there's no point in keeping them around now. llvm-svn: 233892
* Teach gcroot how to handle dynamically realigned framesPhilip Reames2015-04-021-7/+10
| | | | | | | | | I'm playing with supporting custom stack map formats with statepoints. While doing so, I noticed that the existing implementation didn't indicate inherently unsized frames. This change essentially just ports the functionality that already exists for the default StackMaps section to custom stackmaps. llvm-svn: 233891
* Fix WinEHPrepare bug with multiple catch handlersAndrew Kaylor2015-04-011-179/+126
| | | | | | Differential Revision: http://reviews.llvm.org/D8682 llvm-svn: 233824
* [WinEH] Implement support for catch-allDavid Majnemer2015-04-011-8/+13
| | | | | | | A catch (...) doesn't have a type descriptor. Instead, the 'adjectives' field has bit six set. llvm-svn: 233788
* Fix PR23065. Avoid optimizing bitcast of build_vector with constant input to ↵Jiangning Liu2015-04-011-5/+0
| | | | | | scalar_to_vector. llvm-svn: 233778
* [WinEH] ExitingScope is vacuously true if !PoppedCatches.empty()David Majnemer2015-03-311-2/+1
| | | | | | Remove a redundant condition, no functional change intended. llvm-svn: 233770
* [WinEH] Generate .xdata for catch handlersDavid Majnemer2015-03-314-56/+135
| | | | | | | | | | | | | | This lets us catch exceptions in simple cases. N.B. Things that do not work include (but are not limited to): - Throwing from within a catch handler. - Catching an object with a named catch parameter. - 'CatchHigh' is fictitious, we aren't sure of its purpose. - We aren't entirely efficient with regards to the number of EH states that we generate. - IP-to-State tables are sensitive to the order of emission. llvm-svn: 233767
* [SDAG] Handle non-integer preferred memset types for non-constant valuesHal Finkel2015-03-311-2/+17
| | | | | | | | | | | | | | The existing code in getMemsetValue only handled integer-preferred types when the fill value was not a constant. Make this more robust in two ways: 1. If the preferred type is a floating-point value, do the mul-splat trick on the corresponding integer type and then bitcast. 2. If the preferred type is a vector, do the mul-splat trick on one vector element, and then build a vector out of them. Fixes PR22754 (although, we should also turn off use of vector types at -O0). llvm-svn: 233749
* RegAllocGreedy: Allow target to specify register class ordering.Matthias Braun2015-03-311-3/+4
| | | | | | | | | | Specify an allocation order with a register class. This is used by register allocators with a greedy heuristic. This is usefull as it is sometimes beneficial to color more constrained classes first. Differential Revision: http://reviews.llvm.org/D8626 llvm-svn: 233743
* RegAllocGreedy: Improve live interval order in ReverseLocal modeMatthias Braun2015-03-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | When allocating live intervals in linear order and all of them are local to a single basic block you get an optimal coloring. This is also true if you reverse the order, but it is not true if you sort live ranges beginnings in reverse order, change to sort live range endings in reverse order. Take the following live ranges for example: |---| |--------| |----------| |-------| They get colored suboptimally with 3 registers if you sort the live range starting points in reverse order (but optimally with live range begins in order, or live range ends in reverse order). Apparently the previous strategy was intentional because of allocation time considerations. I am having a hard time replicating these effects, while I see substantial improvements in allocation quality with this change. No testcase as none of the (in tree) targets use reverse order mode. Differential Revision: http://reviews.llvm.org/D8625 llvm-svn: 233742
* typos; NFCSanjay Patel2015-03-311-5/+5
| | | | llvm-svn: 233701
* [SDAG] Move TRUNCATE splitting logic into a helper, and useJames Molloy2015-03-312-11/+26
| | | | | | | | | | | it more liberally. SplitVecOp_TRUNCATE has logic for recursively splitting oversize vectors that need more than one round of splitting to become legal. There are many other ISD nodes that could benefit from this logic, so factor it out and use it for FP_TO_UINT,FP_TO_SINT,SINT_TO_FP,UINT_TO_FP and FTRUNC. llvm-svn: 233681
* DebugInfo: Remove LexicalBlockFile scope/context distinctionDuncan P. N. Exon Smith2015-03-311-12/+3
| | | | | | | | | | | | | | Two things here: 1. I read `getScope()` and `getContext()` backwards in r233640. There was no need for `getScopeOfScope()`. Obviously not enough test coverage here (as I said in that commit, I'm going to come back to that), but anyway I'm reverting to the behaviour before r233640. 2. The callers that use `DILexicalBlockFile::getContext()` don't seem to care about the difference. Just have it redirect to `getScope()` so I can't get confused again. llvm-svn: 233650
* Replace the MCSubtargetInfo parameter with a Triple when creatingEric Christopher2015-03-311-1/+1
| | | | | | | an MCInstPrinter. Update all callers and use where we wanted a Triple previously. llvm-svn: 233648
* LexicalScopes: Cleanup remaining uses of DebugLocDuncan P. N. Exon Smith2015-03-301-8/+6
| | | | llvm-svn: 233644
* DebugLoc: Remove getFromDILexicalBlock()Duncan P. N. Exon Smith2015-03-301-10/+7
| | | | | | | | | The only user of `DebugLoc::getFromDILexicalBlock()` was creating a new `MDLocation` as convenient API for passing an `MDScope`. Stop doing that, and remove the API. If in the future we actually *want* to create new DebugLocs, calling `MDLexicalBlock::get()` makes more sense. llvm-svn: 233643
* LexicalScopes: Use debug info hierarchy pervasivelyDuncan P. N. Exon Smith2015-03-302-36/+46
| | | | | | | | | | | | | | | | | | | | | | | | | Pervasively use the types provided by the debug info hierarchy rather than `MDNode` in `LexicalScopes`. I noticed (again, I guess, based on comments in the implementation?) that `DILexicalBlockFile::getScope()` returns something different from `DILexicalBlockFile::getContext()`. I created a local helper for getting the same logic from `MDLexicalBlockFile` called `getScopeOfScope()`. I still don't really understand it, but I've added some FIXMEs and I'll come back to it (I suspect the way we encode these objects isn't really ideal). Note that my previous commit r233610 accidentally changed behaviour in `findLexicalScope()` -- it transitioned from a call to `DILexicalBlockFile::getScope()` to `MDLexicalBlockFile::getScope()` (sounds right, doesn't it?) -- so I've fixed that as a drive-by. No tests failed with my error, so it looks like we're missing some coverage here... when I come back to understand the logic, I'll see if I can add some. Other than the fix to `findLexicalScope()`, no functionality change. llvm-svn: 233640
* Silence an unused variable warning.David Majnemer2015-03-301-0/+2
| | | | | | No functional change intended. llvm-svn: 233639
* [WinEH] Run cleanup handlers when an exception is thrownDavid Majnemer2015-03-3011-88/+453
| | | | | | | | Generate tables in the .xdata section representing what actions to take when an exception is thrown. This currently fills in state for cleanups, catch handlers are still unfinished. llvm-svn: 233636
* LexicalScopes: Use MDLocation directly instead of DebugLocDuncan P. N. Exon Smith2015-03-301-12/+10
| | | | | | | There's no benefit to using `DebugLoc` here. Moreover, this will let a follow-up commit work with `MDScope` directly instead of `DebugLoc`. llvm-svn: 233610
* [RegisterCoalescer] Fix a potential misuse of direct operand index in theQuentin Colombet2015-03-301-4/+6
| | | | | | | terminal rule. Spot by code inspection. llvm-svn: 233606
* DwarfDebug: Avoid creating new DebugLocs in the backendDuncan P. N. Exon Smith2015-03-301-5/+3
| | | | | | | Don't use `DebugLoc::getFnDebugLoc()`, which creates new `MDLocation`s, in the backend. We just want to grab the subprogram here anyway. llvm-svn: 233601
* [opaque pointer type] More IRBuilder::createGEP (non-inbounds) migrations: ↵David Blaikie2015-03-301-3/+4
| | | | | | CodeGenPrepare and SimplifyLibCalls llvm-svn: 233596
* CodeGen: Use the new DebugLoc API, NFCDuncan P. N. Exon Smith2015-03-307-52/+35
| | | | | | Update lib/CodeGen (and lib/Target) to use the new `DebugLoc` API. llvm-svn: 233582
* SelectionDAG: Reflow code to use early returns, NFCDuncan P. N. Exon Smith2015-03-301-15/+19
| | | | llvm-svn: 233577
* Use SDValue bool check to tidyup some possible vector folding ops. NFC.Simon Pilgrim2015-03-291-40/+35
| | | | llvm-svn: 233498
* Use SDValue bool check to tidyup some possible ReassociateOps. NFC.Simon Pilgrim2015-03-291-10/+5
| | | | llvm-svn: 233495
OpenPOWER on IntegriCloud