Commit Graph

16616 Commits

Author SHA1 Message Date
Craig Topper
72c93595de Convert getMemIntrinsicNode to take ArrayRef of SDValue instead of pointer and size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207329 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-26 19:29:41 +00:00
Craig Topper
80d8db7a1f Convert SelectionDAG::getNode methods to use ArrayRef<SDValue>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207327 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-26 18:35:24 +00:00
Craig Topper
57d7597572 Remove an unused version of getMemIntrinsicNode and getNode. Additionally, these were calling makeVTList with the pointers passed in which would were unlikely to belong to SelectionDAG and likely would have just been stack pointers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207326 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-26 18:35:13 +00:00
David Blaikie
4f18a81aba DWARF Type Units: Avoid emitting type units under fission if the type requires an address.
Since there's no way to ensure the type unit in the .dwo and the type
unit skeleton in the .o are correlated, this cannot work.

This implementation is a bit inefficient for a few reasons, called out
in comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207323 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-26 17:27:38 +00:00
David Blaikie
f95477d11f DwarfDebug: Minor refactoring around type unit construction
Sinking addition of the declaration attribute down to where the
signature is added. So that if the signature is not added neither is the
declaration attribute (this will come in handy when aborting type unit
construction to instead emit the type into the CU directly in some
cases)

Pull out type unit identifier hashing just to simplify the function a
little, it'll be getting longer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207321 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-26 16:26:41 +00:00
Benjamin Kramer
75125c127d Rip out X86-specific vector SDIV lowering, make the corresponding DAGCombiner transform work on vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207316 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-26 13:00:53 +00:00
Benjamin Kramer
aab6231cd9 DAGCombiner: Turn divs of vector splats into vectorized multiplications.
Otherwise the legalizer would just scalarize everything. Support for
mulhi in the targets isn't that great yet so on most targets we get
exactly the same scalarized output. Add a test for x86 vector udiv.

I had to disable the mulhi nodes on ARM because there aren't any patterns
for it. As far as I know ARM has instructions for getting the high part of
a multiply so this should be fixed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207315 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-26 12:06:28 +00:00
Michael Zolotukhin
abd7ca0706 Revert r206749 till a final decision about the intrinsics is made.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207313 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-26 09:56:41 +00:00
Juergen Ributzka
d10a9fb25a [DAG] During DAG legalization keep opaque constants even after expanding.
The included test case would return the incorrect results, because the expansion
of an shift with a constant shift amount of 0 would generate undefined behavior.

This is because ExpandShiftByConstant assumes that all shifts by constants with
a value of 0 have already been optimized away. This doesn't happen for opaque
constants and usually this isn't a problem, because opaque constants won't take
this code path - they are not supposed to. In the case that the opaque constant
has to be expanded by the legalizer, the legalizer would drop the opaque flag.
In this case we hit the limitations of ExpandShiftByConstant and create incorrect
code.

This commit fixes the legalizer by not dropping the opaque flag when expanding
opaque constants and adding an assertion to ExpandShiftByConstant to catch this
not supported case in the future.

This fixes <rdar://problem/16718472>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207304 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-26 02:58:04 +00:00
Eric Christopher
eed2620611 Make sure that rangelists are also relative to the compile unit
low_pc similar to location lists.

