Commit Graph

117917 Commits

Author SHA1 Message Date
Rafael Espindola
48f886b9de Simplify LastLocalSymbolIndex computation. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238465 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 19:46:36 +00:00
Rafael Espindola
b665c2b05e Use range loops. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238463 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 19:43:20 +00:00
Pete Cooper
40d9379cd5 Add BranchProbabilityInfo::releaseMemory to clear the Weights field.
BranchProbabilityInfo was leaking 3MB of memory when running 'opt -O2 verify-uselistorder.lto.bc'.  This was due to the Weights member not being cleared once the pass is no longer needed.

This adds the releaseMemory override to clear that field.  The other fields are cleared at the end of runOnFunction so can stay there.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238462 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 19:43:06 +00:00
Rafael Espindola
24441414a3 Remove temporary FileSymbolData. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238461 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 19:29:15 +00:00
Colin LeMahieu
cada158dc3 [Objdump] Allow instruction pretty printing to be specialized by the target triple.
Differential Revision: http://reviews.llvm.org/D8427

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238457 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 19:07:14 +00:00
Duncan P. N. Exon Smith
bfecc6bdee AsmPrinter: Rename begin_values() => values_begin(), NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238456 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 18:55:38 +00:00
Colin LeMahieu
58dd70dced [llvm] Parameterizing the output stream for dumpbytes and outputting directly to stream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238453 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 18:39:50 +00:00
David Majnemer
967f6ad3e1 [InstCombine] Fold IntToPtr and PtrToInt into preceding loads.
Currently we only fold a BitCast into a Load when the BitCast is its
only user.

Do the same for any no-op cast.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238452 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 18:39:17 +00:00
Alexey Samsonov
ef1de3295a Add llvm-dwarfdump-fuzzer that uses LibFuzzer to fuzz llvm-dwarfdump tool.
The fuzzer is very simple, but not quite useful at the moment: it's unable
to discover "interesting" examples, as LLVMObject library is terrible at
error recovery, calling "report_fatal_error()" far too often.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238451 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 18:35:18 +00:00
Owen Anderson
2f6ca834ff Add support for the convergent flag at the MC and MachineInstr levels.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238450 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 18:33:39 +00:00
Chad Rosier
4c9279423e Reuse Loc variable. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238448 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 18:18:21 +00:00
Duncan P. N. Exon Smith
3899951490 AsmPrinter: Suppress warnings on GCC from r238362, NFC
GCC seems to have some overzealous warnings about strict aliasing.
Rafael reports that this patch suppresses them on GCC 4.9, and I'm
hoping this will work for GCC 4.7 as well.  I'll watch [1] and iterate
if necessary.

[1]: http://bb.pgr.jp/builders/clang-3stage-x86_64-linux/builds/8597

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238447 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 18:09:13 +00:00
Rafael Espindola
fd64e0f71a Use range loops for accessing file names. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238446 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 18:03:20 +00:00
Owen Anderson
ca67e337bf Expand the Flags field of MCInstrDesc to 64 bits, while simultaneously
shrinking the Size and NumDefs fields to offset the size growth, and
reordering the fields to preserve a good packing.

This is necessary in the short term for adding a convergent flag, and
simultaneously future-proofs us against more flags being added in the
future.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238445 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 18:03:07 +00:00
Rafael Espindola
b9ffeb0979 Merge computeSymbolTable and writeSymbolTable.
For now this just saves a few loops, but it will allow more simplifications
in the future.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238444 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 17:54:01 +00:00
Kai Nacke
95fa1db8f5 [mips] Add new format for dmtc2/dmfc2 for Octeon CPUs.
Octeon CPUs use dmtc2 rt,imm16 and dmfcp2 rt,imm16 for the crypto coprocessor.
E.g. dmtc2 rt,0x4057 starts calculation of sha-1.

I had to introduce a new deconding namespace to avoid a decoding conflict.

