Commit Graph

31750 Commits

Author SHA1 Message Date
Daniel Neilson
8909d38320 Const correctness for TTI::getRegisterBitWidth
Summary: The method TargetTransformInfo::getRegisterBitWidth() is declared const, but the type erasing implementation classes (TargetTransformInfo::Concept & TargetTransformInfo::Model) that were introduced by Chandler in https://reviews.llvm.org/D7293 do not have the method declared const. This is an NFC to tidy up the const consistency between TTI and its implementation.

Reviewers: chandlerc, rnk, reames

Reviewed By: reames

Subscribers: reames, jfb, arsenm, dschuff, nemanjai, nhaehnle, javed.absar, sbc100, jgravelle-google, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305189 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 14:22:21 +00:00
Kamil Rytarowski
c034fe3bb5 Initialize SubArch in class Triple
Summary:
LLDB built with asan on NetBSD detected issues in the following code:

```
void ArchSpec::Clear() {
  m_triple = llvm::Triple();
  m_core = kCore_invalid;
  m_byte_order = eByteOrderInvalid;
  m_distribution_id.Clear();
  m_flags = 0;
}
```

  --- lldb/source/Core/ArchSpec.cpp

Runtime error messages:

/public/pkgsrc-tmp/wip/lldb-netbsd/work/.buildlink/include/llvm/ADT/Triple.h:44:7: runtime error: load of value 32639, which is not a valid value for type 'SubArchType'
/public/pkgsrc-tmp/wip/lldb-netbsd/work/.buildlink/include/llvm/ADT/Triple.h:44:7: runtime error: load of value 3200171710, which is not a valid value for type 'SubArchType'
/public/pkgsrc-tmp/wip/lldb-netbsd/work/.buildlink/include/llvm/ADT/Triple.h:44:7: runtime error: load of value 3200171710, which is not a valid value for type 'SubArchType'

Correct this issue with initialization of SubArch() in the class Triple constructor.

Sponsored by <The NetBSD Foundation>

Reviewers: chandlerc, zturner

Reviewed By: zturner

Subscribers: llvm-commits, zturner

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305178 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 00:28:14 +00:00
Xinliang David Li
165d46dd6e [PartialInlining] Support shrinkwrap life_range markers
Differential Revision: http://reviews.llvm.org/D33847




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305170 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-11 20:46:05 +00:00
Craig Topper
309f3a963a [IR] Remove stale comment from HungoffOperandTraits. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305141 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-10 06:58:26 +00:00
Craig Topper
b73a9334a3 [IR] Delete operator new(size_t, unsigned) for ShuffleVector making it consistent with other instructions that declare another operator new with a different signature. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305140 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-10 06:58:24 +00:00
Craig Topper
fb0cb71701 [IR] Put a comment back on a function it belongs to. NFC
Looks like the function was moved to a different part of the class in December, but the comment didn't move with it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305139 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-10 06:58:22 +00:00
Craig Topper
95270b9920 [IR] Remove unnecessary override of operator new in ExtractValueInst. It's already inherited from UnaryInstruction. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305138 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-10 06:58:19 +00:00
Andrew Kaylor
b8e9164d09 [InstSimplify] Don't constant fold or DCE calls that are marked nobuiltin
Differential Revision: https://reviews.llvm.org/D33737

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305132 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-09 23:18:11 +00:00
Eugene Zelenko
af1531a5be [Support] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305119 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-09 21:41:54 +00:00
Zachary Turner
bb67f7f534 [pdb] Support CoffSymbolRVA debug subsection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305108 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-09 20:46:52 +00:00
Francis Ricci
1805055420 [ADT] Make iterable SmallVector template overrides more specific
Summary:
This prevents the iterator overrides from being selected in
the case where non-iterator types are used as arguments, which
is of particular importance in cases where other overrides with
identical types exist.

Reviewers: dblaikie, bkramer, rafael

Subscribers: llvm-commits, efriedma

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305105 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-09 20:31:53 +00:00
Stanislav Mekhanoshin
525f44047e [AMDGPU] Add intrinsics for alignbit and alignbyte instructions
Differential Revision: https://reviews.llvm.org/D34046

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305098 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-09 19:03:00 +00:00
Zachary Turner
248cabd1f5 Fix -Wreorder-fields warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305095 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-09 18:04:02 +00:00
Zachary Turner
4b665d2445 Allow VarStreamArray to use stateful extractors.
Previously extractors tried to be stateless with any additional
context information needed in order to parse items being passed
in via the extraction method.  This led to quite cumbersome
implementation challenges and awkwardness of use.  This patch
brings back support for stateful extractors, making the
implementation and usage simpler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305093 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-09 17:54:36 +00:00
Eric Beckmann
3028aaffc2 Implement COFF emission for parsed Windows Resource ( .res) files.
Summary: Add the WindowsResourceCOFFWriter class for producing the final COFF after all parsing is done.

Reviewers: hiraditya!, zturner, ruiu

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305092 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-09 17:34:30 +00:00
Simon Dardis
00daab518d Reland "[SelectionDAG] Enable target specific vector scalarization of calls and returns"
By target hookifying getRegisterType, getNumRegisters, getVectorBreakdown,
backends can request that LLVM to scalarize vector types for calls
and returns.

The MIPS vector ABI requires that vector arguments and returns are passed in
integer registers. With SelectionDAG's new hooks, the MIPS backend can now
handle LLVM-IR with vector types in calls and returns. E.g.
'call @foo(<4 x i32> %4)'.

Previously these cases would be scalarized for the MIPS O32/N32/N64 ABI for
calls and returns if vector types were not legal. If vector types were legal,
a single 128bit vector argument would be assigned to a single 32 bit / 64 bit
integer register.

By teaching the MIPS backend to inspect the original types, it can now
implement the MIPS vector ABI which requires a particular method of
scalarizing vectors.

Previously, the MIPS backend relied on clang to scalarize types such as "call
@foo(<4 x float> %a) into "call @foo(i32 inreg %1, i32 inreg %2, i32 inreg %3,
i32 inreg %4)".

This patch enables the MIPS backend to take either form for vector types.

The previous version of this patch had a "conditional move or jump depends on
uninitialized value".

Reviewers: zoran.jovanovic, jaydeep, vkalintiris, slthakur

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305083 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-09 14:37:08 +00:00
George Burgess IV
9276050d30 [LoopVectorize] Don't preserve nsw/nuw flags on shrunken ops.
If we're shrinking a binary operation, it may be the case that the new
operations wraps where the old didn't. If this happens, the behavior
should be well-defined. So, we can't always carry wrapping flags with us
when we shrink operations.

If we do, we get incorrect optimizations in cases like:

void foo(const unsigned char *from, unsigned char *to, int n) {
  for (int i = 0; i < n; i++)
    to[i] = from[i] - 128;
}

which gets optimized to:

void foo(const unsigned char *from, unsigned char *to, int n) {
  for (int i = 0; i < n; i++)
    to[i] = from[i] | 128;
}

