138308 Commits

Author SHA1 Message Date
Zachary Turner
5fa3c5202b [pdb] Write the IPI stream.
The IPI stream is structurally identical to the TPI stream, but it
contains different record types.  So we just re-use the TPI writing
code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281638 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 18:22:31 +00:00
Sanjay Patel
d6d0906b44 fix function names; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281637 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 18:22:25 +00:00
Zachary Turner
6baec2e728 [pdb] Fix the TPI stream size computation.
We were inadvertently adding the size of the hash value stream to
the size of the TPI stream, even though the hash value stream is
an entirely separate stream.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281636 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 18:22:21 +00:00
Kostya Serebryany
d52d05173f [libFuzzer] fix the build for AFLDriverTest
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281633 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 18:10:38 +00:00
Sanjay Patel
2473bf077d [InstCombine] allow icmp (sub nsw) folds for vectors
Also, clean up the code and comments for the existing folds in foldICmpSubConstant().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281631 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 18:05:17 +00:00
Sanjay Patel
ba1d7c682d [InstCombine] add vector tests for icmp (sub nsw)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281630 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 17:54:47 +00:00
Davide Italiano
8471051cc5 [IRObjectFile] Handle undefined weak symbols in RecordStreamer.
Differential Revision:  https://reviews.llvm.org/D24594

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281629 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 17:54:22 +00:00
Peter Collingbourne
72499e5332 Take ownership of libLTO as discussed on llvm-dev.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281628 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 17:42:39 +00:00
Sanjay Patel
d2bd71f1d9 [InstCombine] remove duplicated fold ; NFCI
This pattern is matched in foldICmpBinOpEqualityWithConstant() and already works
with vectors too. I changed some comments over there to point out the current 
location. The tests for this transform are currently in 'sub.ll'.

Note that the remaining folds in this block all require a sub too, so they should
get grouped with the other icmp(sub) patterns.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281627 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 17:01:17 +00:00
Sanjay Patel
f71deb6fd3 [InstCombine] allow (icmp sgt smin(PosA, B), 0) fold for vectors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281624 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 16:23:20 +00:00
Sanjay Patel
b794567962 [InstCombine] add vector tests for icmp sgt smin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281623 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 16:13:41 +00:00
Sanjay Patel
c0fdffbdb1 [InstCombine] auto-generate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281621 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 15:48:53 +00:00
Etienne Bergeron
d40500c24d [compiler-rt] Changing function prototype returning unused value
Summary: The return value of `maybeInsertAsanInitAtFunctionEntry` is ignored.

Reviewers: rnk

Subscribers: llvm-commits, chrisha, dberris

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281620 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 15:45:05 +00:00
Etienne Bergeron
51832f72bd Fix silly mistake introduced here : https://reviews.llvm.org/D24566
Asan bots are currently broken without this patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281618 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 15:35:59 +00:00
Etienne Bergeron
28f64ff6ba address comments from: https://reviews.llvm.org/D24566
using startswith instead of find.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281617 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 15:19:19 +00:00
Reid Kleckner
0863eca1d3 Document our extension to the COFF .section directive flags
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281616 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 15:11:49 +00:00
Sanjay Patel
964ae1d5ee [InstCombine] clean up foldICmpWithConstant(); NFC
1. Early exit to reduce indent
2. Rename variables
3. Add local 'Pred' variable


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281615 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 15:11:12 +00:00
Sanjay Patel
80554382ca [InstCombine] add helper function for foldICmpWithConstant; NFC
This is a big glob of transforms that probably should work for vectors,
but currently they are disallowed because of ConstantInt guards.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281614 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 14:37:50 +00:00
Sanjay Patel
0ee16969ab [InstCombine] use m_APInt to allow icmp folds using known bits for splat constant vectors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281613 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 14:15:47 +00:00
Simon Dardis
c2c0b27fee [mips][ias] Enable IAS by default for N64 on Debian mips64el.
Unfortunately we can't enable it for all N64 because it is not yet possible to
distinguish N32 from N64.

N64 has been confirmed to produce identical (within reason) objects to GAS
during stage 2 of compiler recursion on N64-abit Fedora. Unfortunately,
Fedora's triples do not distinguish N32 from N64 so I can't enable it by
default there. I'm currently repeating this testing for Debian mips64el but
it's very unlikely to produce a different result.