Reviewed By: dsanders

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238439 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 16:23:16 +00:00
Ed Maste
5d25204af9 DebugInfo: .debug_line DWARF64 support
This adds support for the 64-bit DWARF format, but is still limited to
less than 4GB of debug data by the DataExtractor class.  Some versions
of the GNU MIPS toolchain generate 64-Bit DWARF even though it isn't
actually necessary.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238434 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 15:38:17 +00:00
Rafael Espindola
c4e38f605e Don't create an unused _GLOBAL_OFFSET_TABLE_.
This was a bug for bug compatibility with gas that is completely unnecessary.
If a _GLOBAL_OFFSET_TABLE_ symbol is used, it will already be created by
the time we get to the ELF writer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238432 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 15:20:00 +00:00
Renato Golin
6952e75aa5 [ARMTargetParser] Adding sub-arch information for Clang. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238429 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 15:05:18 +00:00
Daniel Sanders
8bf191d139 [mips] Make TTypeEncoding indirect to allow .eh_frame to be read-only.
Summary:
Following on from r209907 which made personality encodings indirect, do the
same for TType encodings. This fixes the case where a try/catch block needs
to generate references to, for example, std::exception in the
.gcc_except_table.

Reviewers: petarj

Reviewed By: petarj

Subscribers: srhines, joerg, tberghammer, llvm-commits

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238427 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 14:52:15 +00:00
Petar Jovanovic
a703f676f7 [Mips64] Add support for MCJIT for MIPS64r2 and MIPS64r6
Add support for resolving MIPS64r2 and MIPS64r6 relocations in MCJIT.

Patch by Vladimir Radosavljevic.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238424 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 13:48:41 +00:00
Aaron Ballman
b97d261a17 Silencing two signed/unsigned mismatch warnings; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238419 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 12:55:59 +00:00
Benjamin Kramer
331b719b2b [AsmPrinter] Destroy allocated DIEAbbrevs on teardown.
DIEAbbrev contains a SmallVector that can leak for overly large abbrevs. They
used to be owned by the DIE, but after the recent refactoring DWARFFile
allocates its own abbrevs.

Leak found by asan.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238418 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 12:55:43 +00:00
Renato Golin
1af0c40934 [ARMTargetParser] Adding a few more CPUs for Clang CPU detection. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238415 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 12:10:37 +00:00
Benjamin Kramer
7f4bf08286 [MC] Replace custom string join function with the one from StringExtras.
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238414 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 11:45:32 +00:00
Benjamin Kramer
24bccaf9f9 Don't call utostr in Twine/raw_ostream contexts.
Creating temporary std::strings there is unnecessary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238412 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 11:24:24 +00:00
Renato Golin
ae2de5d12b Fix comments in ARMTargetParser. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238404 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 08:59:03 +00:00
Yury Gribov
bf2ac0e578 [ASan] Fix previous commit. Patch by Max Ostapenko!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238403 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 08:03:28 +00:00
Yury Gribov
08e5ec43f4 [ASan] New approach to dynamic allocas unpoisoning. Patch by Max Ostapenko!
Differential Revision: http://reviews.llvm.org/D7098


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238402 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 07:51:49 +00:00
Craig Topper
aac3ba8fad [TableGen] Use DefInit::getAsString instead of getDef()->getName(). NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238399 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 06:38:32 +00:00
Craig Topper
38e3e6a195 [TableGen] Don't convert types to strings to query what they are. Just use 'isa'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238398 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 06:38:28 +00:00
David Majnemer
48e2671cb6 [Reassociate] Canonicalizing 'x [+-] (-Constant * y)' isn't always a win
Canonicalizing 'x [+-] (-Constant * y)' is not a win if we don't *know*
we will open up CSE opportunities.

If the multiply was 'nsw', then negating 'y' requires us to clear the
'nsw' flag.  If this is actually worth pursuing, it is probably more
appropriate to do so in GVN or EarlyCSE.

