Commit Graph

148377 Commits

Author SHA1 Message Date
Sanjoy Das
afd31bcedd Remove unnecessary semicolon
This shows up as a -Wpendatic error on GCC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301616 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 04:49:32 +00:00
Sanjoy Das
edb3c90b17 [StackMaps] Increase the size of the "location size" field
Summary:
In some cases LLVM (especially the SLP vectorizer) will create vectors
that are 256 bytes (or larger).  Given that this is intentional[0] is
likely to get more common, this patch updates the StackMap binary
format to deal with the spill locations for said vectors.

This change also bumps the stack map version from 2 to 3.

[0]: https://reviews.llvm.org/D32533#738350

Reviewers: reames, kavon, skatkov, javed.absar

Subscribers: mcrosier, nemanjai, llvm-commits

Differential Revision: https://reviews.llvm.org/D32629

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301615 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 04:48:42 +00:00
Saleem Abdulrasool
df4f50c81f COFF Import: expose both symbols
COFF Import libraries which use the obsolete CONSTANT export are
supposed to get two symbols, one with the `_imp_` prefix and one
without.  Ensure that we expose both for iteration.  This is necessary
to fix the librarian with COFF CONSTANT exports.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301614 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 04:29:43 +00:00
Craig Topper
a7fa95c0e5 [APInt] Use inplace shift methods where possible. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301612 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 03:36:24 +00:00
Zachary Turner
a102628313 [llvm-pdbdump] Allow printing only a portion of a stream.
When dumping raw data from a stream, you might know the offset
of a certain record you're interested in, as well as how long
that record is.  Previously, you had to dump the entire stream
and wade through the bytes to find the interesting record.

This patch allows you to specify an offset and length on the
command line, and it will only dump the requested range.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301607 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 00:43:38 +00:00
Sam Clegg
4275ee9fcb [WebAssembly] Add some tests for wasm MC layer
Subscribers: jfb, dschuff

Differential Revision: https://reviews.llvm.org/D32558

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301606 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 00:36:36 +00:00
Davide Italiano
6b435e94b7 [SROA] Fix nondeterminism exposed by Simon's r299221.
Use a SmallSetSetVector instead of a SmallPtrSet as iterating
over the latter is not stable ('<' relies on addresses).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301599 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 23:09:01 +00:00
Frederich Munch
b6e6c85f4f Fix a few pedantic warnings.
Reviewers: zturner, hansw, hans

Reviewed By: hans

Subscribers: hans, llvm-commits

Differential Revision: https://reviews.llvm.org/D32611

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301595 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 22:10:57 +00:00
Sanjay Patel
402d01739e [InstCombine] fix matcher to bind to specific operand (PR32830)
Matching any random value would be very wrong:
https://bugs.llvm.org/show_bug.cgi?id=32830


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301594 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 21:55:03 +00:00
Sanjoy Das
af3c2de37e Specify something that's true in practice
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301591 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 20:55:07 +00:00
Evgeniy Stepanov
226bbc3937 [asan] Fix dead stripping of globals on Linux.
Use a combination of !associated, comdat, @llvm.compiler.used and
custom sections to allow dead stripping of globals and their asan
metadata. Sometimes.

Currently this works on LLD, which supports SHF_LINK_ORDER with
sh_link pointing to the associated section.

This also works on BFD, which seems to treat comdats as
all-or-nothing with respect to linker GC. There is a weird quirk
where the "first" global in each link is never GC-ed because of the
section symbols.

At this moment it does not work on Gold (as in the globals are never
stripped).

This is a second re-land of r298158. This time, this feature is
limited to -fdata-sections builds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301587 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 20:27:27 +00:00
Evgeniy Stepanov
cd2999ea45 [asan] Put ctor/dtor in comdat.
When possible, put ASan ctor/dtor in comdat.

The only reason not to is global registration, which can be
TU-specific. This is not the case when there are no instrumented
globals. This is also limited to ELF targets, because MachO does
not have comdat, and COFF linkers may GC comdat constructors.

The benefit of this is a lot less __asan_init() calls: one per DSO
instead of one per TU. It's also necessary for the upcoming
gc-sections-for-globals change on Linux, where multiple references to
section start symbols trigger quadratic behaviour in gold linker.

