Commit Graph

24556 Commits

Author SHA1 Message Date
Damián Silvani 964a041a08 Eliminate big-endian subtargets of Mos6502
They were copied from SPARC V8 and V9.
2015-08-03 17:13:53 -03:00
Damián Silvani 36ee8fe697 Register Mos6502 target
Also add mos6502 subtargets on Triple class
2015-08-02 22:47:30 -03:00
Duncan P. N. Exon Smith 5bb95798bc AsmPrinter: Stop inheriting from DIE
Change `DIELoc` and `DIEBlock` to stop inheriting from `DIE`, instead
inheriting from `DIEValueList` to share the value storage API.  This
awkward bit of code-sharing was also fairly confusing: neither `DIELoc`
nor `DIEBlock` represents a `DIE`, so why would they inherit from it?

Aside from the API cleanup, this should improve debug info memory usage
in the backend, since it shaves five pointers off of every `DIELoc` and
`DIEBlock`.  I haven't bothered to measure the savings, though.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243858 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-02 20:54:50 +00:00
Duncan P. N. Exon Smith bc3c2c319c AsmPrinter: Change DIEValueList to a subclass of DIE, NFC
Rewrite `DIEValueList` as a subclass of `DIE`, renaming its API to match
`DIE`'s.  This is preparation for changing `DIEBlock` and `DIELoc` to
stop inheriting from `DIE` and inherit directly from `DIEValueList`.

I thought about leaving this as a has-a relationship (and changing
`DIELoc` and `DIEBlock` to also have-a `DIEValueList`), but that seemed
to require a fair bit more boilerplate and I think it needed more
changes to the `DwarfUnit` API than this will.

No functionality change intended here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243854 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-02 20:42:45 +00:00
Duncan P. N. Exon Smith 1e95eedbab Remove dead code, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243853 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-02 20:40:05 +00:00
Andrew Wilkins 510a661596 Add support to set/get ordering for load/store from the C API
Summary: As per title

Reviewers: chandlerc, bogner, majnemer, axw

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D11141

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243847 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-02 12:16:57 +00:00
Craig Topper f03f83cfc0 Mark CompositeType::getTypeAtIndex as const. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243845 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-01 22:52:12 +00:00
Craig Topper 55afc08759 Mark Type::getPointerTo as const. Unfortunately, this requires a const_cast inside, but at least it makes all methods on Type const. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243844 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-01 22:20:31 +00:00
Craig Topper e0582480a4 Merge the const and non-const Type::getScalarType to a const version that returns a non-const pointer. Since we don't put const on Types all places were already calling the non-const version.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243843 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-01 22:20:27 +00:00
Craig Topper 84bbcfe200 De-constify pointers to Type since they can't be modified. NFC
This was already done in most places a while ago. This just fixes the ones that crept in over time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243842 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-01 22:20:21 +00:00
Yaron Keren 83d21e9cb2 Provide move constructor to appease Visual C++.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243836 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-01 15:50:53 +00:00
Simon Atanasyan e35d602838 [Mips] Support DT_MIPS_RLD_MAP_REL dynamic section tag in the llvm-readobj
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243833 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-01 12:02:02 +00:00
David Blaikie 0ef4b3cef4 Workaround some compilers that give a stricter throw spec to = default than implicit dtors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243823 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-01 05:10:37 +00:00
David Blaikie 14ec817aea Missing formatting
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243821 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-01 04:42:53 +00:00
David Blaikie 299ab3d150 -Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated in C++11
Various targets use std::swap on specific MCAsmOperands (ARM and
possibly Hexagon as well). It might be helpful to mark those subclasses
as final, to ensure that the availability of move/copy operations can't
lead to slicing. (same sort of requirements as the non-vitual dtor -
protected or a final class)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243820 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-01 04:40:41 +00:00
Alex Lorenz f5cf675376 AMDGPU/SI: Add implicit register operands in the correct order.
This commit fixes a bug in the class 'SIInstrInfo' where the implicit register
machine operands were added to a machine instruction in an incorrect order -
the implicit uses were added before the implicit defs.