This fixes PR23675.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238397 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 06:16:39 +00:00
Jingyue Wu
4977e92629 [NaryReassociate] Run EarlyCSE after NaryReassociate
Summary:
This patch made two improvements to NaryReassociate and the NVPTX pipeline

1. Run EarlyCSE/GVN after NaryReassociate to get rid of redundant common
expressions.

2. When adding an instruction to SeenExprs, maps both the SCEV before and after
reassociation to that instruction.

Test Plan: updated @reassociate_gep_nsw in nary-gep.ll

Reviewers: meheff, broune

Reviewed By: broune

Subscribers: dberlin, jholewinski, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238396 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 04:56:52 +00:00
Chandler Carruth
9dacaea1a1 [x86] Refactor the tests for popcnt.
Extracted from the D6531 patch by Bruno Cardoso Lopes, and re-generated
to reflect the current state of the world. This should let Bruno's D6531
actually show the delta between the approaches by running the x86 test
case update script after re-building.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238391 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 02:40:15 +00:00
Chandler Carruth
bd47c6b559 [omp] Actually provide a default OpenMP runtime -- libgomp for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238390 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 02:17:15 +00:00
Chandler Carruth
ba80ee7307 [omp] Add a configuration variable for the default OpenMP runtime.
This will be used in my next commit to Clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238388 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 01:47:22 +00:00
Duncan P. N. Exon Smith
2c46a37b03 AsmPrinter: Avoid a warning in NDEBUG, NFC
Should fix the -Werror release build:
http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/11113

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238375 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 23:02:36 +00:00
Duncan P. N. Exon Smith
59be554de4 AsmPrinter: Return added DIE from DIE::addChild()
Change `DIE::addChild()` to return a reference to the just-added node,
and update consumers to use it directly.  An upcoming commit will
abstract away (and eventually change) the underlying storage of
`DIE::Children`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238372 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 22:59:03 +00:00
Fiona Glaser
49e9f44cb1 RegisterPressure: fix debug prints in case of physical registers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238371 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 22:51:47 +00:00
Duncan P. N. Exon Smith
636aba5bd1 AsmPrinter: Stop exposing underlying DIEValue list, NFC
Change the `DIE` API to hide the implementation of the list of
`DIEValue`s.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238369 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 22:44:06 +00:00
Duncan P. N. Exon Smith
95afdd3a07 AsmPrinter: Remove DIEHash::AttrEntry, NFC
Remove "the most boring struct ever" (thanks to review by Eric).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238366 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 22:36:37 +00:00
Duncan P. N. Exon Smith
611a2f2322 AsmPrinter: Store abbreviation data directly in DIE and DIEValue
Stop storing a `DIEAbbrev` in `DIE`, since the data fits neatly inside
the `DIEValue` list.  Besides being a cleaner data structure (avoiding
the parallel arrays), this gives us more freedom to rearrange the
`DIEValue` list.

This fixes the temporary memory regression from 845 MB up to 879 MB, and
drops it further to 829 MB for a net memory decrease of around 1.9%
(incremental decrease around 5.7%).