Because:
- InstCombine turned `sub i32 %from.i, 128` into
  `add nuw nsw i32 %from.i, 128`.
- LoopVectorize vectorized the add to be `add nuw nsw <16 x i8>` with a
  vector full of `i8 128`s
- InstCombine took advantage of the fact that the newly-shrunken add
  "couldn't wrap", and changed the `add` to an `or`.

InstCombine seems happy to figure out whether we can add nuw/nsw on its
own, so I just decided to drop the flags. There are already a number of
places in LoopVectorize where we rely on InstCombine to clean up.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305053 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-09 03:56:15 +00:00
Bob Haarman
67d04e8fdf [codeview] use 32-bit integer for RelocOffset in DebugLinesSubsection
Summary:
RelocOffset is a 32-bit value, but we previously truncated it to 16 bits.

Fixes PR33335.

Reviewers: zturner, hiraditya!

Reviewed By: zturner

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305043 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-09 01:18:10 +00:00
Zachary Turner
680d997aa7 [pdb] Don't crash on unknown debug subsections.
More and more unknown debug subsection kinds are being discovered
so we should make it possible to dump these and display the
bytes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305041 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-09 00:53:59 +00:00
Saleem Abdulrasool
e6be41f2a8 sink DebugCompressionType into MC for exposing to clang
This is a preparatory change to expose the debug compression style to
clang.  It requires exposing the enumeration and passing the actual
value through to the backend from the frontend in actual value form
rather than a boolean that selects the GNU style of debug info
compression.

Minor tweak to the ELF Object Writer to use a variable for re-used
values.  Add an assertion that debug information format is one of the
two currently known types if debug information is being compressed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305038 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-09 00:40:19 +00:00
Zachary Turner
68ca30aa36 [CodeView] Support remaining debug subsection types
This adds support for Symbols, StringTable, and FrameData subsection
types.  Even though these subsections rarely if ever appear in a PDB
file (they are usually in object files), there's no theoretical reason
why they *couldn't* appear in a PDB.  The real issue though is that in
order to add support for dumping and writing them (which will be useful
for object files), we need a way to test them.  And since there is no
support for reading and writing them to / from object files yet, making
PDB support them is the best way to both add support for the underlying
format and add support for tests at the same time.  Later, when we go
to add support for reading / writing them from object files, we'll need
only minimal changes in the underlying read/write code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305037 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-09 00:28:08 +00:00
Zachary Turner
9cc66ac05d Fix build by adding includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305036 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-08 23:53:35 +00:00
Zachary Turner
8f318ceb6f [llvm-pdbdump] Support native ordering of subsections in raw mode.
This is the same change for the YAML Output style applied to the
raw output style.  Previously we would queue up all subsections
until every one had been read, and then output them in a pre-
determined order.  This was because some subsections need to be
read first in order to properly dump later subsections.  This
patch allows them to be dumped in the order they appear.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305034 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-08 23:49:01 +00:00
Craig Topper
eca66d0b34 [IR] Remove getNumSuccessorsV/getSuccessorV/setSuccessorV from the TerminatorInst subclasses as much as possible now that Value has been de-virtualized
These used to be virtual methods that would enable doing the right thing with only a TerminatorInst pointer. I believe they were also acting as vtable anchors in my cases. I think the fact that they had a separate name ending in V was to allow a version without V to be called without a virtual call in a pre-C++11 final keyword world.

Where possible the base methods in TerminatorInst dispatch directly to the public methods in the classes that have the same signature. For some classes this wasn't possible so I've left private method versions that match the name and signature of the version in TerminatorInst. All versions have been moved into the class definitions since we no longer need vtable anchors here.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305028 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-08 23:23:08 +00:00
Peter Collingbourne
e74c64e05a Write summaries for merged modules when splitting modules for ThinLTO.
This is to prepare to allow for dead stripping of globals in the
merged modules.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305027 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-08 23:01:49 +00:00
Kostya Serebryany
be95f5eddf [sanitizer-coverage] one more flavor of coverage: -fsanitize-coverage=inline-8bit-counters. Experimental so far, not documenting yet. Reapplying revisions 304630, 304631, 304632, 304673, see PR33308
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305026 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-08 22:58:19 +00:00
Peter Collingbourne
b9fc96d9dd Bitcode: Introduce a BitcodeFileContents data type. NFCI.
This data type includes the contents of a bitcode file.
Right now a bitcode file can only contain modules, but
a later change will add a symbol table.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305019 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-08 22:00:24 +00:00
Matthias Braun
9b4cf76a1e RegAllocPBQP: Do not assign reserved physical register
(0) RegAllocPBQP: Since getRawAllocationOrder() may return a collection that includes reserved physical registers, iterate to find an un-reserved physical register.

(1) VirtRegMap: Enforce the invariant: "no reserved physical registers" in assignVirt2Phys(). Previously, this was checked only after the fact in VirtRegRewriter::rewrite.

(2) MachineVerifier: updated the test per MatzeB's review.

(3) +testcase

Patch by Nick Johnson<Nicholas.Paul.Johnson@deshawresearch.com>!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305016 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-08 21:30:54 +00:00
Sanjay Patel
464c05b269 fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305008 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-08 20:00:09 +00:00
Sanjay Patel
4c04c2d072 [CGP] don't expand a memcmp with nobuiltin attribute
This matches the behavior used in the SDAG when expanding memcmp.

For reference, we're intentionally treating the earlier fortified call transforms differently after:
https://bugs.llvm.org/show_bug.cgi?id=23093
https://reviews.llvm.org/rL233776

One motivation for not transforming nobuiltin calls is that it can interfere with sanitizers:
https://reviews.llvm.org/D19781
https://reviews.llvm.org/D19801

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305007 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-08 19:47:25 +00:00
Alexey Bataev
ad529c0e6a [SLP] More comments fix, NFC.
Fixed spelling errors on function description.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304985 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-08 16:41:35 +00:00
Zachary Turner
a0418c7843 [PDB] Don't crash on /debug:fastlink PDBs.
Apparently support for /debug:fastlink PDBs isn't part of the
DIA SDK (!), and it was causing llvm-pdbdump to crash because
we weren't checking for a null pointer return value.  This
manifests when calling findChildren on the IDiaSymbol, and
it returns E_NOTIMPL.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304982 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-08 16:00:40 +00:00
John Brawn
436ad280cc [BPI] Don't assume that strcmp returning >0 is more likely than <0
The zero heuristic assumes that integers are more likely positive than negative,
but this also has the effect of assuming that strcmp return values are more
likely positive than negative. Given that for nonzero strcmp return values it's
the ordering of arguments that determines the sign of the result there's no
reason to assume that's true.