I found this bug while working on moving the implicit register operand
verification code from the MIR parser to the machine verifier.

This commit also makes the method 'addImplicitDefUseOperands' in the machine
instruction class public so that it can be reused in the 'SIInstrInfo' class.

Reviewers: Matt Arsenault

Differential Revision: http://reviews.llvm.org/D11689


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243799 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-31 23:30:09 +00:00
Alex Lorenz c198b23a4d MIR Parser: Report an error when a jump table entry is redefined.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243798 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-31 23:13:23 +00:00
David Blaikie 7c24e4d3c5 Fix an MSVC build break since it can't synthesize move ctors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243792 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-31 21:47:07 +00:00
David Blaikie d79f0dd3d4 Fix a GCC buildbot that seemed to be having trouble producing the implicit move ctor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243791 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-31 21:47:04 +00:00
David Blaikie be031d9158 Fix some formatting from a recent commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243789 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-31 21:37:58 +00:00
David Blaikie 4c20864f94 -Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated in C++11
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243788 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-31 21:37:09 +00:00
David Blaikie b4b38d65e6 -Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated in C++11
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243786 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-31 21:26:16 +00:00
Duncan P. N. Exon Smith bf2040f00c DI: Remove DW_TAG_arg_variable and DW_TAG_auto_variable
Remove the fake `DW_TAG_auto_variable` and `DW_TAG_arg_variable` tags,
using `DW_TAG_variable` in their place Stop exposing the `tag:` field at
all in the assembly format for `DILocalVariable`.

Most of the testcase updates were generated by the following sed script:

    find test/ -name "*.ll" -o -name "*.mir" |
    xargs grep -l 'DILocalVariable' |
    xargs sed -i '' \
      -e 's/tag: DW_TAG_arg_variable, //' \
      -e 's/tag: DW_TAG_auto_variable, //'

There were only a handful of tests in `test/Assembly` that I needed to
update by hand.

