138479 Commits

Author SHA1 Message Date
James Molloy
d95bddac05 [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.

It also contains fixes for emitting .text relocations which made the sanitizer
bots unhappy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281715 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-16 10:17:04 +00:00
Eric Christopher
88a23b6016 Move the Mangler from the AsmPrinter down to TLOF and clean up the
TLOF API accordingly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281708 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-16 07:33:15 +00:00
Eric Christopher
2ce67fb75a Remove unused function getMang().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281707 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-16 07:32:58 +00:00
Justin Lebar
c53e38407d [CUDA] [doc] Note that you can use std::min/max from device code with C++14.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281702 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-16 04:14:02 +00:00
David Majnemer
281351cb07 Add a test for r280191
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281694 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-16 02:43:36 +00:00
Vitaly Buka
d26bf22afc Revert "[asan] Avoid lifetime analysis for allocas with can be in ambiguous state"
This approach is not good enough. Working on the new solution.

This reverts commit r280907.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281689 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-16 01:38:46 +00:00
Vitaly Buka
1354d58f56 Revert "[asan] Add flag to allow lifetime analysis of problematic allocas"
This approach is not good enough. Working on the new solution.

This reverts commit r281126.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281688 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-16 01:38:43 +00:00
Mehdi Amini
ff48266144 Fix autoupgrade logic for Objective-C class properties module flag
Previous we were issuing an error when linking a module containing
the new Objective-C metadata structure for class properties with an
"old" one.
Now instead we downgrade the module flag so that the Objective-C
runtime does not expect the new metadata structure.

This is consistent with what ld64 is doing on binary files.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281685 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-16 00:38:18 +00:00
Hans Wennborg
837806b92c build_llvm_package.bat: Update to VS2015 and include LLDB
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281676 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 23:01:03 +00:00
Sanjay Patel
f094f6229a [InstCombine] move folds for icmp (sh C2, Y), C1 in with other icmp+sh folds; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281672 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 22:26:31 +00:00
Kostya Serebryany
dcc5ba2671 [libFuzzer] make caller-callee feedback work with trace-pc-guard
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281667 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 22:16:15 +00:00
Kostya Serebryany
31daa34b7b [sanitizer-coverage] make trace-pc-guard and indirect-call work together
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281665 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 22:11:08 +00:00
Reid Kleckner
8f94ffd054 [codeview] Optimize the size of defranges with gaps
For small, discontiguous local variable regions, CodeView can use a
single defrange record with a gap, rather than having two defrange
records. I expect that this optimization will only have a minor impact
on debug info size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281664 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 22:05:08 +00:00
Sanjay Patel
ea886051fe [InstCombine] allow icmp (shr/shl) folds for vectors
These 2 helper functions were already using APInt internally, so just
change the API and caller to allow folds for splats. The scalar
regression tests look quite thorough, so I just added a couple of
tests to prove that vectors are handled too.

These folds should be grouped with the other cmp+shift folds though.
That can be an NFC follow-up.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281663 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 21:35:30 +00:00
Sanjay Patel
539a6563ca regenerate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281655 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 20:39:01 +00:00
Mehdi Amini
12be25f90c [GlobalOpt] Dead Eliminate declarations
GlobalOpt is already dead-code-eliminating global definitions. With
this change it also takes care of declarations.
Hopefully this should make it now a strict superset of GlobalDCE.
This is important for LTO/ThinLTO as we don't want the linker to see
"undefined reference" when it processes the input files: it could
prevent proper internalization (or even load an extra file from a
static archive, changing the behavior of the program!).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281653 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 20:26:27 +00:00
David Majnemer
26eccc1ec7 [InstCombine] Do not RAUW a constant GEP
canRewriteGEPAsOffset expects to process instructions, not constants.

This fixes PR30342.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281650 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 20:10:09 +00:00
Evandro Menezes
a5437a6d55 [AArch64] Support for FP FMA when -ffp-contract=fast
Currently, the machine combiner can proceed matching when -ffast-math is on.
It should also match when only -ffp-contract=fast is specified as was the
case before when DAGCombiner was doing the job.

Patch by: Abderrazek Zaafrani <a.zaafrani@samsung.com>.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281649 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 19:55:23 +00:00
Evgeniy Stepanov
745df3296d Revert "[ARM] Promote small global constants to constant pools"
This reverts r281604, which adds text relocations to ARM binaries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281645 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 19:13:32 +00:00
Sanjay Patel
71d3c34146 [InstCombine] simplify code; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281644 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 19:04:55 +00:00
Sriraman Tallam
f31e663570 [PM] Port CFGViewer and CFGPrinter to the new Pass Manager
Differential Revision: https://reviews.llvm.org/D24592

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281640 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 18:35:27 +00:00
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