Commit Graph

245501 Commits

Author SHA1 Message Date
Geoff Berry 91e9a5cc23 [EarlyCSE] Make MemorySSA memory dependency check more aggressive.
Now that MemorySSA keeps track of whether MemoryUses are optimized, use
getClobberingMemoryAccess() to check MemoryUse memory dependencies since
it should no longer be so expensive.

This is a follow-up change to https://reviews.llvm.org/D25881

llvm-svn: 285080
2016-10-25 16:18:47 +00:00
Rafael Espindola 58139d1758 Delete getSectionHdr.
We were fairly inconsistent as to what information should be accessed
with getSectionHdr and what information (like alignment) was stored
elsewhere.

Now all section info has a dedicated getter. The code is also a bit
more compact.

llvm-svn: 285079
2016-10-25 16:14:25 +00:00
Sanjay Patel e3de152530 fix formatting; NFC
llvm-svn: 285078
2016-10-25 16:12:31 +00:00
Ulrich Weigand 7bdb485e18 [SystemZ] Do not use LOC(G) for volatile loads
It is not safe to use LOAD ON CONDITION to implement access to a memory
location marked "volatile", since the architecture leaves it unspecified
whether or not an access happens if the condition is false.

The current code already appears to care about that:
  def LOC  : CondUnaryRSY<"loc",  0xEBF2, nonvolatile_load, GR32, 4>;

Unfortunately, that "nonvolatile_load" operator is simply ignored
by the CondUnaryRSY class, and there was no test to catch it.

llvm-svn: 285077
2016-10-25 15:39:15 +00:00
Michal Gorny 91cc4a6503 [Driver] Disable OpenSUSE rules for OpenSUSE/SLES 10 and older
Disable the OpenSUSE rules for OpenSUSE versions older than 11 as they
are incompatible with the old binutils on that distribution.

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

llvm-svn: 285076
2016-10-25 15:33:32 +00:00
Sanjay Patel d59f7f9047 [InstCombine] add test and code comment to show potentially misguided icmp trunc transform
llvm-svn: 285075
2016-10-25 15:16:39 +00:00
Michal Gorny bd449c27d5 [Driver] Support obtaining active toolchain from gcc-config on Gentoo
Support using gcc-config to determine the correct GCC toolchain location
on Gentoo. In order to do that, attempt to read gcc-config configuration
form [[sysroot]]/etc/env.d/gcc, if no custom toolchain location is
provided.

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

llvm-svn: 285074
2016-10-25 15:07:41 +00:00
Saleem Abdulrasool 9ccc7ad62d CodeGen: mark protocols as common data
This allows for the coalescing of the protocol declarations.  When the protocols
are declared in headers, multiple definitions of the protocol would be emitted.
Marking them as common data indicates that any one can be selected.

llvm-svn: 285073
2016-10-25 14:50:44 +00:00
Simon Pilgrim 5c3c9707c3 [X86][SSE] Add support for (V)PMOVSX* constant folding
We already have (V)PMOVZX* combining support, this is the beginning of handling (V)PMOVSX* similarly - other combines in combineVSZext can be generalized in future patches.

This unearthed an interesting bug in that we were generating illegal build vectors on 32-bit targets - it was proving difficult to create a test for it from PMOVZX, but it fired immediately with PMOVSX. I've created a more general form of the existing getConstVector to handle these cases - ideally this should be handled in non-target-specific code but I couldn't find an equivalent.

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

llvm-svn: 285072
2016-10-25 14:29:25 +00:00
Michael Kruse 426e6f71f8 [ScopInfo] Fix: use raw source pointer.
When adding an llvm.memcpy instruction to AliasSetTracker, it uses the raw
source and target pointers which preserve bitcasts.
MemAccInst::getPointerOperand() also returns the raw target pointers, but
Scop::buildAliasGroups() did not for the source pointer. This lead to mismatches
between AliasSetTracker and ScopInfo on which pointer to use.

Fixed by also using raw pointers in Scop::buildAliasGroups().

