Commit Graph

80121 Commits

Author SHA1 Message Date
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
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
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
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
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
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
Duncan P. N. Exon Smith
3c41ae83f2 Revert "AsmPrinter: Change DIEValue to be stored by value"
This reverts commit r238349, since it caused some errors on bots:
  - std::is_trivially_copyable isn't available until GCC 5.0.
  - It was complaining about strict aliasing with my use of
    ArrayCharUnion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238350 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 19:30:27 +00:00
Duncan P. N. Exon Smith
b9d92c6a8d AsmPrinter: Change DIEValue to be stored by value
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@238349 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 19:22:50 +00:00
Renato Golin
a052a77187 ARMTargetParser: Normalising build attributes
Now that most of the methods in Clang and LLVM that were parsing arch/cpu/fpu
strings are using ARMTargetParser, it's time to make it a bit more conforming
with what the ABI says.

This commit adds some clarification on what build attributes are accepted and
which are "non-standard". It also makes clear that the "defaultCPU" and
"defaultArch" methods were really just build attribute getters.

It also diverges from GCC's behaviour to say that armv2/armv3 are really an
ARMv4 in the build attributes, when the ABI has a clear state for that: Pre-v4.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238344 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 18:15:37 +00:00
Yaron Keren
fb421f446e Avoid creating and destroying a std::string on every iteration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238343 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 18:11:07 +00:00
Alex Lorenz
61aecc8c23 Resubmit r237954 (MIR Serialization: print and parse LLVM IR using MIR format).
This commit a 3rd attempt at comitting the initial MIR serialization patch.
The first commit (r237708) was reverted in 237730. Then the second commit
(r237954) was reverted in r238007, as the MIR library under CodeGen caused
a circular dependency where the CodeGen library depended on MIR and MIR
library depended on CodeGen.

This commit has fixed the dependencies between CodeGen and MIR by
reorganizing the MIR serialization code - the code that prints out
MIR has been moved to CodeGen, and the MIR library has been renamed
to MIRParser. Now the CodeGen library doesn't depend on the
MIRParser library, thus the circular dependency no longer exists.

--Original Commit Message--

MIR Serialization: print and parse LLVM IR using MIR format.

This commit is the initial commit for the MIR serialization project.
It creates a new library under CodeGen called 'MIR'. This new
library adds a new machine function pass that prints out the LLVM IR
using the MIR format. This pass is then added as a last pass when a
'stop-after' option is used in llc. The new library adds the initial
functionality for parsing of MIR files as well. This commit also
extends the llc tool so that it can recognize and parse MIR input files.

Reviewers: Duncan P. N. Exon Smith, Matthias Braun, Philip Reames

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238341 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 18:02:19 +00:00
Jan Vesely
e93c0d6817 R600: Rely on TypeLegalizer to use divrem instead of div/rem
reviewer: tstellardAMD

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238337 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 16:54:10 +00:00
Jan Vesely
72be0e4224 SelectionDAG: Don't do libcall on div/rem if divrem is custom
v2: TargetLoweringBase:: -> TargetLowering::
    Use Ops array
v3: Explicitly use value 0 for ?DIV
    Remove redundant newline

