summaryrefslogtreecommitdiff
path: root/lib/CodeGen
Commit message (Collapse)AuthorAge
...
* Encapsulate the DWARF string pool in a separate type.David Blaikie2014-04-25
| | | | | | | | | Pulls out some more code from some of the rather monolithic DWARF classes. Unlike the address table, the string table won't move up into DwarfDebug - each DWARF file has its own string table (but there can be only one address table). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207277 91177308-0d34-0410-b5e6-96231b3b80d8
* This reapplies r207235 with an additional bugfixes caught by the msanAdrian Prantl2014-04-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | buildbot - do not insert debug intrinsics before phi nodes. Debug info for optimized code: Support variables that are on the stack and described by DBG_VALUEs during their lifetime. Previously, when a variable was at a FrameIndex for any part of its lifetime, this would shadow all other DBG_VALUEs and only a single fbreg location would be emitted, which in fact is only valid for a small range and not the entire lexical scope of the variable. The included dbg-value-const-byref testcase demonstrates this. This patch fixes this by Local - emitting dbg.value intrinsics for allocas that are passed by reference - dropping all dbg.declares (they are now fully lowered to dbg.values) SelectionDAG - renamed constructors for SDDbgValue for better readability. - fix UserValue::match() to handle indirect values correctly - not inserting an MMI table entries for dbg.values that describe allocas. - lowering dbg.values that describe allocas into *indirect* DBG_VALUEs. CodeGenPrepare - leaving dbg.values for an alloca were they are (see comment) Other - regenerated/updated instcombine.ll testcase and included source rdar://problem/16679879 http://reviews.llvm.org/D3374 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207269 91177308-0d34-0410-b5e6-96231b3b80d8
* DwarfUnit: Remove unused functionDavid Blaikie2014-04-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207264 91177308-0d34-0410-b5e6-96231b3b80d8
* DIE: Pass ownership of children via std::unique_ptr rather than raw pointer.David Blaikie2014-04-25
| | | | | | | | | | | This should reduce the chance of memory leaks like those fixed in r207240. There's still some unclear ownership of DIEs happening in DwarfDebug. Pushing unique_ptr and references through more APIs should help expose the cases where ownership is a bit fuzzy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207263 91177308-0d34-0410-b5e6-96231b3b80d8
* DIEEntry: Refer to the specified DIE via reference rather than pointer.David Blaikie2014-04-25
| | | | | | | Makes some more cases (the unit tests, specifically), lexically compatible with a change to unique_ptr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207261 91177308-0d34-0410-b5e6-96231b3b80d8
* DwarfUnit: return by reference from createAndAddDIEDavid Blaikie2014-04-25
| | | | | | | Since this doesn't return ownership (the DIE has been added to the specified parent already) nor return null, just return by reference. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207259 91177308-0d34-0410-b5e6-96231b3b80d8
* Return DIE by reference instead of pointer from DwarfUnit::getUnitDieDavid Blaikie2014-04-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207255 91177308-0d34-0410-b5e6-96231b3b80d8
* DwarfUnit: Suddently, DIE references, everywhere.David Blaikie2014-04-25
| | | | | | | | This'll make changing to unique_ptr ownership of DIEs easier since the usages will now have '*' on them making them textually compatible between unique_ptr and raw pointer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207253 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "This reapplies r207130 with an additional testcase+and a missing ↵Adrian Prantl2014-04-25
| | | | | | | | check for" This reverts commit 207235 to investigate msan buildbot breakage. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207250 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor some common logic in DwarfUnit::constructVariableDIE and pass ↵David Blaikie2014-04-25
| | | | | | non-null DIE by reference to DbgVariable::setDIE git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207244 91177308-0d34-0410-b5e6-96231b3b80d8
* This reapplies r207130 with an additional testcase+and a missing check forAdrian Prantl2014-04-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AllocaInst that was missing in one location. Debug info for optimized code: Support variables that are on the stack and described by DBG_VALUEs during their lifetime. Previously, when a variable was at a FrameIndex for any part of its lifetime, this would shadow all other DBG_VALUEs and only a single fbreg location would be emitted, which in fact is only valid for a small range and not the entire lexical scope of the variable. The included dbg-value-const-byref testcase demonstrates this. This patch fixes this by Local - emitting dbg.value intrinsics for allocas that are passed by reference - dropping all dbg.declares (they are now fully lowered to dbg.values) SelectionDAG - renamed constructors for SDDbgValue for better readability. - fix UserValue::match() to handle indirect values correctly - not inserting an MMI table entries for dbg.values that describe allocas. - lowering dbg.values that describe allocas into *indirect* DBG_VALUEs. CodeGenPrepare - leaving dbg.values for an alloca were they are (see comment) Other - regenerated/updated instcombine.ll testcase and included source rdar://problem/16679879 http://reviews.llvm.org/D3374 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207235 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing cpp file headerDavid Blaikie2014-04-25
| | | | | | Code review feedback from Paul Robinson on r207022 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207198 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "This reapplies r207130 with an additional testcase+and a missing ↵Adrian Prantl2014-04-25
| | | | | | | | check for" Typo in testcase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207166 91177308-0d34-0410-b5e6-96231b3b80d8
* This reapplies r207130 with an additional testcase+and a missing check forAdrian Prantl2014-04-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AllocaInst that was missing in one location. Debug info for optimized code: Support variables that are on the stack and described by DBG_VALUEs during their lifetime. Previously, when a variable was at a FrameIndex for any part of its lifetime, this would shadow all other DBG_VALUEs and only a single fbreg location would be emitted, which in fact is only valid for a small range and not the entire lexical scope of the variable. The included dbg-value-const-byref testcase demonstrates this. This patch fixes this by Local - emitting dbg.value intrinsics for allocas that are passed by reference - dropping all dbg.declares (they are now fully lowered to dbg.values) SelectionDAG - renamed constructors for SDDbgValue for better readability. - fix UserValue::match() to handle indirect values correctly - not inserting an MMI table entries for dbg.values that describe allocas. - lowering dbg.values that describe allocas into *indirect* DBG_VALUEs. CodeGenPrepare - leaving dbg.values for an alloca were they are (see comment) Other - regenerated/updated instcombine.ll testcase and included source rdar://problem/16679879 http://reviews.llvm.org/D3374 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207165 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Debug info for optimized code: Support variables that are on the ↵Adrian Prantl2014-04-25
| | | | | | | | stack and" This reverts commit 207130 for buildbot breakage. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207162 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove C++11ism (specializing a template in a surrounding namespace) to ↵Richard Smith2014-04-24
| | | | | | appease the buildbots. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207136 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] "Specialize" a function by actually specializing a function templateRichard Smith2014-04-24
| | | | | | | | rather than by adding an overload and hoping that it's declared before the code that calls it. (In a modules build, it isn't.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207133 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug info for optimized code: Support variables that are on the stack andAdrian Prantl2014-04-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | described by DBG_VALUEs during their lifetime. Previously, when a variable was at a FrameIndex for any part of its lifetime, this would shadow all other DBG_VALUEs and only a single fbreg location would be emitted, which in fact is only valid for a small range and not the entire lexical scope of the variable. The included dbg-value-const-byref testcase demonstrates this. This patch fixes this by Local - emitting dbg.value intrinsics for allocas that are passed by reference - dropping all dbg.declares (they are now fully lowered to dbg.values) SelectionDAG - renamed constructors for SDDbgValue for better readability. - fix UserValue::match() to handle indirect values correctly - not inserting an MMI table entries for dbg.values that describe allocas. - lowering dbg.values that describe allocas into *indirect* DBG_VALUEs. CodeGenPrepare - leaving dbg.values for an alloca were they are (see comment) Other - regenerated/updated instcombine-intrinsics testcase and included source rdar://problem/16679879 http://reviews.llvm.org/D3374 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207130 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++] Use 'nullptr'.Craig Topper2014-04-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207083 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused parameterDavid Blaikie2014-04-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207061 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the intermediate AccelTypes maps in DWARF units.David Blaikie2014-04-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207060 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the intermediate AccelNamespace maps in DWARF units.David Blaikie2014-04-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207059 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the intermediate AccelObjC maps in DWARF unitsDavid Blaikie2014-04-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207057 91177308-0d34-0410-b5e6-96231b3b80d8
* And actually use the DwarfDebug::AccelNames to emit the names.David Blaikie2014-04-23
| | | | | | Fix for r207049 which would've emitted no accelerated names at all... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207051 91177308-0d34-0410-b5e6-96231b3b80d8
* More formatting...David Blaikie2014-04-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207050 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove intermediate accelerator table for names.David Blaikie2014-04-23
| | | | | | (similar changes coming for the other accelerator tables) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207049 91177308-0d34-0410-b5e6-96231b3b80d8
* DwarfAccelTable: Remove trivial dtor and simplify construction with an array.David Blaikie2014-04-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207044 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the AddressPool from DwarfFile to DwarfDebug.David Blaikie2014-04-23
| | | | | | | | | There's only ever one address pool, not one per DWARF output file, so let's just have one. (similar refactoring of the string pool to come soon) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207026 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format for my previous commit (I keep forgetting... )David Blaikie2014-04-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207025 91177308-0d34-0410-b5e6-96231b3b80d8
* Separate out the DWARF address pool into its own type/files.David Blaikie2014-04-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207022 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format r207010David Blaikie2014-04-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207016 91177308-0d34-0410-b5e6-96231b3b80d8
* Split out DwarfFile from DwarfDebug into its own .h/.cpp files.David Blaikie2014-04-23
| | | | | | | | Some of these types (DwarfDebug in particular) are quite large to begin with (and I keep forgetting whether DwarfFile is in DwarfDebug or DwarfUnit... ) so having a few smaller files seems like goodness. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207010 91177308-0d34-0410-b5e6-96231b3b80d8
* Create MCTargetOptions.Evgeniy Stepanov2014-04-23
| | | | | | | | | | For now it contains a single flag, SanitizeAddress, which enables AddressSanitizer instrumentation of inline assembly. Patch by Yuri Gorshenin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206971 91177308-0d34-0410-b5e6-96231b3b80d8
* Requisite reformatting for previous commit.David Blaikie2014-04-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206927 91177308-0d34-0410-b5e6-96231b3b80d8
* Push memory ownership of DwarfUnits into clients of DwarfFile.David Blaikie2014-04-22
| | | | | | | | | | | | This prompted me to push references through most of DwarfDebug. Sorry for the churn. Honestly it's a bit silly that we're passing around units all over the place like that anyway and I think it's mostly due to the DIE attribute adding utility functions being utilities in DwarfUnit. I should have another go at moving them out of DwarfUnit... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206925 91177308-0d34-0410-b5e6-96231b3b80d8
* Use std::unique_ptr to handle ownership of DwarfUnits in DwarfFile.David Blaikie2014-04-22
| | | | | | | So Chandler - how about those range algorithms? (would really love a dereferencing range adapter for this sort of stuff) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206921 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify address pool index assignment.David Blaikie2014-04-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206905 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an infinite loop bug in DAG Combine about keeping transfering between ↵Hao Liu2014-04-22
| | | | | | ANY_EXTEND and SIGN_EXTEND. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206873 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Use value semantics to manage DbgVariables rather than dynamic ↵David Blaikie2014-04-22
| | | | | | | | | | | allocation/pointers." This reverts commit r206780. This commit was regressing gdb.opt/inline-locals.exp in the GDB 7.5 test suite. Reverting until I can fix the issue. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206867 91177308-0d34-0410-b5e6-96231b3b80d8
* [Modules] Remove potential ODR violations by sinking the DEBUG_TYPEChandler Carruth2014-04-22
| | | | | | | | | | | | define below all header includes in the lib/CodeGen/... tree. While the current modules implementation doesn't check for this kind of ODR violation yet, it is likely to grow support for it in the future. It also removes one layer of macro pollution across all the included headers. Other sub-trees will follow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206837 91177308-0d34-0410-b5e6-96231b3b80d8
* [CodeGenPrepare] Use APInt to check the value of the immediate in a andQuentin Colombet2014-04-22
| | | | | | | | | | | while checking candidate for bit field extract. Otherwise the value may not fit in uint64_t and this will trigger an assertion. This fixes PR19503. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206834 91177308-0d34-0410-b5e6-96231b3b80d8
* [Modules] Make Support/Debug.h modular. This requires it to not changeChandler Carruth2014-04-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206822 91177308-0d34-0410-b5e6-96231b3b80d8
* Set default value of HasExtractBitsInsn to falseYi Jiang2014-04-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206803 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove seemingly-unneeded artificial dependencyHal Finkel2014-04-21
| | | | | | | | | | | | | | | | The rationale for this artificial dependency seems to have been lost to the ravages of time, it is covered by no regression tests, and has no impact on test-suite performance numbers on either x86 or PPC. For the test suite, on both x86 and PPC, I ran the test suite 10 times (both as a baseline and with this change), and found no statistically-significant changes. For PPC, I used a P7 box. For x86, I used an Intel Xeon E5430. Both with -O3 -mcpu=native. This was discussed on-list back in January, but I've not had a chance to run the performance tests until today. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206795 91177308-0d34-0410-b5e6-96231b3b80d8
* Use unique_ptr to handle ownership of UserValues in LiveDebugVariablesImplDavid Blaikie2014-04-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206785 91177308-0d34-0410-b5e6-96231b3b80d8
* Use unique_ptr to manage objects owned by the ScheduleDAGMI.David Blaikie2014-04-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206784 91177308-0d34-0410-b5e6-96231b3b80d8
* Use value semantics to manage DbgVariables rather than dynamic ↵David Blaikie2014-04-21
| | | | | | | | | | allocation/pointers. Requires switching some vectors to lists to maintain pointer validity. These could be changed to forward_lists (singly linked) with a bit more work - I've left comments to that effect. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206780 91177308-0d34-0410-b5e6-96231b3b80d8
* [Modules] Sink the DEBUG_TYPE macro out of LegalizeTypes.h and into theChandler Carruth2014-04-21
| | | | | | | various .cpp files. This macro is inherently non-modular, and it wasn't even needed in this header file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206775 91177308-0d34-0410-b5e6-96231b3b80d8
* ARM64: Combine shifts and uses from different basic block to bit-extract ↵Yi Jiang2014-04-21
| | | | | | instruction git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206774 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix unnecessary line breakMatt Arsenault2014-04-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206772 91177308-0d34-0410-b5e6-96231b3b80d8