(I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`;
see r236629 for details.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238364 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 22:31:41 +00:00
Duncan P. N. Exon Smith
09fe4bf794 Reapply "AsmPrinter: Change DIEValue to be stored by value"
This reverts commit r238350, effectively reapplying r238349 after fixing
(all?) the problems, all somehow related to how I was using
`AlignedArrayCharUnion<>` inside `DIEValue`:

  - MSVC can only handle `sizeof()` on types, not values.  Change the
    assert.
  - GCC doesn't know the `is_trivially_copyable` type trait.  Instead of
    asserting it, add destructors.
  - Call placement new even when constructing POD (i.e., the pointers).
  - Instead of copying the char buffer, copy the casted classes.

I've left in a couple of `static_assert`s that I think both MSVC and GCC
know how to handle.  If the bots disagree with me, I'll remove them.

  - Check that the constructed type is either standard layout or a
    pointer.  This protects against a programming error: we really want
    the "small" `DIEValue`s to be small and simple, so don't
    accidentally change them not to be.
  - Similarly, check that the size of the buffer is no bigger than a
    `uint64_t` or a pointer.  (I thought checking against
    `sizeof(uint64_t)` would be good enough, but Chandler suggested that
    pointers might sometimes be bigger than that in the context of
    sanitizers.)

I've also committed r238359 in the meantime, which introduces a
DIEValue.def to simplify dispatching between the various types (thanks
to a review comment by David Blaikie).  Without that, this commit would
be almost unintelligible.

Here's the original commit message:
--
Change `DIEValue` to be stored/passed/etc. by value, instead of
reference.  It's now a discriminated union, with a `Val` field storing
the actual type.  The classes that used to inherit from `DIEValue` no
longer do.  There are two categories of these:

  - Small values fit in a single pointer and are stored by value.
  - Large values require auxiliary storage, and are stored by reference.

The only non-mechanical change is to tools/dsymutil/DwarfLinker.cpp.  It
was relying on `DIEInteger`s being passed around by reference, so I
replaced that assumption with a `PatchLocation` type that stores a safe
reference to where the `DIEInteger` lives instead.

This commit causes a temporary regression in memory usage, since I've
left merging `DIEAbbrevData` into `DIEValue` for a follow-up commit.  I
measured an increase from 845 MB to 879 MB, around 3.9%.  The follow-up
drops it lower than the starting point, and I've only recently brought
the memory this low anyway, so I'm committing these changes separately
to keep them incremental.  (I also considered swapping the commits, but
the other one first would cause a lot more code churn.)

(I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`;
see r236629 for details.)
--

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238362 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 22:14:58 +00:00
Duncan P. N. Exon Smith
344593ce6c AsmPrinter: Introduce DIEValue.def, NFC
Use a .def macro file to iterate through the various subclasses of
`DIEValue`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238359 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 21:15:43 +00:00
Rafael Espindola
792e158397 Rename and move getCurrentSectionData.
I think this concludes the merge of MCSectionData and MCSection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238358 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 21:04:14 +00:00
Rafael Espindola
41cea417fa There is only one current section.
Both MCStreamer and MCObjectStreamer were maintaining a current section
variable and they were slightly out of sync. I don't think this was observable,
but was inefficient and error prone.

Changing this requires a few cascading changes:

* SwitchSection has to call ChangeSection earlier for ChangeSection to see
  the old section.
* With that change, ChangeSection cannot call EmitLabel, since during
  ChangeSection we are still in the old section.
* When the object streamer requires a begin label, just reused the existing
  generic support for begin labels instead of calling EmitLabel directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238357 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 20:52:32 +00:00
Lang Hames
8cc212a07e [RuntimeDyld] Fix MachO i386 SECTDIFF relocation to support non-zero addends.
Previously, relocations of the form 'A - B + C' would fail on i386 when C was
non-zero.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238356 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 20:50:01 +00:00
Renato Golin
deae59fceb ARMTargetParser: Make BSD Thumb/BE armv6 work
Simple change to make arch like "thumbv6" and "armbev6" to return the
correct CPU for FreeBSD and NetBSD.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238353 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 19:49:53 +00:00
Alex Lorenz
711655614b MIR: Remove 2 empty non-reverted directories form SVN.
The revert commit r238007 didn't delete the old 'MIR' directories
in 'include/llvm/CodeGen' and 'lib/CodeGen'. Since the resubmitted
commit r238341 uses the 'MIRParser' directories instead of 'MIR'
this commit deletes the unused directories.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238352 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 19:39:44 +00:00
Diego Novillo
b72f3e0d32 Final fix for PR 23499 and IR test case.
This fixes a bit I forgot in r238335. In addition to the data record and
the counter, we can also move the name of the counter to the comdat for
the associated function.

I'm also adding an IR test case to check that these three elements are
placed in the proper comdat.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238351 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 19:34:01 +00:00