llvm-svn: 285071
2016-10-25 13:37:43 +00:00
Sanjay Patel 62fbfe4e21 [InstCombine] fix checks for previous commit (r285069)
Accidentally put in the hoped-for checks ahead of the transform!

llvm-svn: 285070
2016-10-25 13:30:19 +00:00
Sanjay Patel 97beffe037 [InstCombine] add tests for bitcast interference with min/max (PR28001)
llvm-svn: 285069
2016-10-25 13:27:56 +00:00
Pavel Labath e7dd397209 Revert "Improve the libstdc++ smart pointer formatters"
This reverts commit r284828, as it causes an infinite loop in
TestPrintStackTraces (funnily enough, only when logging is enabled).

llvm-svn: 285068
2016-10-25 13:24:53 +00:00
Simon Pilgrim be1d49a508 Fix MSVC unused variable warning.
LLVM_ATTRIBUTE_UNUSED doesn't work for non-gcc style compilers.

llvm-svn: 285067
2016-10-25 12:59:15 +00:00
Kelvin Li 4e325f77a9 Re-apply patch r279045.
llvm-svn: 285066
2016-10-25 12:50:55 +00:00
Benjamin Kramer 7dc585763e Fix diagnostic format string for err_os_log_argument_to_big
Patch by Sam McCall, test case by me.

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

llvm-svn: 285065
2016-10-25 12:39:28 +00:00
Rafael Espindola 20aa1779d0 fix warning
llvm-svn: 285064
2016-10-25 12:28:26 +00:00
Zvi Rackover 124470a202 [DAGCombine] Preserve shuffles when one of the vector operands is constant
Summary:
Do *not* perform combines such as:

    vector_shuffle<4,1,2,3>(build_vector(Ud, C0, C1 C2), scalar_to_vector(X))
    ->
    build_vector(X, C0, C1, C2)

Keeping the shuffle allows lowering the constant build_vector to a materialized
constant vector (such as a vector-load from the constant-pool or some other idiom).

Reviewers: delena, igorb, spatel, mkuper, andreadb, RKSimon

Subscribers: llvm-commits

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

llvm-svn: 285063
2016-10-25 12:14:19 +00:00
Rafael Espindola 3db70210f8 Update for llvm change.
llvm-svn: 285062
2016-10-25 12:02:31 +00:00
Rafael Espindola 7912110ddc Make the LTO comdat api more symbol table friendly.
In an IR symbol table I would expect the comdats to be represented as:

- A table of strings, one for each comdat name.
- Each symbol has an optional index into that table.

The natural api for accessing that would be

InputFile:
ArrayRef<StringRef> getComdatTable() const;

Symbol:
int getComdatIndex() const;

This patch implements an API as close to that as possible.  The
implementation on top of the current IRObjectFile is a bit hackish,
but should map just fine over a symbol table and is very convenient to
use.

llvm-svn: 285061
2016-10-25 12:02:03 +00:00
Manuel Klimek 63c6989d70 include-fixer: Don't overwrite buffer changes
Raise a signal if the buffer has been modified before replacing it, to
avoid overwriting users' changes.

Patch by Philipp Stephani.

llvm-svn: 285060
2016-10-25 11:31:22 +00:00
Manuel Klimek 8e5f5ff4c1 Load clang-include-fixer.el from the unit test suite so that the unit tests can run in batch mode.
Patch by Philipp Stephani.

llvm-svn: 285059
2016-10-25 11:30:28 +00:00
Erik Verbruggen 45449548c2 Include full filename range for missing includes
For the purpose of highlighting in an IDE.

llvm-svn: 285057
2016-10-25 10:13:10 +00:00
Erik Verbruggen 490823746a Fix 'unknown documentation command' warning ranges
Warnings generated by -Wdocumentation-unknown-command did only have a
start location, not a full source range. This resulted in only the
"carret" being show in messages, and IDEs highlighting only the single
initial character.

llvm-svn: 285056
2016-10-25 10:06:11 +00:00
Benjamin Kramer 7df3043db3 Fix an unused warning in WebAssemblyInstPrinter with NDEBUG.
Patch by Sam McCall!

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