Patch by: Daniel Sanders

Reviewers: sdardis

Differential Review: https://reviews.llvm.org/D22678


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281607 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 13:13:01 +00:00
James Molloy
095eb00556 [ARM] Promote small global constants to constant pools
If a constant is unamed_addr and is only used within one function, we can save
on the code size and runtime cost of an indirection by changing the global's storage
to inside the constant pool. For example, instead of:

      ldr r0, .CPI0
      bl printf
      bx lr
    .CPI0: &format_string
    format_string: .asciz "hello, world!\n"

We can emit:

      adr r0, .CPI0
      bl printf
      bx lr
    .CPI0: .asciz "hello, world!\n"

This can cause significant code size savings when many small strings are used in one
function (4 bytes per string).

This recommit contains fixes for a nasty bug related to fast-isel fallback - because
fast-isel doesn't know about this optimization, if it runs and emits references to
a string that we inline (because fast-isel fell back to SDAG) we will end up
with an inlined string and also an out-of-line string, and we won't emit the
out-of-line string, causing backend failures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281604 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 12:30:27 +00:00
Tim Northover
8c9a9af652 GlobalISel: legalize GEP instructions with small offsets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281602 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 11:02:19 +00:00
Tim Northover
3d658a6577 GlobalISel: relax type constraints on G_ICMP to allow pointers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281600 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 10:40:38 +00:00
Tim Northover
3d94178ab6 GlobalISel: remove "unsized" LLT
It was only really there as a sentinel when instructions had to have precisely
one type. Now that registers are typed, each register really has to have a type
that is sized.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281599 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 10:09:59 +00:00
NAKAMURA Takumi
ccc7ec7f42 llvm/test/Transforms/CorrelatedValuePropagation/alloca.ll REQUIRES +Asserts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281598 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 09:45:31 +00:00
Tim Northover
cdce758a72 GlobalISel: cache pointer sizes in LLT
Otherwise everything that needs to work out what size they are has to keep a
DataLayout handy, which is a bit silly and very annoying.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281597 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 09:20:34 +00:00
Vedant Kumar
4cb35092d0 [llvm-cov] Move some layout logic to the right spot (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281590 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 06:49:13 +00:00
Vedant Kumar
61f5694c30 [llvm-cov] Hide instantiation views for unexecuted functions
Copying in the full text of the function doesn't help at all when we
already know that it's never executed. Just say that it's unexecuted --
the relevant source text has already been printed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281589 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 06:44:51 +00:00
Vedant Kumar
2fcbfcf470 [llvm-cov] Don't create 'jump to ...' links in nested views
Doing so is pointless, since the whole view is usually visible in a
small amount of space.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281588 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 06:44:48 +00:00
Wei Mi
0bcb8fb950 Add some shortcuts in LazyValueInfo to reduce compile time of Correlated Value Propagation.
The patch is to partially fix PR10584. Correlated Value Propagation queries LVI
to check non-null for pointer params of each callsite. If we know the def of
param is an alloca instruction, we know it is non-null and can return early from
LVI. Similarly, CVP queries LVI to check whether pointer for each mem access is
constant. If the def of the pointer is an alloca instruction, we know it is not
a constant pointer. These shortcuts can reduce the cost of CVP significantly.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281586 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 06:28:34 +00:00
Jonas Hahnfeld
f158709ee5 [CMake] Fixing lit for runtimes directory
Copy variable LLVM_BUILD_MAIN_SRC_DIR from LLVMConfig.cmake to
LLVM_MAIN_SRC_DIR as it is named for in-tree builds. This ensures that
add_lit_target() can reliably find llvm-lit which is not necessarily
in the PATH.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281585 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 06:14:13 +00:00
Kostya Serebryany
577674bc4f [libFuzzer] disable test that requires debug info -- it fails on the bot
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281584 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 05:46:58 +00:00
Kostya Serebryany
3f6d6753de [libFuzzer] move the AFL driver build rule test into the uninstrumented dir
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281583 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 05:17:39 +00:00
Vedant Kumar
7551d48f2f [llvm-cov] Make a method name more accurate (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281581 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 04:45:59 +00:00
Kostya Serebryany
7e2d153c71 [libFuzzer] fix print_pcs test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281580 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 04:43:06 +00:00
Vedant Kumar
90562cd08a [llvm-cov] Don't print a verbose title when looking at one file
Having the same title, timestamp, etc. occur repeatedly creates an
unnecessary distraction when paging through a report.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281579 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 04:41:39 +00:00
Vedant Kumar
5d97808700 [llvm-cov] Fix tests that aren't checking anything (NFC)
E.g the 'showProjectSummary' test contains some checks which can't fail
because they match themselves...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281578 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 04:41:37 +00:00
Kostya Serebryany
f0b5dd76ab [libFuzzer] implement print_pcs with trace-pc-guard. Change the trace-pc-guard heuristic for 8-bit counters to look more like in AFL (not that it's provable better, but the existin test preferes this heuristic)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281577 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 04:36:45 +00:00
Wei Mi
f09ca2fb88 Add a C++ unittest to test the fix for PR30213.
The test exercises the branch in scev expansion when the value in ValueOffsetPair
is a ptr and the offset is not divisible by the elem type size of value.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281575 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 04:06:44 +00:00
Justin Lebar
4574c11309 [doc] [CUDA] Add sections about STL support and differences between nvcc and clang to CompileCudaWithLLVM.rst.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281573 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 02:04:32 +00:00
Sanjoy Das
81598633a4 [LangRef] Add a clarifying example for undef
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281570 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 01:56:58 +00:00
Kostya Serebryany
26586a8660 [libFuzzer] add 8-bit counters to trace-pc-guard handler
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281568 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 01:30:18 +00:00
Sanjay Patel
0ebfb4ee10 [InstCombine] refactor eq/ne cases in foldICmpUsingKnownBits() ; NFCI
The pattern matching and transforms are identical; the cmp predicate just changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281561 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 23:38:56 +00:00
Zachary Turner
f5898c18e7 [pdb] Fix unit test compilation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281560 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 23:17:08 +00:00
Sanjay Patel
a18aa4cd29 [InstCombine] add vector tests for foldICmpUsingKnownBits()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281559 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 23:15:11 +00:00
Zachary Turner
b5689e754e [pdb] Get rid of Data and RawData in CVType.
The `CVType` had two redundant fields which were confusing and
error-prone to fill out.  By treating member records as a distinct
type from leaf records, we are able to simplify this quite a bit.

Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D24432

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281556 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 23:00:16 +00:00
Zachary Turner
a9d16c9445 [pdb] Write TPI hash values to the TPI stream.
This completes being able to write all the interesting
values of a PDB TPI stream.

Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D24370

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281555 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 23:00:02 +00:00
Reid Kleckner
a984fc7c9a [MC] Handle discardable COFF sections in assembly
Summary:
This fixes a dumpbin warning on objects produced by the MC assembler
when starting from text. All .debug$S sections are supposed to be marked
IMAGE_SCN_MEM_DISCARDABLE. The main, non-COMDAT .debug$S section had
this set, but any comdat ones were not being marked discardable because
there was no .section flag for it.

This change does two things:

- If the section name starts with .debug, implicitly mark the section as
  discardable. This means we do the same thing as gas on .s files with
  DWARF from GCC, which is important.

- Adds the 'D' flag to the .section directive on COFF to explicitly say
  a section is discardable. We only emit this flag if the section name
  does not start with .debug. This allows the user to explicitly tweak
  their section flags without worrying about magic section names.

The only thing you can't do in this scheme is to create a
non-discardable section with a name starting with ".debug", but
hopefully users don't need that.

Reviewers: majnemer, rafael

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281554 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 22:41:50 +00:00
Mehdi Amini
a364825f51 Fix auto-upgrade of TBAA tags in Bitcode Reader
If TBAA is on an intrinsic and it gets upgraded, it'll delete the call
instruction that we collected in a vector. Even if we were to use
WeakVH, it'll drop the TBAA and we'll hit the assert on the upgrade
path.

r263673 gave a shot to make sure the TBAA upgrade happens before
intrinsics upgrade, but failed to account for all cases.

Instead of collecting instructions in a vector, this patch makes it
just upgrade the TBAA on the fly, because metadata are always
already loaded at this point.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281549 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 22:29:59 +00:00
Reid Kleckner
86a6238dca Fix indentation in codeview code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281542 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 21:49:21 +00:00