Differential revision: http://reviews.llvm.org/D7803
reviewer: ab

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238336 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 16:54:09 +00:00
Diego Novillo
df65fd3205 Fix PR 23499 - Avoid multiple profile counters for functions in comdat sections.
Counter symbols created for linkonce functions are not discarded by ELF
linkers unless the symbols are placed in the same comdat section as its
associated function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238335 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 16:44:47 +00:00
Zoran Jovanovic
dbab00a2d4 [mips][microMIPSr6] Implement SEB and SEH instructions
Differential Revision: http://reviews.llvm.org/D9739


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238333 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 15:39:47 +00:00
Rafael Espindola
3e6e3602d5 Fix NDEBUG build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238332 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 15:18:34 +00:00
Rafael Espindola
899cab6126 Delete MCSectionData.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238331 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 15:14:11 +00:00
Rafael Espindola
b167996819 Delete dead code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238330 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 14:55:09 +00:00
Rafael Espindola
7e5614efc2 Stop using MCSectionData in WinCOFFObjectWriter.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238329 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 14:45:54 +00:00
Rafael Espindola
1da0f919d5 clang-format WinCOFFObjectWriter.cpp. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238328 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 14:37:12 +00:00
Rafael Espindola
faf287243a Remove uses of MCSectionData from MachObjectWriter.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238327 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 14:33:39 +00:00
Jozef Kolek
b8124ac882 [mips][microMIPSr6] Implement BEQZALC, BGEZALC, BGTZALC, BLEZALC, BLTZALC and BNEZALC instructions
This patch implements microMIPS32r6 BEQZALC, BGEZALC, BGTZALC, BLEZALC, BLTZALC
and BNEZALC instructions using mapping.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238325 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 14:19:22 +00:00
Elena Demikhovsky
d56dcc4243 AVX-512: Fixed a bug in extracting subvector from v64i1
By Igor Breger (igor.breger@intel.com)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238322 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 14:09:33 +00:00
Rafael Espindola
919ce81d38 Move getSubsectionInsertionPoint to MCSection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238320 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 13:37:28 +00:00
Rafael Espindola
a287fe7fa0 Remove uses of MCSectionData from ELFObjectWriter. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238317 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 13:30:50 +00:00
Rafael Espindola
eac1f66427 Use operator<< instead of print in a few more places.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238315 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 13:05:42 +00:00
Rafael Espindola
baaf8b82c3 We always have an InstPrinter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238311 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 12:13:06 +00:00
Daniel Sanders
3a9cbffdcb Revert r238190 and r238197: [mips] Make TTypeEncoding indirect to allow .eh_frame to be read-only.
This broke the llvm-mips-linux builder and several of our out-of-tree builders.
Initial investigations show that the commit probably isn't the problem but
reverting anyway while I investigate.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238302 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 08:44:01 +00:00
Elena Demikhovsky
078088b790 AVX-512: Implemented all forms of sign-extend and zero-extend instructions for KNL and SKX
Implemented DAG lowering for all these forms.
Added tests for DAG lowering and encoding.

By Igor Breger (igor.breger@intel.com)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238301 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 08:15:19 +00:00
Quentin Colombet
60c91c28e4 [X86] Implement the support for shrink-wrapping.
With this patch the x86 backend is now shrink-wrapping capable
and this functionality can be tested by using the
-enable-shrink-wrap switch.

The next step is to make more test and enable shrink-wrapping by
default for x86.

Related to <rdar://problem/20821487>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238293 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 06:28:41 +00:00
Quentin Colombet
bdfc11784b [ShrinkWrap] Add a target hook to check whether or not
the target can handle a given basic block as prologue
or epilogue.

Related to <rdar://problem/20821487>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238292 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 06:25:48 +00:00
Matthias Braun
63e9bfa72b ARMLoadStoreOptimizer: Code cleanup; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238289 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 05:12:40 +00:00
Matthias Braun
f5b4273058 MachineBasicBlock: Cleanup computeRegisterLiveness()
- Clean documentation comment
- Change the API to accept an iterator so you can actually pass
  MachineBasicBlock::end() now.
- Add more "const".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238288 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 05:12:39 +00:00
Matthias Braun
299e50237a MCSymbol: Make print() robust against empty names
This shouldn't happen, but it's nice not to abort when printing broken machine
functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238287 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 05:12:37 +00:00
Chandler Carruth
34afa06cf2 [inliner] Fix the early-exit of the inline cost analysis to correctly
model the dense vector instruction bonuses.

Previously, this code really didn't effectively compute the density of
inlined vector instructions and apply the intended inliner bonus. It
would try to compute it repeatedly while analyzing the function and
didn't handle the case where future vector instructions would tip the
scales back towards the bonus.

Instead, speculatively apply all possible bonuses to the threshold
initially. Once we *know* that a certain bonus can not be applied,
subtract it. This should delay early bailout enough to get much more
consistent results without actually causing us to analyze huge swaths of
code. I expect some (hopefully mild) compile time hit here, and some
swings in performance, but this was definitely the intended behavior of
these bonuses.

This also dramatically simplifies the computation of the bonuses to not
interact with each other in confusing ways. The previous code didn't do
a good job of this and the values for bonuses may be surprising but are
at least now clearly written in the code.

Finally, fix code to be in line with comments and use zero as the
bailout condition.