llvm-svn: 285055
2016-10-25 09:08:50 +00:00
Michael Zuckerman facb37cabf [X86][AVX512][Clang][Intrinsics][reduce] Adding missing reduce (Operators: +,*,&&,||) intrinsics to Clang
Committed after LGTM and check-all

 
Vector-reduction arithmetic accepts vectors as inputs and produces scalars as outputs.
This class of vector operation forms the basis of many scientific computations.
In vector-reduction arithmetic, the evaluation off is independent of the order of the input elements of V.
 
Used bisection method. At each step, we partition the vector with previous
step in half, and the operation is performed on its two halves.
This takes log2(n) steps where n is the number of elements in the vector.
 
Reviwer: 1. igorb
         2. craig.topper    
Differential Revision: https://reviews.llvm.org/D25527

llvm-svn: 285054
2016-10-25 07:56:04 +00:00
Craig Topper 01e4667e02 [AVX-512] Add support for creating SIGN_EXTEND_VECTOR_INREG and ZERO_EXTEND_VECTOR_INREG for 512-bit vectors to support vpmovzxbq and vpmovsxbq.
Summary: The one tricky thing about this is that the sign/zero_extend_inreg uses v64i8 as an input type which isn't legal without BWI support. Though the vpmovsxbq and vpmovzxbq instructions themselves don't require BWI. To support this we need to add custom lowering for ZERO_EXTEND_VECTOR_INREG with v64i8 input. This can mostly reuse the existing sign extend code with a couple checks for sign extend vs zero extend added.

Reviewers: delena, RKSimon

Subscribers: llvm-commits

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

llvm-svn: 285053
2016-10-25 04:00:29 +00:00
Peter Collingbourne 4f3b2df9bb GlobalDCE: Restore a statement accidentally removed in r285048.
llvm-svn: 285052
2016-10-25 02:57:27 +00:00
Matthias Braun c8440dddb2 MachineInstrBundle: Pass iterators to getBundle(Start|End); NFC
This is a function to go backwards in a block to find the first
instruction in a bundle, so iterator is a more natural choice for
parameter/return rather than a reference to a MachineInstruction.

llvm-svn: 285051
2016-10-25 02:55:17 +00:00
Peter Collingbourne ca7664e761 IR: Deduplicate getParent() functions on derived classes of GlobalValue into the base class. NFCI.
llvm-svn: 285050
2016-10-25 02:54:08 +00:00
Kostya Serebryany 3364f90783 [libFuzzer] simplify the code for use_cmp, also use the position hint when available, add a test
llvm-svn: 285049
2016-10-25 02:04:43 +00:00
Peter Collingbourne 7695cb6da8 GlobalDCE: Deduplicate code. NFCI.
llvm-svn: 285048
2016-10-25 01:58:26 +00:00
Mehdi Amini 9825ab0433 Fix handling of %% format specifier in os_log builtins.
Returning `false` was stopping the parsing of further arguments,
which wasn't intended.

llvm-svn: 285047
2016-10-25 00:48:48 +00:00
Sanjay Patel 02be063351 [InstCombine] auto-generate checks
llvm-svn: 285046
2016-10-25 00:44:02 +00:00
Sanjay Patel 5cff621dce [InstCombine] auto-generate checks
llvm-svn: 285045
2016-10-25 00:41:00 +00:00
Dan Gohman 48abaa9c74 [WebAssembly] Reorder load/store operands to match binary encoding.
The p2align operand of a load/store is encoded before the offset
operand; reorder the MachineInstr operands accordingly.

llvm-svn: 285044
2016-10-25 00:17:11 +00:00
Vedant Kumar 5c61c70387 [llvm-cov] Do not print out the filename of the object file
When we load coverage data from multiple objects, we don't have a way to
attribute a source object to a function record. Printing out the object
filename next to the source filename is already not very useful: soon,
it'll actually become misleading. Stop printing out the filename now.

llvm-svn: 285043
2016-10-25 00:08:33 +00:00
Mehdi Amini 566a51d193 Add dependency from clangCodeGen to clangAnalysis
This is unbreaking the build with shared library after r285019.