This is a second re-land of r298756. This time with a flag to disable
the whole thing to avoid a bug in the gold linker:
  https://sourceware.org/bugzilla/show_bug.cgi?id=19002

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301586 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 20:27:23 +00:00
Simon Pilgrim
b0c82b846c [X86][SSE] Add tests for broadcast from larger vector loads
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301583 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 20:19:00 +00:00
Zachary Turner
224acd2453 [llvm-readobj] Dump COFF Resources section.
This patch dumps the raw bytes of the .rsrc sections that
are present in COFF object and executable files.  Subsequent
patches will parse this information and dump in a more human
readable format.

Differential Revision: https://reviews.llvm.org/D32463
Patch By: Eric Beckmann

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301578 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 19:38:38 +00:00
Chandler Carruth
1d4cf6e01f [PM/LoopUnswitch] Introduce a new, simpler loop unswitch pass.
Currently, this pass only focuses on *trivial* loop unswitching. At that
reduced problem it remains significantly better than the current loop
unswitch:
- Old pass is worse than cubic complexity. New pass is (I think) linear.
- New pass is much simpler in its design by focusing on full unswitching. (See
  below for details on this).
- New pass doesn't carry state for thresholds between pass iterations.
- New pass doesn't carry state for correctness (both miscompile and
  infloop) between pass iterations.
- New pass produces substantially better code after unswitching.
- New pass can handle more trivial unswitch cases.
- New pass doesn't recompute the dominator tree for the entire function
  and instead incrementally updates it.

I've ported all of the trivial unswitching test cases from the old pass
to the new one to make sure that major functionality isn't lost in the
process. For several of the test cases I've worked to improve the
precision and rigor of the CHECKs, but for many I've just updated them
to handle the new IR produced.

My initial motivation was the fact that the old pass carried state in
very unreliable ways between pass iterations, and these mechansims were
incompatible with the new pass manager. However, I discovered many more
improvements to make along the way.

This pass makes two very significant assumptions that enable most of these
improvements:

1) Focus on *full* unswitching -- that is, completely removing whatever
   control flow construct is being unswitched from the loop. In the case
   of trivial unswitching, this means removing the trivial (exiting)
   edge. In non-trivial unswitching, this means removing the branch or
   switch itself. This is in opposition to *partial* unswitching where
   some part of the unswitched control flow remains in the loop. Partial
   unswitching only really applies to switches and to folded branches.
   These are very similar to full unrolling and partial unrolling. The
   full form is an effective canonicalization, the partial form needs
   a complex cost model, cannot be iterated, isn't canonicalizing, and
   should be a separate pass that runs very late (much like unrolling).

2) Leverage LLVM's Loop machinery to the fullest. The original unswitch
   dates from a time when a great deal of LLVM's loop infrastructure was
   missing, ineffective, and/or unreliable. As a consequence, a lot of
   complexity was added which we no longer need.

With these two overarching principles, I think we can build a fast and
effective unswitcher that fits in well in the new PM and in the
canonicalization pipeline. Some of the remaining functionality around
partial unswitching may not be relevant today (not many test cases or
benchmarks I can find) but if they are I'd like to add support for them
as a separate layer that runs very late in the pipeline.

Purely to make reviewing and introducing this code more manageable, I've
split this into first a trivial-unswitch-only pass and in the next patch
I'll add support for full non-trivial unswitching against a *fixed*
threshold, exactly like full unrolling. I even plan to re-use the
unrolling thresholds, as these are incredibly similar cost tradeoffs:
we're cloning a loop body in order to end up with simplified control
flow. We should only do that when the total growth is reasonably small.

One of the biggest changes with this pass compared to the previous one
is that previously, each individual trivial exiting edge from a switch
was unswitched separately as a branch. Now, we unswitch the entire
switch at once, with cases going to the various destinations. This lets
us unswitch multiple exiting edges in a single operation and also avoids
numerous extremely bad behaviors, where we would introduce 1000s of
branches to test for thousands of possible values, all of which would
take the exact same exit path bypassing the loop. Now we will use
a switch with 1000s of cases that can be efficiently lowered into
a jumptable. This avoids relying on somehow forming a switch out of the
branches or getting horrible code if that fails for any reason.