Patch by Easwaran Raman, with some comment tweaks by me to try and
further clarify what is going on with this code.

http://reviews.llvm.org/D8267

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238276 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 02:49:05 +00:00
Filipe Cabecinhas
1c0b496636 [BitcodeReader] Change assert to report_fatal_error
It can be triggered by user input.

Bug found with AFL fuzz.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238272 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 01:05:40 +00:00
Filipe Cabecinhas
316f9e05ce [BitstreamReader] Make sure the Array operand type is an encoding
Bug found with AFL fuzz.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238269 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 00:48:43 +00:00
Filipe Cabecinhas
ba7ccd4201 clang-format a couple of lines
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238268 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 00:48:37 +00:00
Filipe Cabecinhas
c756772b8d [BitcodeReader] Make sure abbrev records have at least one operand (record code)
Bug found with AFL fuzz.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238265 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 23:52:21 +00:00
Owen Anderson
13146c7e3b Add initial support for the convergent attribute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238264 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 23:48:40 +00:00
Filipe Cabecinhas
1c74d4768a [BitcodeReader] Sanity check on Comdat ID
Shouldn't be an assert, since user input can trigger it.

Bug found with AFL fuzz.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238261 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 23:00:56 +00:00
Philip Reames
90b5eb2319 [PlaceSafepoints] Entry safepoint location doesn't need to be a terminator
Long ago, the poll insertion code assumed that the insertion site was a terminator.  As a result, the entry selection code would split a basic block to ensure it could pass a terminator.  The insertion code was updated quite a while ago - possibly before it ever landed upstream - but the now redundant work was never removed.  

While I'm at it, remove a comment which doesn't apply to the upstreamed code.  

NFC intended.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238254 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 21:16:42 +00:00
Philip Reames
d59f970668 [PlaceSafepoints] Cleanup InsertSafepointPoll function
While working on another change, I noticed that the naming in this function was mildly deceptive.  While fixing that, I took the oppurtunity to modernize some of the code.  NFC intended.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238252 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 21:03:23 +00:00
Kostya Serebryany
ea8a3963b4 [lib/Fuzzer] make the fuzzing timeout 1200 seconds by default (was: infinity)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238251 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 20:57:47 +00:00
Rafael Espindola
8a7b4ea2ad Simplify boolean conditional return statements.
Patch by Richard <legalize@xmission.com>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238250 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 20:37:36 +00:00
Akira Hatanaka
6f49135066 Remove NoFramePointerElim and NoFramePointerElimOverride from TargetOptions and
remove ExecutionEngine's dependence on CodeGen. NFC.

This is a follow-up to r238080.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238244 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 20:17:20 +00:00
Adrian Prantl
2cc3e0a5ec Use "auto &" in range-based for-loop and remove the extra braces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238243 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 20:06:51 +00:00
Adrian Prantl
74f44b6c69 Fix a use-after-free in a DEBUG output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238242 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 20:06:48 +00:00
Kostya Serebryany
e4af3b4160 [lib/Fuzzer] fix docs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238236 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 19:32:52 +00:00
Kostya Serebryany
f580f3683c [lib/Fuzzer] fix build with assertions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238235 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 19:29:33 +00:00
Rafael Espindola
890a876e0e Print "lock \t foo" instead of "lock \n foo".
This gets gas and llc -filetype=obj to agree on the order of prefixes.

For llvm-mc we need to fix the asm parser to know that it makes a difference
on which line the "lock" is in.