(Note: a follow-up could change `DILocalVariable::DILocalVariable()` to
set the tag to `DW_TAG_formal_parameter` instead of `DW_TAG_variable`
(as appropriate), instead of having that logic magically in the backend
in `DbgVariable`.  I've added a FIXME to that effect.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243774 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-31 18:58:39 +00:00
David Majnemer 4c43d5bdfa Attempt to appease the MSVC build bots
They don't seem to care for initializing an ArrayRef with a
std::initializer_list.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243769 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-31 18:13:25 +00:00
David Majnemer 4a45f0871a New EH representation for MSVC compatibility
This introduces new instructions neccessary to implement MSVC-compatible
exception handling support.  Most of the middle-end and none of the
back-end haven't been audited or updated to take them into account.

Differential Revision: http://reviews.llvm.org/D11097

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243766 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-31 17:58:14 +00:00
Duncan P. N. Exon Smith aa50fa7c2f DI: Rewrite the DIBuilder local variable API
Replace the general `createLocalVariable()` with two more specific
functions: `createParameterVariable()` and `createAutoVariable()`, and
rewrite the documentation.

Besides cleaning up the API, this avoids exposing the fake DWARF tags
`DW_TAG_arg_variable` and `DW_TAG_auto_variable` to frontends, and is
preparation for removing them completely.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243764 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-31 17:55:53 +00:00
Sanjay Patel 29b8ad6749 don't repeat function names in comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243751 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-31 15:10:44 +00:00
Bruno Cardoso Lopes 8fea35acad [CaptureTracker] Provide an ordered basic block to PointerMayBeCapturedBefore
This patch is a follow up from r240560 and is a step further into
mitigating the compile time performance issues in CaptureTracker.

By providing the CaptureTracker with a "cached ordered basic block"
instead of computing it every time, MemDepAnalysis can use this cache
throughout its calls to AA->callCapturesBefore, avoiding to recompute it
for every scanned instruction. In the same testcase used in r240560,
compile time is reduced from 2min to 30s.

This also fixes PR22348.

rdar://problem/19230319
Differential Revision: http://reviews.llvm.org/D11364

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243750 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-31 14:31:35 +00:00
Alex Lorenz 2623dd4454 MIR Parser: Report an error when a constant pool item is redefined.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243696 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-30 22:00:17 +00:00
Alex Lorenz 2bc631660b MIR Parser: Report an error when a virtual register is redefined.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243695 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-30 21:54:10 +00:00
Mehdi Amini 93204d28b8 Add a TargetMachine hook that verifies DataLayout compatibility
Summary: Also provide the associated assertion when CodeGen starts.

Reviewers: echristo

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D11654

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243682 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-30 20:33:18 +00:00
Alex Lorenz fbd94791e6 MIR Serialization: Serialize the machine basic block's successor weights.
Reviewers: Duncan P. N. Exon Smith


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243659 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-30 16:54:38 +00:00
David Majnemer cfe562c99b [COFF] Add IMAGE_SCN_TYPE_NOLOAD to SectionCharacteristics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243658 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-30 16:47:56 +00:00
Matt Arsenault d8c145fd49 Add amdopencl environment to triple
This is used by the AMD x86 OpenCL implementation
to change some ABI details on Windows and Linux.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243627 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-30 08:16:51 +00:00
Adam Nemet 52aafdb50a [LDist] Filter the checks locally rather than in LAA, NFC
Before, we were passing the pointer partitions to LAA.  Now, we get all
the checks from LAA and filter out the checks within partitions in
LoopDistribution.

This effectively concludes the steps to move filtering memchecks from
LAA into its clients.  There is still some cleanup left to remove the
unused interfaces in LAA that still take PtrPartition.

(Moving this functionality to LoopDistribution also requires
needsChecking on pointers to be made public.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243613 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-30 03:29:16 +00:00
Pete Cooper b1d5086803 Prefix make_reverse_iterator with llvm namespace.
This was fallout from r243581.  Turns out C++14 has make_reverse_iterator.

Thanks to Filipe and David for the quick fix suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243598 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-30 00:40:42 +00:00
Matthias Braun 6821f63c91 IR: Implement Value::mergeUseLists() iteratively
This avoids stack overflows when the the compiler does not perform tail call
elimination. Apparently this happens for MSVC with the /Ob2 switch which
may be used by external code including this header.

Reported by and based on a patch from Jean-Francois Riendeau.

Related to rdar://21900756

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243590 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-29 23:22:48 +00:00
Nick Lewycky 6fc1adf9c7 Fix typo "fuction" noticed in comments in AssumptionCache.h, and also all the other files that have the same typo. All comments, no functionality change! (Merely a "fuctionality" change.)
Bonus change to remove emacs major mode marker from SystemZMachineFunctionInfo.cpp because emacs already knows it's C++ from the extension. Also fix typo "appeary" in AMDGPUMCAsmInfo.h.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243585 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-29 22:32:47 +00:00
Pete Cooper 639ec3da92 Reapply "Add reverse(ContainerTy) range adapter."
This reverts commit r243567, which ultimately reapplies r243563.

The fix here was to use std::enable_if for overload resolution.  Thanks to David
Blaikie for lots of help on this, and for the extra tests!

Original commit message follows:

For cases where we needed a foreach loop in reverse over a container,
we had to do something like

 for (const GlobalValue *GV : make_range(TypeInfos.rbegin(),
                                         TypeInfos.rend())) {

This provides a convenience method which shortens this to

 for (const GlobalValue *GV : reverse(TypeInfos)) {

There are 2 versions of this, with a preference to the rbegin() version.

The first uses rbegin() and rend() to construct an iterator_range.

The second constructs an iterator_range from the begin() and end() methods
wrapped in std::reverse_iterator's.

Reviewed by David Blaikie.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243581 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-29 22:19:09 +00:00
Eric Christopher b026a8ade1 Rename hasCompatibleFunctionAttributes->areInlineCompatible based
on suggestions. Currently the function is only used for inline purposes
and this is more descriptive for the use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243578 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-29 22:09:48 +00:00
Alex Lorenz 81474d36a0 MIR Serialization: Serialize the frame info's save and restore points.
This commit serializes the save and restore machine basic block references from
the machine frame information class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243575 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-29 21:09:09 +00:00
Pete Cooper c54abc96f8 Revert "Add reverse(ContainerTy) range adapter."
This reverts commit r243563.

The GCC buildbots were extremely unhappy about this.  Reverting while
we discuss a better way of doing overload resolution.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243567 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-29 20:29:10 +00:00
Pete Cooper a53ce4e0be Add reverse(ContainerTy) range adapter.
For cases where we needed a foreach loop in reverse over a container,
we had to do something like

  for (const GlobalValue *GV : make_range(TypeInfos.rbegin(),
                                          TypeInfos.rend())) {

This provides a convenience method which shortens this to

  for (const GlobalValue *GV : reverse(TypeInfos)) {

There are 2 versions of this, with a preference to the rbegin() version.

The first uses rbegin() and rend() to construct an iterator_range.

The second constructs an iterator_range from the begin() and end() methods
wrapped in std::reverse_iterator's.

Reviewed by David Blaikie.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243563 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-29 20:00:39 +00:00
Sanjay Patel 7a641cc940 move DAGCombiner's allowableAlignment() helper function into the TLI
Making allowableAlignment() more accessible was suggested as a predecessor patch
for D10662, so I've pulled it into TargetLowering. This let's us remove 4 instances
of duplicate logic in LegalizeDAG.

There's a subtle functional change in the implementation: the existing 
allowableAlignment() code was using getPrefTypeAlignment() when checking 
alignment with the DataLayout and assumed that was fast. In this implementation,
we use getABITypeAlignment() and assume that is fast. See the TODO comment or the
discussion in the Phab review for future improvements in this implementation
(don't use the data layout at all).

There are no regression test changes from this difference, and I'm not sure how to
expose it via a test. I think we actually do want to provide the 'Fast' param when
checking this from DAGCombiner::MergeConsecutiveStores(). Ie, we shouldn't merge 
stores if the new stores are not going to be fast. But that change will require 
fixing allowsMisalignedMemoryAccess() overrides as noted in D10662.

Differential Revision: http://reviews.llvm.org/D10905



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243549 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-29 18:24:18 +00:00
Peter Collingbourne 63aeece879 LowerBitSets: Add debugging output.
Differential Revision: http://reviews.llvm.org/D11583

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243546 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-29 18:12:36 +00:00
Lang Hames aaa9ff3d10 Fix typos in comments. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243542 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-29 18:07:48 +00:00
Bruno Cardoso Lopes 4e3c7c262b Revert "[PeepholeOptimizer] Look through PHIs to find additional register sources"
Reported to Broke some internal tests: PR24303

This reverts commit r243486.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243540 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-29 17:46:47 +00:00
Douglas Katzman de85af6733 Add an ArgList::AddAllArgs that accepts a vector of OptSpecifier.
This lifts the somewhat arbitrary restriction on 3 OptSpecifiers.

Differential Revision: http://reviews.llvm.org/D11597

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243539 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-29 17:34:41 +00:00
Aaron Ballman a229846f3f Reverting r243386 because it has serious post-commit concerns that have not been addressed. Also reverts r243389, which relied on this commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243527 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-29 15:57:49 +00:00
Bjarke Hammersholt Roune dc9125e8d1 Make function comments consistently imperative.
(tiny edit, mostly a test that my new commit access works)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243505 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-29 00:29:08 +00:00