Another significant change is that this pass actively updates the CFG
based on unswitching. For trivial unswitching, this is actually very
easy because of the definition of loop simplified form. Doing this makes
the code coming out of loop unswitch dramatically more friendly. We
still should run loop-simplifycfg (at the least) after this to clean up,
but it will have to do a lot less work.

Finally, this pass makes much fewer attempts to simplify instructions
based on the unswitch. Something like loop-instsimplify, instcombine, or
GVN can be used to do increasingly powerful simplifications based on the
now dominating predicate. The old simplifications are things that
something like loop-instsimplify should get today or a very, very basic
loop-instcombine could get. Keeping that logic separate is a big
simplifying technique.

Most of the code in this pass that isn't in the old one has to do with
achieving specific goals:
- Updating the dominator tree as we go
- Unswitching all cases in a switch in a single step.

I think it is still shorter than just the trivial unswitching code in
the old pass despite having this functionality.

Differential Revision: https://reviews.llvm.org/D32409

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301576 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 18:45:20 +00:00
Eli Friedman
9dc569fec5 [GlobalOpt] Correctly update metadata when localizing a global.
Just calling dropAllReferences leaves pointers to the ConstantExpr
behind, so we would eventually crash with a null pointer dereference.

Differential Revision: https://reviews.llvm.org/D32551



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301575 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 18:39:08 +00:00
Teresa Johnson
913d272566 Memory intrinsic value profile optimization: Improve debug output (NFC)
Summary:
Misc improvements to debug output. Fix a couple typos and also dump the
value profile before we make any profitability checks.

Reviewers: davidxl

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D32607

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301574 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 18:25:22 +00:00
Frederich Munch
bb41cb2e32 Limit disabling of warnings emitted from r301571 by checking __GNUC__.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301572 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 18:05:29 +00:00
Frederich Munch
b6ceaa4758 Fix warnings from test added in r301562 on Windows (when built without exceptions).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301571 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 17:33:50 +00:00
Vassil Vassilev
94e7e888f8 Sync with changes from r300825 in clang.
Generate the better include paths. Instead of #include <llvm_header.h> doxygen
produces #include "llvm/Folder/llvm_header.h"

Patch by Yuka Takahashi (D32342)!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301569 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 17:23:53 +00:00
Sanjoy Das
b3ab6b2622 Use a pointer type for target frame indices during statepoint lowering
Summary:
The type of the target frame index is intptr, not the type of the value we're
going to store into it.  Without this change we crash in the attached test case
when trying to type-legalize a TargetFrameIndex.

Patchpoint lowering types the target frame index as intptr as well.

Reviewers: reames, bogner, arsenm

Subscribers: arsenm, mcrosier, llvm-commits

Differential Revision: https://reviews.llvm.org/D32256

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301566 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 17:17:16 +00:00
Peter Collingbourne
5cb8f64327 cmake: Touch $GIT_DIR/logs/HEAD if it does not already exist.
Apparently some git tools (such as "repo") may not create this file.
Patch by Quentin Neill.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301565 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 17:04:05 +00:00
Frederich Munch
dbf2bf739f Refactor DynamicLibrary so searching for a symbol will have a defined order and
libraries are properly unloaded when llvm_shutdown is called.

Summary:
This was mostly affecting usage of the JIT, where storing the library handles in
a set made iteration unordered/undefined. This lead to disagreement between the
JIT and native code as to what the address and implementation of particularly on
Windows with stdlib functions:

JIT: putenv_s("TEST", "VALUE") // called msvcrt.dll, putenv_s
JIT: getenv("TEST") -> "VALUE" // called msvcrt.dll, getenv
Native: getenv("TEST") -> NULL // called ucrt.dll, getenv

Also fixed is the issue of DynamicLibrary::getPermanentLibrary(0,0) on Windows
not giving priority to the process' symbols as it did on Unix.

Reviewers: chapuni, v.g.vassilev, lhames

Reviewed By: lhames

Subscribers: danalbert, srhines, mgorny, vsk, llvm-commits

Differential Revision: https://reviews.llvm.org/D30107

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301562 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 16:55:24 +00:00
Xinliang David Li
5a24953af4 [PartialInlining]: Improve partial inlining to handle complex conditions
Differential Revision: http://reviews.llvm.org/D32249


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301561 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 16:34:00 +00:00
Zachary Turner
2834a6874e [CodeView] Isolate Debug Info Fragments into standalone classes.
Previously parsing of these were all grouped together into a
single master class that could parse any type of debug info
fragment.