Fix this by inspecting the LHS of the compare and using TargetLibraryInfo to
decide if it's strcmp-like, and if so only assume that nonzero is more likely
than zero i.e. strings are more often different than the same. This causes a
slight code generation change in the spec2006 benchmark 403.gcc, but with no
noticeable performance impact. The intent of this patch is to allow better
optimisation of dhrystone on Cortex-M cpus, but currently it won't as there are
also some changes that need to be made to if-conversion.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304970 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-08 09:44:40 +00:00
Peter Collingbourne
f040d163f5 Object: Factor out the code for creating the irsymtab for an arbitrary bitcode file.
This code now lives in lib/Object. The idea is that it can now be reused by
IRObjectFile among other things.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304958 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-08 01:26:14 +00:00
Eugene Zelenko
643c0a4367 [CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304954 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 23:53:32 +00:00
Alexey Bataev
6ed2765ff1 [SLP] Comment fix, NFC.
Fixed comment in function description.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304940 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 20:37:24 +00:00
Alexey Bataev
931a427122 [SLP] Comment fix, NFC.
Added a description of getReductionCost() function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304938 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 20:27:41 +00:00
Eric Fiselier
41609fea49 Add BinaryFormat module definition
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304928 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 17:16:25 +00:00
Simon Pilgrim
f6be5d234a [DAG] Move SelectionDAG::isCommutativeBinOp to TargetLowering.
This will allow commutation of target-specific DAG nodes in future patches

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304911 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 14:05:04 +00:00
Eric Fiselier
6e94e63671 Adjust module.modulemap after r304864
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304878 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 08:05:31 +00:00
Craig Topper
5d4bfc7c8b [APInt] Fix the documentation for isOneValue. NFC
I copy and pasted from isNullValue and forgot to update it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304877 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 07:40:43 +00:00
Craig Topper
eb370b4757 [InstCombine][InstSimplify] Use APInt::isNullValue/isOneValue to reduce compiled code for comparing APInts with 0 and 1. NFC
These methods are specifically optimized to only counting leading zeros without an additional uint64_t compare.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304876 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 07:40:37 +00:00
Zachary Turner
25d9ac1002 Add #include <system_error>
Hopefully this unbreaks the bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304865 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 03:55:31 +00:00
Zachary Turner
19ca2b0f9d Move Object format code to lib/BinaryFormat.
This creates a new library called BinaryFormat that has all of
the headers from llvm/Support containing structure and layout
definitions for various types of binary formats like dwarf, coff,
elf, etc as well as the code for identifying a file from its
magic.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304864 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 03:48:56 +00:00
Craig Topper
c68553cb7f [Constants] Use APInt::isNullValue/isOneValue/uge to simplify some code and take advantage of APInt optimizations. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304855 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 00:58:02 +00:00
Craig Topper
9082d12000 [APInt] Add a isOneValue method that can determine if a number is 1 by only using getActiveBits/countLeadingZeros
Previously you would have to use operator==(uint64_t) which does the getActiveBits call and a uint64_t comparison. But we can get all we need to know from the getActiveBits call.

This method will be used in another commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304854 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 00:57:57 +00:00
Zachary Turner
2f4ae78089 Fix uninitialized read.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304846 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 23:54:23 +00:00
Davide Italiano
3dfb196736 [SCCIterator] Garbage collect dead code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304845 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 23:41:12 +00:00
Adrian Prantl
dab0766783 Introduce -brief command line option to llvm-dwarfdump
This patch introduces a new command line option, called brief, to
llvm-dwarfdump.  When -brief is used, the attribute forms for the
.debug_info section will not be emitted to output.

Patch by Spyridoula Gravani!

rdar://problem/21474365
Differential Revision: https://reviews.llvm.org/D33867

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304844 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 23:28:45 +00:00
Eugene Zelenko
e74c436b70 [CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304839 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 22:22:41 +00:00
Dimitry Andric
4a03a9f089 Allow VersionPrinter to print to arbitrary raw_ostreams
Summary:
I would like to add printing of registered targets to clang's version
information.  For this to work correctly, the VersionPrinter logic in
CommandLine.cpp should support printing to arbitrary raw_ostreams,
instead of always defaulting to outs().

Add a raw_ostream& parameter to the function pointer type used for
VersionPrinter, and while doing so, introduce a typedef for convenience.

Note that VersionPrinter::print() will still default to using outs(),
the clang part will necessarily go into a separate review.

Reviewers: beanz, chandlerc, dberris, mehdi_amini, zturner

Reviewed By: mehdi_amini

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304835 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 21:54:04 +00:00
Anna Thomas
46747f1821 [LVI Printer] Rely on the LVI analysis functions rather than the LVI cache
Summary:
LVIPrinter pass was previously relying on the LVICache. We now directly call the
the LVI functions which solves the value if the LVI information is not already
available in the cache. This has 2 benefits over the printing of LVI cache:
1. higher coverage (i.e. catches errors) in LVI code when cache value is
invalidated.
2. relies on the core functions, and not dependent on the LVI cache (which may
be scrapped at some point).
It would still catch any cache invalidation errors, since we first go through
the cache.

Reviewers: reames, dberlin, sanjoy

Reviewed by: reames

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304819 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 19:25:31 +00:00
Sam Clegg
53a472fd29 [WebAssembly] MC: Refactor relocation handling
The change cleans up and unifies the handling of relocation
entries in WasmObjectWriter.  Type index relocation no longer
need to be handled separately.

The only externally visible change should be that type
index relocations are no longer grouped at the end.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304816 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 19:15:05 +00:00
Konstantin Zhuravlyov
2c18fa1f9c AMDGPU/NFC: Move amdgpu code object metadata to support
Differential Revision: https://reviews.llvm.org/D31437


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304812 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 18:35:50 +00:00
Daniel Berlin
2d73c379ee NewGVN: Fix PR/33187. This is a bug caused by two things:
1. When there is no perfect iteration order, we can't let phi nodes
put themselves in terms of things that come later in the iteration
order, or we will endlessly cycle (the normal RPO algorithm clears the
hashtable to avoid this issue).
2. We are sometimes erasing the wrong expression (causing pessimism)
because our equality says loads and stores are the same.
We introduce an exact equality function and use it when erasing to
make sure we erase only identical expressions, not equivalent ones.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304807 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 17:15:28 +00:00
Anna Thomas
bacc83353b [Atomics][LoopIdiom] Recognize unordered atomic memcpy
Summary:
Expanding the loop idiom test for memcpy to also recognize
unordered atomic memcpy. The only difference for recognizing
an unordered atomic memcpy and instead of a normal memcpy is
that the loads and/or stores involved are unordered atomic operations.

Background:  http://lists.llvm.org/pipermail/llvm-dev/2017-May/112779.html

Patch by Daniel Neilson!

Reviewers: reames, anna, skatkov

Reviewed By: reames, anna

Subscribers: llvm-commits, mzolotukhin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304806 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 16:45:25 +00:00
Sam Clegg
d6def3abef [WebAssembly] Remove unused methods from MCWasmObjectTargetWriter
These methods looks like they were originally came from
MCELFObjectTargetWriter but they are never called by the
WasmObjectWriter.

Remove these methods meant the declaration of WasmRelocationEntry
could also move into the cpp file.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304804 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 16:38:59 +00:00
Chandler Carruth
dca225eaa7 Fix several more missing headers, all of these were hidden by "lucky"
include ordering.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304790 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 12:31:55 +00:00
Chandler Carruth
4d354ac7b0 Add a missing #include to a header.
This was masked by lucky #include ordering in the .cpp files and
uncovered when we moved to the canonical ordering because the primary
header was included first (yay!). Unfortunately, I can't build this
locally so took a build-bot iteration to find it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304789 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 12:21:27 +00:00
Chandler Carruth
e3e43d9d57 Sort the remaining #include lines in include/... and lib/....
I did this a long time ago with a janky python script, but now
clang-format has built-in support for this. I fed clang-format every
line with a #include and let it re-sort things according to the precise
LLVM rules for include ordering baked into clang-format these days.

I've reverted a number of files where the results of sorting includes
isn't healthy. Either places where we have legacy code relying on
particular include ordering (where possible, I'll fix these separately)
or where we have particular formatting around #include lines that
I didn't want to disturb in this patch.

This patch is *entirely* mechanical. If you get merge conflicts or
anything, just ignore the changes in this patch and run clang-format
over your #include lines in the files.

Sorry for any noise here, but it is important to keep these things
stable. I was seeing an increasing number of patches with irrelevant
re-ordering of #include lines because clang-format was used. This patch
at least isolates that churn, makes it easy to skip when resolving
conflicts, and gets us to a clean baseline (again).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304787 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 11:49:48 +00:00
Vivek Pandya
de22782d75 [Improve CodeGen Testing] This patch renables MIRPrinter print fields which have value equal to its default.
If -simplify-mir option is passed then MIRPrinter will not print such fields.
This change also required some lit test cases in CodeGen directory to be changed.

Reviewed By: MatzeB

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304779 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 08:16:19 +00:00
Xin Tong
801b4cef3c Add a dominanance check interface that uses caching for instructions within same basic block.
Summary:
This problem stems from the fact that instructions are allocated using new
in LLVM, i.e. there is no relationship that can be derived by just looking
at the pointer value.

This interface dispatches to appropriate dominance check given 2 instructions,
i.e. in case the instructions are in the same basic block, ordered basicblock
(with instruction numbering and caching) are used. Otherwise, dominator tree
is used.

This is a preparation patch for https://reviews.llvm.org/D32720

Reviewers: dberlin, hfinkel, davide

Subscribers: davide, mgorny, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304764 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 02:34:41 +00:00
Wolfgang Pieb
c9977b6aa4 [DWARF] Adding support for the DWARF v5 string offsets table (consumer/reader part only).
Reviewers: dblaikie, aprantl

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304759 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 01:22:34 +00:00
Matthias Braun
2144c5262f CodeGen: Refactor MIR parsing
When parsing .mir files immediately construct the MachineFunctions and
put them into MachineModuleInfo.

This allows us to get rid of the delayed construction (and delayed error
reporting) through the MachineFunctionInitialzier interface.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304758 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 00:44:35 +00:00
Mandeep Singh Grang
20350be310 [cmake] Enable reverse iteration by default through build macro
Summary:
Reverse iteration can be turned on, by default, by setting -DLLVM_REVERSE_ITERATION:BOOL=ON during cmake.
With this enabled, we can uncover lots of cases of non-determinism in codegen by simply running our tests (without any other change).
We can then setup a buildbot which will have this turned on by default. Initially, a lot of unit tests will fail in this configuration.
Once we start fixing non-determinism issues, we can gradually make this a blocker for patches.

Reviewers: davide, dblaikie, mehdi_amini, dberlin

Reviewed By: dblaikie

Subscribers: probinson, mgorny, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304757 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 00:36:09 +00:00
Matthias Braun
516023ae81 CodeGen/LLVMTargetMachine: Refactor ISel pass construction; NFCI
- Move ISel (and pre-isel) pass construction into TargetPassConfig
- Extract AsmPrinter construction into a helper function

Putting the ISel code into TargetPassConfig seems a lot more natural and
both changes together make make it easier to build custom pipelines
involving .mir in an upcoming commit. This moves MachineModuleInfo to an
earlier place in the pass pipeline which shouldn't have any effect.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304754 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 00:26:13 +00:00
Evgeny Stupachenko
17e210d01a Fix PR23384 (part 2 of 3) NFC
Summary:
The patch moves LSR cost comparison to target part.

Reviewers: qcolombet

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

From: Evgeny Stupachenko <evstupac@gmail.com>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304750 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-05 23:37:00 +00:00
Matthias Braun
6764d4642c Remove some #include from StackProtector.h; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304748 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-05 22:59:21 +00:00
Zachary Turner
11d1678b59 [CodeView] Handle Cross Module Imports and Exports.
While it's not entirely clear why a compiler or linker might
put this information into an object or PDB file, one has been
spotted in the wild which was causing llvm-pdbdump to crash.

This patch adds support for reading-writing these sections.
Since I don't know how to get one of the native tools to
generate this kind of debug info, the only test here is one
in which we feed YAML into the tool to produce a PDB and
then spit out YAML from the resulting PDB and make sure that
it matches.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304738 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-05 21:40:33 +00:00
Konstantin Zhuravlyov
2b704b0e54 AMDGPU: Remove deprecated and unused elf definitions
Differential Revision: https://reviews.llvm.org/D33689


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304737 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-05 21:33:40 +00:00
Saleem Abdulrasool
5f20490446 CodeGen: add support for emitting ObjC image info
This ensures that we can emit the ObjC Image Info structure on COFF and
ELF as well.  The frontend already would attempt to emit this
information but would get dropped when generating assembly or an object
file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304736 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-05 21:26:39 +00:00
Adam Nemet
8008a8a954 Handle non-unique edges in edge-dominance
This removes a quadratic behavior in assert-enabled builds.

GVN propagates the equivalence from a condition into the blocks guarded by the
condition.  E.g. for 'if (a == 7) { ... }', 'a' will be replaced in the block
with 7.  It does this by replacing all the uses of 'a' that are dominated by
the true edge.

For a switch with N cases and U uses of the value, this will mean N * U calls
to 'dominates'.  Asserting isSingleEdge in 'dominates' make this N^2 * U
because this function checks for the uniqueness of the edge. I.e. traverses
each edge between the SwitchInst's block and the cases.

The change removes the assert and makes 'dominates' works correctly in the
presence of non-unique edges.

This brings build time down by an order of magnitude for an input that has
~10k cases in a switch statement.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304721 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-05 16:27:09 +00:00
Dmitry Mikulin
75fb58cb54 Symbols re-defined with -wrap and -defsym need to be excluded from inter-
procedural optimizations to prevent dropping symbols and allow the linker
to process re-directs.

PR33145: --wrap doesn't work with lto.
Differential Revision: https://reviews.llvm.org/D33621

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304719 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-05 16:24:25 +00:00
Dimitry Andric
c831e63fc5 Remove duplicate LLVM_NATIVE_ from llvm's config.h
Summary:
Since LLVM_NATIVE_ARCH, LLVM_NATIVE_ASMPARSER, LLVM_NATIVE_ASMPRINTER,
LLVM_NATIVE_DISASSEMBLER, LLVM_NATIVE_TARGET, LLVM_NATIVE_TARGETINFO and
LLVM_NATIVE_TARGETMC are already defined in llvm-config.h, there seems
to be no reason to also define them in config.h.  Also, I can only find
usage of these macros in files that include llvm-config.h.

So let's remove the duplicated macros from config.h.

Reviewers: chandlerc, rnk, mehdi_amini, joerg

Reviewed By: rnk

Subscribers: chapuni, mgorny, llvm-commits

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304714 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-05 13:52:31 +00:00
whitequark
68cc6b69c9 [LLVM-C] [OCaml] Expose Type::subtypes.
The C functions added are LLVMGetNumContainedTypes and
LLVMGetSubtypes.

The OCaml function added is Llvm.subtypes.

Patch by Ekaterina Vaartis.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304709 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-05 11:49:52 +00:00
Javed Absar
13aa077a23 Add support for #pragma clang section
This patch provides a means to specify section-names for global variables,
functions and static variables, using #pragma directives.
This feature is only defined to work sensibly for ELF targets.
One can specify section names as:
#pragma clang section bss="myBSS" data="myData" rodata="myRodata" text="myText"
One can "unspecify" a section name with empty string e.g.
#pragma clang section bss="" data="" text="" rodata=""

Reviewers: Roger Ferrer, Jonathan Roelofs, Reid Kleckner
Differential Revision: https://reviews.llvm.org/D33413



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304704 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-05 10:09:13 +00:00
Renato Golin
3b482e4bca Revert "[sanitizer-coverage] one more flavor of coverage: -fsanitize-coverage=inline-8bit-counters. Experimental so far, not documenting yet."
This reverts commit r304630, as it broke ARM/AArch64 bots for 2 days.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304698 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-05 07:35:52 +00:00
Galina Kistanova
539f9014fc Initialized BackedgeTakenInfo.MaxOrZero.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304639 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 05:21:08 +00:00
Kostya Serebryany
111f62d417 [sanitizer-coverage] one more flavor of coverage: -fsanitize-coverage=inline-8bit-counters. Experimental so far, not documenting yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304630 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 01:35:47 +00:00
Eugene Zelenko
239d957e9e [CodeGen] Fix Windows builds broken in r304621.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304624 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 00:39:36 +00:00
Zachary Turner
a5be24d937 [PDB] Fix use after free.
Previously MappedBlockStream owned its own BumpPtrAllocator that
it would allocate from when a read crossed a block boundary.  This
way it could still return the user a contiguous buffer of the
requested size.  However, It's not uncommon to open a stream, read
some stuff, close it, and then save the information for later.
After all, since the entire file is mapped into memory, the data
should always be available as long as the file is open.

Of course, the exception to this is when the data isn't *in* the
file, but rather in some buffer that we temporarily allocated to
present this contiguous view.  And this buffer would get destroyed
as soon as the strema was closed.

The fix here is to force the user to specify the allocator, this
way it can provide an allocator that has whatever lifetime it
chooses.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304623 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 00:33:35 +00:00
Eugene Zelenko
5067e6a434 [CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304621 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 00:22:41 +00:00
Quentin Colombet
f6a51e432d Change code formatting to look like the surrounding code
clang-format decided differently and Matthias pointed out the
difference.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304608 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 23:07:58 +00:00
Philip Reames
b72c01108d [Statepoint] Be consistent about using deopt naming [NFCI]
We'd called this "vm state" in the early days, but have long since standardized on calling it "deopt" in line with the operand bundle tag.  Fix a few cases we'd missed.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304607 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 23:03:26 +00:00
Matthias Braun
3310b59ffc RegisterScavenging: Add ScavengerTest pass
This pass allows to run the register scavenging independently of
PrologEpilogInserter to allow targeted testing.

Also adds some basic register scavenging tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304606 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 23:01:42 +00:00
Matthias Braun
95f9057a26 InitializePasses: Sort initializer list (by ASCII)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304605 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 23:01:38 +00:00
Quentin Colombet
9f43f266be [RABasic] Properly initialize the pass
Use the initializeXXX method to initialize the RABasic pass in the
pipeline. This enables us to take advantage of the .mir infrastructure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304602 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 22:46:26 +00:00
Matthias Braun
465de97122 RegisterScavenging: Move scavenging logic from PEI to RegisterScavenging; NFC
These parts do not depend on any PrologEpilogInserter logic and
therefore better fits RegisterScaveging.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304596 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 21:02:03 +00:00
Zachary Turner
42d60ef585 [CodeView] Support CodeView subsections in any order.
Previously we would expect certain subsections to appear
in a certain order because some subsections would reference
other subsections, but in practice we need to support
arbitrary orderings since some object file and PDB file
producers generate them this way.  This also paves the
way for supporting Yaml <-> Object File conversion of
CodeView, since Object Files typically have quite a
large number of subsections in their debug info.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304588 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 19:49:14 +00:00
Evgeniy Stepanov
93d430ca14 Skip CFI for dead functions.
Differential Revision: https://reviews.llvm.org/D33805

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304578 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 18:24:23 +00:00
Reid Kleckner
8147ef1372 Re-land "COFF: migrate def parser from LLD to LLVM"
This reverts commit r304561 and re-lands r303490 & co.

The fix was to use "SymbolName" when translating LLD's internal export
list to lib/Object's short export struct. The SymbolName reflects the
actual symbol name, which may include fastcall and stdcall mangling bits
not included in the /EXPORT or .def file EXPORTS name:

@@ -434,8 +434,7 @@ std::vector<COFFShortExport> createCOFFShortExportFromConfig() {
   std::vector<COFFShortExport> Exports;
   for (Export &E1 : Config->Exports) {
     COFFShortExport E2;
-    E2.Name = E1.Name;
+    // Use SymbolName, which will have any stdcall or fastcall qualifiers.
+    E2.Name = E1.SymbolName;
     E2.ExtName = E1.ExtName;
     E2.Ordinal = E1.Ordinal;
     E2.Noname = E1.Noname;

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304573 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 17:53:06 +00:00
David Blaikie
29e59c38ab Tidy up a bit of r304516, use SmallVector::assign rather than for loop
This might give a few better opportunities to optimize these to memcpy
rather than loops - also a few minor cleanups (StringRef-izing,
templating (to avoid std::function indirection), etc).

The SmallVector::assign(iter, iter) could be improved with the use of
SFINAE, but the (iter, iter) ctor and append(iter, iter) need it to and
don't have it - so, workaround it for now rather than bothering with the
added complexity.

(also, as noted in the added FIXME, these assign ops could potentially
be optimized better at least for non-trivially-copyable types)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304566 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 17:24:26 +00:00
Philip Reames
4b07d035e2 Verify a couple more fields in STATEPOINT instructions
While doing so, clarify the comments and update them to reflect current reality.

Note: I'm going to let this sit for a week or so before adding further verification.  I want to give this time to cycle through bots and merge it into our downstream tree before pushing this further.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304565 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 17:02:33 +00:00
Philip Reames
bfffaf778f Add placeholder for more extensive verification of psuedo ops
This initial patch doesn't actually do much useful. It's just to show where the new code goes. Once this is in, I'll extend the verification logic to check more useful properties.

For those curious, the more complicated version of this patch already found one very suspicious thing.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304564 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 16:36:37 +00:00
Reid Kleckner
afe7c5a7a6 Revert "COFF: migrate def parser from LLD to LLVM"
This reverts commits r303490, r303491, r303493, and r303494.

This caused http://crbug.com/728726. Essentially, exporting stdcall
functions doesn't appear to work after this change. Reduced test case
soon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304561 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 16:26:24 +00:00
Benjamin Kramer
2118193ddf [OrderedBasicBlock] Return false for comesBefore(A, A)
So far it would return true for the first uncached query, then cached
queries return false.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304545 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 13:10:31 +00:00
Javed Absar
8f528aa2a7 [ARM] Cortex-A57 scheduling model for ARM backend (AArch32)
This patch implements the Cortex-A57 scheduling model.
The main code is in ARMScheduleA57.td, ARMScheduleA57WriteRes.td.
Small changes in cpp,.h files to support required scheduling predicates.

Scheduling model implemented according to:
 http://infocenter.arm.com/help/topic/com.arm.doc.uan0015b/Cortex_A57_Software_Optimization_Guide_external.pdf.

Patch by : Andrew Zhogin (submitted on his behalf, as requested).
Rewiewed by: Renato Golin, Diana Picus, Javed Absar, Kristof Beyls.
Differential Revision: https://reviews.llvm.org/D28152




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304530 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 08:53:19 +00:00
Craig Topper
d8a59f8c32 [TableGen] Remove a couple unused methods from Record that take a StringRef argument. NFC
We also have a version that takes an Init* that are used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304521 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 05:56:47 +00:00
Eugene Zelenko
ff49b831bd [CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304495 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 23:25:02 +00:00
Tim Shen
a950eb976c [ThinLTO] Move -lto-use-new-pm to llvm-lto2, and change it to -use-new-pm.
Summary:
As we teach Clang to use ThinkLTO + new PM, it's good for the users to
inject through Config, instead of setting a flag in the LTOBackend
library. Move the flag to llvm-lto2.

As it moves to llvm-lto2, a new name -use-new-pm seems simpler and as
clear.

Reviewers: davide, tejohnson

Subscribers: mehdi_amini, Prazek, inglorion, eraman, chandlerc, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304492 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 23:13:44 +00:00
Keno Fischer
6437c35ae0 Reapply "[Cloning] Take another pass at properly cloning debug info"
This was rL304226, reverted in 304228 due to a clang assertion failure
on the build bots. That problem should have been addressed by clang
commit rL304470.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304488 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 23:02:12 +00:00
Zachary Turner
cb20a4fea9 Fix -Wreorder warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304485 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 22:03:17 +00:00
Zachary Turner
6a330c6d5d [CodeView] Properly align symbol records on read/write.
Object files have symbol records not aligned to any particular
boundary (e.g. 1-byte aligned), while PDB files have symbol
records padded to 4-byte aligned boundaries.  Since they share
the same reading / writing code, we have to provide an option to
specify the alignment and propagate it up to the producer or
consumer who knows what the alignment is supposed to be for the
given container type.

Added a test for this by modifying the existing PDB -> YAML -> PDB
round-tripping code to round trip symbol records as well as types.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304484 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 21:52:41 +00:00
Eli Friedman
dca42389f7 Add opt-bisect support for region passes.
This is necessary to get opt-bisect working with polly.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304476 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 21:22:26 +00:00
Keno Fischer
cb70331097 [DIBuilder] Add a more fine-grained finalization method
Summary:
Clang wants to clone a function before it is done building the entire
compilation unit. As of now, there is no good way to do that, because
CloneFunction doesn't like dealing with temporary metadata. However,
as long as clang doesn't want to add any variables to this SP, it
should be fine to just prematurely finalize it. Add an API to allow this.

This is done in preparation of a clang commit to fix the assertion that
necessitated the revert of D33655.

Reviewers: aprantl, dblaikie

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304467 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 20:42:44 +00:00
Evgeniy Stepanov
ccb80b9c0f (NFC) Track global summary liveness in GVFlags.
Replace GVFlags::LiveRoot with GVFlags::Live and use that instead of
all the DeadSymbols sets. This is refactoring in order to make
liveness information available in the RegularLTO pipeline.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304466 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 20:30:06 +00:00
Adrian Prantl
ad988ad98b [DWARF] Introduce Dump Options
This commit introduces a structure that holds all the flags that
control the pretty printing of dwarf output.

Patch by Spyridoula Gravani!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304446 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 18:18:23 +00:00
Chandler Carruth
df1cbec93f [PM/ThinLTO] Port the ThinLTO pipeline (both components) to the new PM.
Based on the original patch by Davide, but I've adjusted the API exposed
to just be different entry points rather than exposing more state
parameters. I've factored all the common logic out so that we don't have
any duplicate pipelines, we just stitch them together in different ways.
I think this makes the build easier to reason about and understand.

This adds a direct method for getting the module simplification pipeline
as well as a method to get the optimization pipeline. While not my
express goal, this seems nice and gives a good place comment about the
restrictions that are imposed on them.

I did make some minor changes to the way the pipelines are structured
here, but hopefully not ones that are significant or controversial:

1) I sunk the PGO indirect call promotion to only be run when we have
   PGO enabled (or as part of the special ThinLTO pipeline).

2) I made the extra GlobalOpt run in ThinLTO just happen all the time
   and at a slightly more powerful place (before we remove available
   externaly functions). This seems like general goodness and not a big
   compile time sink, so it didn't make sense to *only* use it in
   ThinLTO. Fewer differences in the pipeline makes everything simpler
   IMO.

3) I hoisted the ThinLTO stop point pre-link above the the RPO function
   attr inference. The RPO inference won't infer anything terribly
   meaningful pre-link (recursiveness?) so it didn't make a lot of
   sense. But if the placement of RPO inference starts to matter, we
   should move it to the canonicalization phase anyways which seems like
   a better place for it (and there is a FIXME to this effect!). But
   that seemed a bridge too far for this patch.

If we ever need to parameterize these pipelines more heavily, we can
always sink the logic to helper functions with parameters to keep those
parameters out of the public API. But the changes above seemed minor
that we could possible get away without the parameters entirely.

I added support for parsing 'thinlto' and 'thinlto-pre-link' names in
pass pipelines to make it easy to test these routines and play with them
in larger pipelines. I also added a really basic manifest of passes test
that will show exactly how the pipelines behave and work as well as
making updates to them clear.

Lastly, this factoring does introduce a nesting layer of module pass
managers in the default pipeline. I don't think this is a big deal and
the flexibility of decoupling the pipelines seems easily worth it.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304407 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 11:39:39 +00:00
Amaury Sechet
0247f749b8 Do not legalize large setcc with setcce, introduce setcccarry and do it with usubo/setcccarry.
Summary:
This is a continuation of the work started in D29872 . Passing the carry down as a value rather than as a glue allows for further optimizations. Introducing setcccarry makes the use of addc/subc unecessary and we can start the removal process.

This patch only introduce the optimization strictly required to get the same level of optimization as was available before nothing more.

Reviewers: jyknight, nemanjai, mkuper, spatel, RKSimon, zvi, bkramer

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304404 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 11:14:17 +00:00
Kristof Beyls
f2c10d746a Make mcpu=generic the default for armv7-a and armv8-a.
As discussed in
http://lists.llvm.org/pipermail/llvm-dev/2017-May/113525.html


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304390 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 07:31:43 +00:00
Craig Topper
4b8d5408e9 [TableGen] Remove RecordVal constructor that takes a StringRef and Record::setName(StringRef). Leave just the versions that take an Init.
They weren't used often enough to justify having two different interfaces. Push the responsiblity of creating a StringInit up to the caller.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304388 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 06:56:16 +00:00
Tim Shen
2e37885e1d [ThinLTO] Migrate ThinLTOBitcodeWriter to the new PM.
Summary: Also see D33429 for other ThinLTO + New PM related changes.

Reviewers: davide, chandlerc, tejohnson

Subscribers: mehdi_amini, Prazek, cfe-commits, inglorion, llvm-commits, eraman

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304378 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 01:02:12 +00:00
Dehao Chen
b9583a3a17 Add LiveRangeShrink pass to shrink live range within BB.
Summary: LiveRangeShrink pass moves instruction right after the definition with the same BB if the instruction and its operands all have more than one use. This pass is inexpensive and guarantees optimal live-range within BB.

Reviewers: davidxl, wmi, hfinkel, MatzeB, andreadb

Reviewed By: MatzeB, andreadb

Subscribers: hiraditya, jyknight, sanjoy, skatkov, gberry, jholewinski, qcolombet, javed.absar, krytarowski, atrick, spatel, RKSimon, andreadb, MatzeB, mehdi_amini, mgorny, efriedma, davide, dberlin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304371 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-31 23:25:25 +00:00
Wei Mi
3412991419 Revert rL304050. It may break sanitizer bootstrap. Revert it for now while investigating.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304350 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-31 21:29:33 +00:00
Matthias Braun
3a135cff86 X86FloatingPoint: Fix livein lists
After transforming FP to ST registers:
- Do not add the ST register to the livein lists, they are reserved so
  we do not need to track their liveness.
- Remove the FP registers from the livein lists, they don't have defs or
  uses anymore and so are not live.
- (The setKillFlags() call is moved to an earlier place as it relies on
   the FP registers still being present in the livein list.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304342 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-31 20:30:22 +00:00
Reid Kleckner
1e9afac22c [IR] Add additional addParamAttr/removeParamAttr to AttributeList API
Summary:
Fairly straightforward patch to fill in some of the holes in the
attributes API with respect to accessing parameter/argument attributes.
The patch aims to step further towards encapsulating the
idx+FirstArgIndex pattern to access these attributes to within the
AttributeList.

Patch by Daniel Neilson!

Reviewers: rnk, chandlerc, pete, javed.absar, reames

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304329 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-31 19:23:09 +00:00
Craig Topper
c469be384c [TableGen] Make Record::getValueAsString and getValueAsListOfStrings return StringRefs instead of std::string
Internally both these methods just return the result of getValue on either a StringInit or a CodeInit object. In both cases this returns a StringRef pointing to a string allocated in the BumpPtrAllocator so its not going anywhere. So we can just pass that StringRef along.

This is a fairly naive patch that targets just the build failures caused by this change. There's additional work that can be done to avoid creating std::string at call sites that still think getValueAsString returns a std::string. I'll try to clean those up in future patches.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304325 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-31 19:01:11 +00:00
Matthias Braun
664dca2daa TargetMachine: Indicate whether machine verifier passes.
This adds a callback to the LLVMTargetMachine that lets target indicate
that they do not pass the machine verifier checks in all cases yet.

This is intended to be a temporary measure while the targets are fixed
allowing us to enable the machine verifier by default with
EXPENSIVE_CHECKS enabled!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304320 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-31 18:41:23 +00:00
Anna Thomas
d2f82e8767 Revert "[Atomics][LoopIdiom] Recognize unordered atomic memcpy"
This reverts commit r304310.

It caused build failures in polly and mingw
due to undefined reference to
llvm::RTLIB::getMEMCPY_ELEMENT_ATOMIC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304315 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-31 17:20:51 +00:00
Zaara Syeda
682f92f568 [PPC] Inline expansion of memcmp
This patch does an inline expansion of memcmp.
It changes the memcmp library call into an inline expansion when the size is
known at compile time and is under a target specified threshold.
This expansion is implemented in CodeGenPrepare and expands into straight line
code. The target specifies a maximum load size and the expansion works by using
this size to load the two sources, compare, and exit early if a difference is
found. It also has a special case when the memcmp result is used in a compare
to zero equality.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304313 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-31 17:12:38 +00:00
Anna Thomas
834c44bc32 [Atomics][LoopIdiom] Recognize unordered atomic memcpy
Summary:
Expanding the loop idiom test for memcpy to also recognize unordered atomic memcpy.
The only difference for recognizing
an unordered atomic memcpy and instead of a normal memcpy is
that the loads and/or stores involved are unordered atomic operations.
Background:  http://lists.llvm.org/pipermail/llvm-dev/2017-May/112779.html

Patch by Daniel Neilson!

Reviewers: reames, anna, skatkov

Reviewed By: reames

Subscribers: llvm-commits, mzolotukhin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304310 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-31 16:39:52 +00:00
Craig Topper
24c1e7771a [TableGen] Implement non-const versions of Record::getValue by delegating to the const versions to avoid duplicate code. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304281 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-31 05:12:36 +00:00
Craig Topper
fa336f863c [TableGen] Make one of RecordVal's constructors delegate to the other to reduce duplicate code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304280 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-31 05:12:33 +00:00
Zachary Turner
7b436b03da [ObjectYAML] Split CodeViewYAML into 3 pieces.
The code was a mess and disorganized due to the sheer amount
of it being in one file.  So I'm splitting this into three files.
One for CodeView types, one for CodeView symbols, and one for
CodeView debug subsections.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304278 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-31 04:17:13 +00:00
Eugene Zelenko
1d081e6497 [CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304265 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-31 01:10:10 +00:00
Vedant Kumar
4fb2b268d9 Fix CodeView-related modules build failures post-r304248
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304264 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-31 01:08:43 +00:00
Zachary Turner
876e5a30fc [ObjectYAML] Clean up the CodeView headers a bit.
CodeViewYAML.h attempts to hide the details of many of the
CodeView yaml structures and types, but at the same time it
exposes the mapping traits for them to external users of the
header.

This patch just hides these in the implementation files so that
the interface is kept as simple as possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304263 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-31 01:08:36 +00:00
Alina Sbirlea
45da6478a8 Fix misspelling
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304262 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-31 01:00:51 +00:00
Zachary Turner
5dc901370c [CodeView] Move CodeView symbol yaml logic to ObjectYAML.
This continues the effort to get the CodeView YAML parsing logic
into ObjectYAML.  After this patch, the only missing piece will
be the CodeView debug symbol subsections.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304256 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 23:50:44 +00:00
Zachary Turner
ea64a9b812 [CodeView] Move CodeView YAML code to ObjectYAML.
This is the beginning of an effort to move the codeview yaml
reader / writer into ObjectYAML so that it can be shared.
Currently the only consumer / producer of CodeView YAML is
llvm-pdbdump, but CodeView can exist outside of PDB files, and
indeed is put into object files and passed to the linker to
produce PDB files.  Furthermore, there are subtle differences
in the types of records that show up in object file CodeView
vs PDB file CodeView, but they are otherwise 99% the same.

By having this code in ObjectYAML, we can have llvm-pdbdump
reuse this code, while teaching obj2yaml and yaml2obj to use
this syntax for dealing with object files that can contain
CodeView.

This patch only adds support for CodeView type information
to ObjectYAML.  Subsequent patches will add support for
CodeView symbol information.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304248 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 21:53:05 +00:00
Matthias Braun
7d0dde023f TargetPassConfig: Keep a reference to an LLVMTargetMachine; NFC
TargetPassConfig is not useful for targets that do not use the CodeGen
library, so we may just as well store a pointer to an
LLVMTargetMachine instead of just to a TargetMachine.

While at it, also change the constructor to take a reference instead of a
pointer as the TM must not be nullptr.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304247 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 21:36:41 +00:00
Tim Northover
837e2e977f MIR: remove explicit "noVRegs" property.
We can infer this from the incoming MIR, so there's no reason to
represent it with a special flag.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304246 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 21:28:57 +00:00
Xinliang David Li
cbd4ff9310 [PartialInlining] Shrinkwrap allocas with live range contained in outline region.
Differential Revision: http://reviews.llvm.org/D33618


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304245 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 21:22:18 +00:00
Benjamin Kramer
35a9f9117d [Object] Remove unused field + constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304233 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 19:37:02 +00:00
Keno Fischer
26b413581c Revert "[Cloning] Take another pass at properly cloning debug info"
At least one build bot is complaining. Will investigate after lunch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304228 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 18:56:26 +00:00
Keno Fischer
e34d6c6de7 [Cloning] Take another pass at properly cloning debug info
Summary:
In rL302576, DISubprograms gained the constraint that a !dbg attachments to functions must
have a 1:1 mapping to DISubprograms. As part of that change, the function cloning support
was adjusted to attempt to enforce this invariant during cloning. However, there
were several problems with the implementation. Part of these were fixed in rL304079.
However, there was a more fundamental problem with these changes, namely that it
bypasses the matadata value map, causing the cloned metadata to be a mix of metadata
pointing to the new suprogram (where manual code was added to fix those up) and the
old suprogram (where this was not the case). This mismatch could cause a number of
different assertion failures in the DWARF emitter. Some of these are given at
https://github.com/JuliaLang/julia/issues/22069, but some others have been observed
as well. Attempt to rectify this by partially reverting the manual DI metadata fixup,
and instead using the standard value map approach. To retain the desired semantics
of not duplicating the compilation unit and inlined subprograms, explicitly freeze
these in the value map.

Reviewers: dblaikie, aprantl, GorNishanov, echristo

Reviewed By: aprantl

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304226 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 18:28:30 +00:00
Eric Beckmann
1f0488cec7 Adding parsing ability for .res file.
Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304225 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 18:19:06 +00:00
Zachary Turner
825457abaa [CodeView] Add more DebugSubsection implementations.
This adds implementations for Symbols and FrameData, and renames
the existing codeview::StringTable class to conform to the
DebugSectionStringTable convention.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304222 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 17:13:33 +00:00
Zachary Turner
4b1845a38a [CodeView] Rename ModuleDebugFragment -> DebugSubsection.
This is more concise, and matches the terminology used in other
parts of the codebase more closely.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304218 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 16:36:15 +00:00
Max Kazantsev
e840b9f244 [SCEV][NFC] Remove redundant params from isAvailableAtLoopEntry
Params DT and LI are redundant, because these values are contained in fields anyways.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304204 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 10:54:58 +00:00
Oliver Stannard
94eec101b3 [MC] Fix constant pools with DenseMap sentinel values
The MC ConstantPool class uses a DenseMap to track generated constants, with
the int64_t value of the constant as the key. This fails when values of
0x7fffffffffffffff or 0x7ffffffffffffffe are inserted into the constant pool, as
these are sentinel values for DenseMap.

The fix is to use std::map instead, which doesn't use sentinel values.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304199 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 09:37:11 +00:00
Daniel Berlin
0ef24304b8 NewGVN: Compute hash value of expression on demand and use it in inequality testing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304195 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 06:58:18 +00:00
Galina Kistanova
72f550d188 Added missing line continuation to HANDLE_DIEVALUE_SMALL and HANDLE_DIEVALUE_LARGE macros.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304186 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 03:21:12 +00:00
Craig Topper
70ac7747fa [TableGen] Introduce DagInit::getArgs that returns an ArrayRef. Use it to fix 80 column violations in arg_begin/arg_end. Remove DagInit::args and use getArgs instead. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304177 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 21:49:34 +00:00
Benjamin Kramer
e005fa57be [ManagedStatic] Avoid putting function pointers in template args.
This is super awkward, but GCC doesn't let us have template visible when
an argument is an inline function and -fvisibility-inlines-hidden is
used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304175 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 20:56:27 +00:00
Benjamin Kramer
613a9c723b [ManagedStatic] Make object_creator/object_deleter visible again.
They're now exposed as template args, which creates complications when
ManagedStatics are used across .so boundaries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304166 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 18:00:33 +00:00
Benjamin Kramer
10f535273f [ManagedStatic] Add a way to pass custom creators/deleters.
Also add a test case verifying that nested ManagedStatics work correctly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304155 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 14:05:26 +00:00
Mattias Eriksson
4ca30c7c76 Test commit: fix typos
Just fixing a few typos in comments to test commit access.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304149 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 11:46:44 +00:00
Nikolai Bozhenov
404324ef9b [Nios2] Target registration
Reviewers: craig.topper, hfinkel, joerg, lattner, zvi

Reviewed By: craig.topper

Subscribers: oren_ben_simhon, igorb, belickim, tvvikram, mgorny, llvm-commits, pavel.v.chupin, DavidKreitzer

Differential Revision: https://reviews.llvm.org/D32669
Patch by AndreiGrischenko <andrei.l.grischenko@intel.com>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304144 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 09:48:30 +00:00
Benjamin Kramer
0dbb1537bc [InstrProf] Use more ArrayRef/StringRef.
No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304089 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-28 13:23:02 +00:00