llvm-svn: 285042
2016-10-24 23:38:32 +00:00
Mehdi Amini ebff247d41 test/CodeGen/builtins.c: reinstate #ifdef __x86_64__ around __builtin_longjmp
Unadvertently removed in r285019

llvm-svn: 285041
2016-10-24 23:38:24 +00:00
Dan Gohman 3acb187d95 [WebAssembly] Implement more WebAssembly binary encoding.
This changes locals from being declared by the emitLocal hook in
WebAssemblyTargetStreamer, rather than with an instruction. After exploring
the infastructure in LLVM more, this seems to make more sense since
declaring locals doesn't use an encoded opcode.

This also adds more 0xd opcodes, type encodings, and miscellaneous
binary encoding bits.

llvm-svn: 285040
2016-10-24 23:27:49 +00:00
Matthias Braun 8b38ffaa98 CodeGen/Passes: Pass MachineFunction as functor arg; NFC
Passing a MachineFunction as argument is more natural and avoids an
unnecessary round-trip through the logic determining the correct
Subtarget because MachineFunction already has a reference anyway.

llvm-svn: 285039
2016-10-24 23:23:02 +00:00
Petr Hosek 9834fcd7ce [Basic] Support 32-bit x86 and ARM targets for Fuchsia
Fuchsia has experimental support for 32-bit x86 and ARM targets, add
them to the list of supported targets.

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

llvm-svn: 285038
2016-10-24 22:55:57 +00:00
Artem Belevich 3d0b39a3dd Link clangCodeGen with clangAnalysis required after r284990.
Fixes build break for configurations that use shared libraries.

llvm-svn: 285037
2016-10-24 22:52:39 +00:00
Sanjay Patel 60f80d7a8b [InstCombine] regenerate some checks
llvm-svn: 285036
2016-10-24 22:50:26 +00:00
Justin Bogner b63109944d cmake: Rename installhdrs to install-llvm-headers and fix the dependencies
The installhdrs target was inconsistently named and would behave
differently depending on whether or not you ran a build first. This
renames it to install-llvm-headers to match other target names and
adds a dependency on intrinsics_gen so that it will always install the
same set of things.

llvm-svn: 285035
2016-10-24 21:58:58 +00:00
Eli Friedman c5b7262073 Fix regression from my recent GlobalsAA fix.
There are two fixes here: one, AnalyzeUsesOfPointer can't return
false until it has checked all the uses of the pointer. Two, if a
global uses another global, we have to assume the address of the
first global escapes.

Fixes https://llvm.org/bugs/show_bug.cgi?id=30707 .

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

llvm-svn: 285034
2016-10-24 21:47:44 +00:00
Simon Pilgrim e3e6585c2d [SelectionDAG] Update ComputeNumSignBits SRA/SHL handlers to accept scalar or vector splats
Use isConstOrConstSplat helper.

Also use APInt instead of getZExtValue directly to avoid out of range issues.

llvm-svn: 285033
2016-10-24 21:47:19 +00:00
Todd Fiala 409252fcef remove xfail from TestObjCNewSyntax.py test_expr_gmodules()
Fixes:
rdar://27792848

llvm-svn: 285032
2016-10-24 21:46:46 +00:00
Akira Hatanaka c81708e6ec [Sema][ObjC] Warn about implicitly autoreleasing out-parameters captured
by blocks.

Add a new warning "-Wblock-capture-autoreleasing". The warning warns
about implicitly autoreleasing out-parameters captured by blocks which
can introduce use-after-free bugs that are hard to debug.

rdar://problem/15377548

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

llvm-svn: 285031
2016-10-24 21:45:54 +00:00
Justin Bogner 51c6d93fed cmake: Make /usr/share/cmake installable with LLVM_DISTRIBUTION_COMPONENTS
Add a cmake-exports install component and appropriate targets for
LLVM_DISTRIBUTION_COMPONENTS to work with.

llvm-svn: 285030
2016-10-24 21:40:15 +00:00