Fixes PR19563

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207283 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-25 22:23:54 +00:00
David Blaikie
82a35bf01a DwarfAccelTable: Store the string symbol in the accelerator table to avoid duplicate lookup.
This also avoids the need for subtly side-effecting calls to manifest
strings in the string table at the point where items are added to the
accelerator tables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207281 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-25 22:21:35 +00:00
David Blaikie
891481f89d Encapsulate the DWARF string pool in a separate type.
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
2014-04-25 21:34:35 +00:00
Adrian Prantl
988b78a846 This reapplies r207235 with an additional bugfixes caught by the msan
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
2014-04-25 20:49:25 +00:00
David Blaikie
9c6a820aa7 DwarfUnit: Remove unused function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207264 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-25 20:02:24 +00:00
David Blaikie
12d5224df6 DIE: Pass ownership of children via std::unique_ptr rather than raw pointer.
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
2014-04-25 20:00:34 +00:00
David Blaikie
172515f0be DIEEntry: Refer to the specified DIE via reference rather than pointer.
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
2014-04-25 19:33:43 +00:00
David Blaikie
d48f5efa9d DwarfUnit: return by reference from createAndAddDIE
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
2014-04-25 18:52:29 +00:00
David Blaikie
5410b5acda Return DIE by reference instead of pointer from DwarfUnit::getUnitDie
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207255 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-25 18:35:57 +00:00
David Blaikie
f6e00376e7 DwarfUnit: Suddently, DIE references, everywhere.
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
2014-04-25 18:26:14 +00:00
Adrian Prantl
25c74de500 Revert "This reapplies r207130 with an additional testcase+and a missing 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
2014-04-25 18:18:09 +00:00
David Blaikie
7d772dda4e Refactor some common logic in DwarfUnit::constructVariableDIE and pass 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
2014-04-25 17:32:19 +00:00
Adrian Prantl
7e96d88347 This reapplies r207130 with an additional testcase+and a missing check for
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
2014-04-25 17:01:00 +00:00
David Blaikie
3d79151a14 Add missing cpp file header
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
2014-04-25 06:22:32 +00:00
Adrian Prantl
680311d2d2 Revert "This reapplies r207130 with an additional testcase+and a missing check for"
Typo in testcase.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207166 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-25 00:42:50 +00:00
Adrian Prantl
50e7ba14ca This reapplies r207130 with an additional testcase+and a missing check for
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
2014-04-25 00:38:40 +00:00
Adrian Prantl
ab6ab3c333 Revert "Debug info for optimized code: Support variables that are on the 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
2014-04-25 00:04:49 +00:00
Richard Smith
d24fc958e8 Remove C++11ism (specializing a template in a surrounding namespace) to appease the buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207136 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-24 18:49:15 +00:00
Richard Smith
778aacb5a3 [modules] "Specialize" a function by actually specializing a function template
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
2014-04-24 18:27:29 +00:00
Adrian Prantl
f28f471f16 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-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
2014-04-24 17:41:45 +00:00
Craig Topper
e703fcb975 [C++] Use 'nullptr'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207083 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-24 06:44:33 +00:00
David Blaikie
c118614379 Remove unused parameter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207061 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-24 01:25:10 +00:00
David Blaikie
a0d6bcc183 Remove the intermediate AccelTypes maps in DWARF units.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207060 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-24 01:23:49 +00:00
David Blaikie
e33575f577 Remove the intermediate AccelNamespace maps in DWARF units.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207059 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-24 01:02:42 +00:00
David Blaikie
b53610141c Remove the intermediate AccelObjC maps in DWARF units
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207057 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-24 00:53:32 +00:00
David Blaikie
23615f8f5c And actually use the DwarfDebug::AccelNames to emit the names.
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
2014-04-23 23:46:25 +00:00
David Blaikie
b8ebb28c65 More formatting...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207050 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-23 23:38:39 +00:00
David Blaikie
c8bd54be97 Remove intermediate accelerator table for names.
(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
2014-04-23 23:37:35 +00:00
David Blaikie
e69ea7d8ae DwarfAccelTable: Remove trivial dtor and simplify construction with an array.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207044 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-23 23:03:45 +00:00
David Blaikie
08e5ef25fb Move the AddressPool from DwarfFile to DwarfDebug.
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
2014-04-23 21:20:10 +00:00
David Blaikie
2bff66859e clang-format for my previous commit (I keep forgetting... )
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207025 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-23 21:20:07 +00:00
David Blaikie
e384ec7853 Separate out the DWARF address pool into its own type/files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207022 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-23 21:04:59 +00:00
David Blaikie
53008d6713 clang-format r207010
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207016 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-23 19:44:08 +00:00
David Blaikie
1188a75aa0 Split out DwarfFile from DwarfDebug into its own .h/.cpp files.
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
2014-04-23 18:54:00 +00:00
Evgeniy Stepanov
d6af41b2eb Create MCTargetOptions.
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
2014-04-23 11:16:03 +00:00
David Blaikie
1a4a8b94fd Requisite reformatting for previous commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206927 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-22 23:09:36 +00:00
David Blaikie
875f90e527 Push memory ownership of DwarfUnits into clients of DwarfFile.
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
2014-04-22 22:39:41 +00:00
David Blaikie
0eb05e272a Use std::unique_ptr to handle ownership of DwarfUnits in DwarfFile.
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
2014-04-22 21:27:37 +00:00
David Blaikie
795e462cc4 Simplify address pool index assignment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206905 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-22 17:21:40 +00:00
Hao Liu
07dcdc7c90 Fix an infinite loop bug in DAG Combine about keeping transfering between ANY_EXTEND and SIGN_EXTEND.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206873 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-22 09:57:06 +00:00
David Blaikie
ada34b3414 Revert "Use value semantics to manage DbgVariables rather than dynamic 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
2014-04-22 05:41:06 +00:00