With writing forthcoming, the complexity of each individual
fragment is enough to warrant them having their own classes so
that reading and writing of each fragment type can be grouped
together, but isolated from the code for reading and writing
other fragment types.

In doing so, I found a place where parsing code was duplicated
for the FileChecksums fragment, across llvm-readobj and the
CodeView library, and one of the implementations had a bug.
Now that the codepaths are merged, the bug is resolved.

Differential Revision: https://reviews.llvm.org/D32547

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301557 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 16:12:16 +00:00
Zachary Turner
67e6eced9e [Support] Make BinaryStreamArray extractors stateless.
Instead, we now pass a context memeber through the extraction
process.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301556 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 16:11:47 +00:00
Zachary Turner
3220dd07ab Rename some PDB classes.
We have a lot of very similarly named classes related to
dealing with module debug info.  This patch has NFC, it just
renames some classes to be more descriptive (albeit slightly
more to type).  The mapping from old to new class names is as
follows:

   Old          |        New
ModInfo         | DbiModuleDescriptor
ModuleSubstream | ModuleDebugFragment
ModStream       | ModuleDebugStream

With the corresponding Builder classes renamed accordingly.

Differential Revision: https://reviews.llvm.org/D32506

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301555 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 16:11:19 +00:00
Sanjay Patel
0aa7571b65 [x86] add minimal tests for potential size-changing vsel transforms; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301554 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 16:10:20 +00:00
Sam Kolton
74a47fb13d [AMDGPU] DPP: add support for GFX9
Reviewers: artem.tamazov

Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye

Differential Revision: https://reviews.llvm.org/D32588

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301551 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 15:42:38 +00:00
Krzysztof Parzyszek
83513e069b Fix typo and place comment close to its target
Patch by Wei-Ren Chen.

Differential Revision: https://reviews.llvm.org/D32594


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301546 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 14:38:21 +00:00
Aaron Ballman
d3d0cd648c Fixing a malformed RST table to get the documentation bot back to green.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301545 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 14:33:01 +00:00
Simon Pilgrim
452c525cff Fixed assert message to correctly refer to MRMSrcReg4VOp3Frm/MRMSrcMeg4VOp3Frm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301544 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 14:25:04 +00:00
Zoran Jovanovic
d2333e0a15 [mips][microMIPS] Adding code size reduction pass for MicroMIPS
Author: milena.vujosevic.janicic
Reviewers: sdardis
The code implements size reduction pass for MicroMIPS.
Load and store instructions are examined and transformed, if possible.
lw32 instruction is transformed into 16-bit instruction lwsp
sw32 instruction is transformed into 16-bit instruction swsp
Arithmetic instrcutions are examined and transformed, if possible.
addu32 instruction is transformed into 16-bit instruction addu16
subu32 instruction is transformed into 16-bit instruction subu16
Differential Revision: https://reviews.llvm.org/D15144


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301540 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 13:10:48 +00:00
Jonas Paulsson
5f77135fa2 [SystemZ] Remove incorrect assert in SystemZTTIImpl
In getCmpSelInstrCost(), CondTy may actually be scalar while ValTy is a
vector when LoopVectorizer is the caller. Therefore the assert that CondTy
must be a vector type if ValTy is was wrong and is now removed.

Review: Ulrich Weigand

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301533 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 11:01:18 +00:00
Diana Picus
6790813007 [ARM] GlobalISel: Fix extended stack operands
Fix a crash when trying to extend a value passed as a sign- or
zero-extended stack parameter. The cause of the crash was that we were
setting the size of the loaded value to 32 bits, and then tyring to
extend again to 32 bits.

This patch addresses the issue by also introducing a G_TRUNC after the
load. This will leave the unused bits to their original values set by
the caller, while being consistent about the types. For values that are
not extended, we just use a smaller load.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301531 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 10:23:30 +00:00
Andrew V. Tischenko
9ec7e0297d 2 tests that were lost in rL301390
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301529 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 10:20:35 +00:00
George Rimar
0fcdd9ba05 [llvm-dwarfdump] - Change format for .gdb_index dump.
It is useful to output size of ranges when address ranges
section of .gdb_index is dumped.