Part of pr23594.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238232 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 18:35:10 +00:00
Jan Vesely
176d1faf6a R600: Use SIGN_EXTEND_INREG for SEXT loads
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Matt Arsenault <Matthew.Arsenault@amd.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238229 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 18:07:22 +00:00
Jan Vesely
0704171907 R600: Add comments to subword private address load lowering code
v2: Use C++ comments and end with periods

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Matt Arsenault <Matthew.Arsenault@amd.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238228 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 18:07:21 +00:00
Diego Novillo
9c24c958f1 Revert "Re-commit changes in r237579 with fix for bug breaking windows builds."
This reverts commit r238201 to fix linking problems in x86 Linux
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20150525/278413.html

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238223 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 17:45:38 +00:00
Matt Arsenault
a0dd2b4df8 CodeGenPrepare: Don't match addressing modes through addrspacecast
This was resulting in the addrspacecast being removed and incorrectly
replaced with a ptrtoint when sinking.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238217 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 16:59:43 +00:00
Rui Ueyama
5a22e848da Object: Add Archive::getNumberOfSymbols().
Add a function that returns number of symbols in archive headers.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238213 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 16:20:40 +00:00
Tom Stellard
8352b74577 R600/SI: Add assembler support for all CI and VI VOP2 instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238211 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 15:55:52 +00:00
Rafael Espindola
b14ebd6a1d Replace getOrCreateSectionData with registerSection.
There is now no SectionData to be created.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238208 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 15:07:25 +00:00
Rafael Espindola
7ff8c5c348 Have getCurrentSectionData return a MCSection.
I will fix the name shortly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238204 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 14:48:11 +00:00
Rafael Espindola
da68b18db5 Pass a MCSection to getCurrentSectionData.
A step towards merging MCSection and MCSectionData.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238203 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 14:42:52 +00:00
Luke Cheeseman
262e24f7af Re-commit changes in r237579 with fix for bug breaking windows builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238201 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 13:40:31 +00:00
Luke Cheeseman
617dbfc31e Test Commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238199 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 13:10:35 +00:00
Elena Demikhovsky
001a2ba63f AVX-512: fixed a bug in arithmetic operations lowering for i1 type
https://llvm.org/bugs/show_bug.cgi?id=23630



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238198 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 12:37:17 +00:00
Elena Demikhovsky
55fd78065f AVX-512: fixed a bug in lowering VSELECT for 512-bit vector
https://llvm.org/bugs/show_bug.cgi?id=23634



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238195 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 11:32:39 +00:00
Michael Kuperstein
d714fcf5c8 Use std::bitset for SubtargetFeatures.
Previously, subtarget features were a bitfield with the underlying type being uint64_t. 
Since several targets (X86 and ARM, in particular) have hit or were very close to hitting this bound, switching the features to use a bitset.
No functional change.

The first several times this was committed (e.g. r229831, r233055), it caused several buildbot failures.
Apparently the reason for most failures was both clang and gcc's inability to deal with large numbers (> 10K) of bitset constructor calls in tablegen-generated initializers of instruction info tables. 
This should now be fixed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238192 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 10:47:10 +00:00
Daniel Sanders
bda72d8098 [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.

This commit uses DW_EH_PE_sdata8 for N64 as far as is possible at the moment.
However, it is possible to end up with DW_EH_PE_sdata4 when a TargetMachine is
not available. There's no risk of issues with inconsistency here since the
tables are self describing but it does mean there is a small chance of the
PC-relative offset being out of range for particularly large programs.

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@238190 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 10:19:18 +00:00
Craig Topper
7b0f8fc600 [TableGen] Fix line wrapping logic for the autogenerated header to use math that makes more sense (at least to me).
The old code had a bug if the description was between 75 and 85 characters or so as it substracted PSLen from Desc.size() instead of MAX_LINE_LEN in the compare. It also calculated odd values for PosE on the last split and just let StringRef::slice take care of it being larger than the description string.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238187 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 08:07:56 +00:00
Craig Topper
c9739ec212 [TableGen] Rewrite an assert to not do a bunch unsigned math and then try to ensure the result is a positive number.
I think the fact that it was explicitly excluding 0 kept this from being a tautology. The exclusion of 0 for the old math was also a bug that's easily hit if the description gets split into multiple lines.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238186 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 08:07:49 +00:00
Craig Topper
88008cb710 [TableGen] Put a space between '*' and description in the autogenerated tablegen header. Minor cleanup in surrounding code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238185 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 08:07:45 +00:00
Craig Topper
d0185f83c6 [TableGen] Fix indentation. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238181 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 06:48:47 +00:00
Craig Topper
cfacb30e5d [TableGen] Include header for each cpp file first. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238180 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 06:48:46 +00:00
Craig Topper
a274efbc67 [TableGen] Remove unneeded namespace around a function. Just put llvm:: on the definition since it's already declared in a header file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238178 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 06:48:41 +00:00
Craig Topper
ef92f29b75 [TableGen] Use 'static' instead of an anonymous namespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238177 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 06:48:38 +00:00