It helps to compare outputs produced by different linkers,
for example. In that case address ranges can look very different,
when they are the same at fact. Difference comes from different 
low address because of different address of .text.

Differential revision: https://reviews.llvm.org/D32492

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301527 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 10:00:13 +00:00
Igor Breger
39e6fd3cd6 [GlobalISel][X86] handle not symmetric G_COPY
Summary: handle not symmetric G_COPY

Reviewers: zvi, guyblank

Reviewed By: guyblank

Subscribers: rovka, llvm-commits, kristof.beyls

Differential Revision: https://reviews.llvm.org/D32420

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301523 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 08:02:03 +00:00
Clement Courbet
54b949daeb [CodeGen][NFC] Rename 'Src' to 'Val'.
'Src' looks like it was borrowed from memcpy, 'Val' makes more sense for
memset and is consistent with naming within the function.

Differential Revision: https://reviews.llvm.org/D32580

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301521 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 07:22:30 +00:00
Sanjoy Das
9f5bf2cd28 Use accessors for ValueHandleBase::V; NFC
This changes code that touches ValueHandleBase::V to go through
getValPtr and (newly added) setValPtr.  This functionality will be
used later, but also seemed like a generally good cleanup.

I also renamed the field to Val, but that's just to make it obvious
that I fixed all the uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301518 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 06:02:18 +00:00
Craig Topper
e5cb2e5840 [Metadata] Fix typos in comments. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301517 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 05:48:29 +00:00
Craig Topper
8025bd61c5 [InstCombine] Use APInt bit counting methods to avoid a temporary APInt. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301516 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 04:51:25 +00:00
Rui Ueyama
53d587ee03 Make StringSaver::save less ambiguous.
Previously, an expression such as Saver.save(std::string("foo") + "bar")
didn't compile because there is an ambiguity as to whether the argument
is of const Twine& or StringRef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301512 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 03:45:33 +00:00
Konstantin Zhuravlyov
51ff1d79cd AMDGPU: Fix assert in scheduler
Assert is triggered if DBG_VALUE is first instruction in BB

Differential Revision: https://reviews.llvm.org/D32572


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301511 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 03:22:44 +00:00
Ahmed Bougacha
aca7b7d243 [Support] Fix overflow in SLEB128 decoding.
decodeULEB128 was fixed in r216268, but decodeSLEB128 always had the
same issue, which is now exposed in r301369.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301510 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 02:09:44 +00:00
Ahmed Bougacha
89fc611b77 [Support] clang-format LEB128.h. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301509 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 02:09:42 +00:00
Chandler Carruth
bde56a9699 Disable GVN Hoist due to still more bugs being found in it. There is
also a discussion about exactly what we should do prior to re-enabling
it.

The current bug is http://llvm.org/PR32821 and the discussion about this
is in the review thread for r300200.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301505 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 00:28:03 +00:00
Adrian Prantl
9d291ed9ad Turn DISubprogram into a variable-length node.
DISubprogram currently has 10 pointer operands, several of which are
often nullptr. This patch reduces the amount of memory allocated by
DISubprogram by rearranging the operands such that containing type,
template params, and thrown types come last, and are only allocated
when they are non-null (or followed by non-null operands).

This patch also eliminates the entirely unused DisplayName operand.

This saves up to 4 pointer operands per DISubprogram. (I tried
measuring the effect on peak memory usage on an LTO link of an X86
llc, but the results were very noisy).

This reapplies r301498 with an attempted workaround for g++.

Differential Revision: https://reviews.llvm.org/D32560

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301501 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 23:59:52 +00:00
Adrian Prantl
589155c2d7 Revert "Turn DISubprogram into a variable-length node."
This reverts commit r301498 while investigating bot breakage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301499 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 23:49:30 +00:00
Adrian Prantl
6c938e5225 Turn DISubprogram into a variable-length node.
DISubprogram currently has 10 pointer operands, several of which are
often nullptr. This patch reduces the amount of memory allocated by
DISubprogram by rearranging the operands such that containing type,
template params, and thrown types come last, and are only allocated
when they are non-null (or followed by non-null operands).

This patch also eliminates the entirely unused DisplayName operand.

This saves up to 4 pointer operands per DISubprogram. (I tried
measuring the effect on peak memory usage on an LTO link of an X86
llc, but the results were very noisy).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301498 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 23:44:54 +00:00