OSDN Git Service

android-x86/external-llvm.git
7 years ago[PDB] It is not an error getting the "Invalid" Annotation opcode.
Zachary Turner [Fri, 17 Mar 2017 00:15:27 +0000 (00:15 +0000)]
[PDB] It is not an error getting the "Invalid" Annotation opcode.

The linker can insert invalid opcodes to indicate padding
bytes, and we should not fail in this case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298016 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoclean Lanai namespace
Jacques Pienaar [Thu, 16 Mar 2017 23:22:10 +0000 (23:22 +0000)]
clean Lanai namespace

Summary: This patch cleans the namespace of the Lanai target.

Reviewers: jpienaar

Reviewed By: jpienaar

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298015 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix unit test.
Zachary Turner [Thu, 16 Mar 2017 23:19:40 +0000 (23:19 +0000)]
Fix unit test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298014 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRemove getArgumentList() in favor of arg_begin(), args(), etc
Reid Kleckner [Thu, 16 Mar 2017 22:59:15 +0000 (22:59 +0000)]
Remove getArgumentList() in favor of arg_begin(), args(), etc

Users often call getArgumentList().size(), which is a linear way to get
the number of function arguments. arg_size(), on the other hand, is
constant time.

In general, the fact that arguments are stored in an iplist is an
implementation detail, so I've removed it from the Function interface
and moved all other users to the argument container APIs (arg_begin(),
arg_end(), args(), arg_size()).

Reviewed By: chandlerc

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298010 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRemove dead F parameter from Argument constructor
Reid Kleckner [Thu, 16 Mar 2017 22:58:56 +0000 (22:58 +0000)]
Remove dead F parameter from Argument constructor

When Function creates its argument list, it does the ilist push_back
itself. No other caller passes in a parent function, so this is dead,
and it uses the soon-to-be-deleted getArgumentList accessor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298009 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix linux build.
Zachary Turner [Thu, 16 Mar 2017 22:34:18 +0000 (22:34 +0000)]
Fix linux build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298007 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoMake NativeExeSymbol a concrete subclass of NativeRawSymbol [PDB]
Adrian McCarthy [Thu, 16 Mar 2017 22:28:39 +0000 (22:28 +0000)]
Make NativeExeSymbol a concrete subclass of NativeRawSymbol [PDB]

This moves exe symbol-specific method implementations out of NativeRawSymbol
into a concrete subclass. Also adds implementations for hasCTypes and
hasPrivateSymbols and a simple test to ensure the native reader can access
the summary information for the executable from the PDB.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298005 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Support] Support both Windows and Posix paths on both platforms.
Zachary Turner [Thu, 16 Mar 2017 22:28:04 +0000 (22:28 +0000)]
[Support] Support both Windows and Posix paths on both platforms.

Previously which path syntax we supported dependend on what
platform we were compiling LLVM on.  While this is normally
desirable, there are situations where we need to be able to
handle a path that we know was generated on a remote host.
Remote debugging, for example, or parsing debug info.

99% of the code in LLVM for handling paths was platform
agnostic and literally just a few branches were gated behind
pre-processor checks, so this changes those sites to use
runtime checks instead, and adds a flag to every path
API that allows one to override the host native syntax.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298004 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoMake Argument::getArgNo() constant time, not O(#args)
Reid Kleckner [Thu, 16 Mar 2017 22:25:45 +0000 (22:25 +0000)]
Make Argument::getArgNo() constant time, not O(#args)

getArgNo is actually hot in LLVM, because its how we check for
attributes on arguments:
  bool Argument::hasNonNullAttr() const {
    if (!getType()->isPointerTy()) return false;
    if (getParent()->getAttributes().
          hasAttribute(getArgNo()+1, Attribute::NonNull))
      return true;

It actually shows up as the 23rd hottest leaf function in a 13s sample
of LTO of llc.

This grows Argument by four bytes, but I have another pending patch to
shrink it by removing its ilist_node base.

Reviewed By: chandlerc

Subscribers: inglorion, llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298003 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRemove eol-style:native from Path.h
Zachary Turner [Thu, 16 Mar 2017 22:24:19 +0000 (22:24 +0000)]
Remove eol-style:native from Path.h

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298002 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoCodeGen: BlockPlacement: Adjust test case so it covers rL297925. NFC
Kyle Butt [Thu, 16 Mar 2017 21:33:29 +0000 (21:33 +0000)]
CodeGen: BlockPlacement: Adjust test case so it covers rL297925. NFC

I had ajusted the test case before when testing a chain of length 2, and then
reverted it with rL296845 when I switched to 3 triangles. After running
benchmarks and examining generated code at length 2 I forgot to put the test
back.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298000 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoResubmit r297897: [PGO] Value profile for size of memory intrinsic calls
Rong Xu [Thu, 16 Mar 2017 21:15:48 +0000 (21:15 +0000)]
Resubmit r297897: [PGO] Value profile for size of memory intrinsic calls

R297897 inadvertently enabled annotation for memop profiling. This new patch
fixed it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297996 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoSalvage debug info from instructions about to be deleted
Adrian Prantl [Thu, 16 Mar 2017 21:14:09 +0000 (21:14 +0000)]
Salvage debug info from instructions about to be deleted

[Reapplies r297971 and punting on finding a better API for findDbgValues()]

This patch improves debug info quality in InstCombine by looking at
values that are about to be deleted, checking whether there are any
dbg.value instrinsics referring to them, and potentially encoding the
semantics of the deleted instruction into the dbg.value's
DIExpression.

In the example in the testcase (which was extracted from XNU) there is a sequence of

 %4 = load %struct.entry*, %struct.entry** %next2, align 8, !dbg !41
 %5 = bitcast %struct.entry* %4 to i8*, !dbg !42
 %add.ptr4 = getelementptr inbounds i8, i8* %5, i64 -8, !dbg !43
 %6 = bitcast i8* %add.ptr4 to %struct.entry*, !dbg !44
 call void @llvm.dbg.value(metadata %struct.entry* %6, i64 0, metadata !20, metadata !21), !dbg 34

When these instructions are eliminated by instcombine one after
another, we can still salvage the otherwise dead debug info:

- Bitcasts have no effect, so have the dbg.value point to operand(0)
- Loads can be expressed via a DW_OP_deref
- Constant gep instructions can be replaced by DWARF expression arithmetic

The API introduced by this patch is not specific to instcombine and
can be useful in other places, too.

rdar://problem/30725338

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297994 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[LoopUnroll] Don't peel loops where the latch isn't the exiting block
Michael Kuperstein [Thu, 16 Mar 2017 21:07:48 +0000 (21:07 +0000)]
[LoopUnroll] Don't peel loops where the latch isn't the exiting block

Peeling assumed this doesn't happen, but didn't check it.
This fixes PR32178.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297993 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[SCEV] Compute affine range in another way to avoid bitwidth extending.
Michael Zolotukhin [Thu, 16 Mar 2017 21:07:38 +0000 (21:07 +0000)]
[SCEV] Compute affine range in another way to avoid bitwidth extending.

Summary:
This approach has two major advantages over the existing one:
1. We don't need to extend bitwidth in our computations. Extending
bitwidth is a big issue for compile time as we often end up working with
APInts wider than 64bit, which is a slow case for APInt.
2. When we zero extend a wrapped range, we lose some information (we
replace the range with [0, 1 << src bit width)). Thus, avoiding such
extensions better preserves information.

Correctness testing:
I ran 'ninja check' with assertions that the new implementation of
getRangeForAffineAR gives the same results as the old one (this
functionality is not present in this patch). There were several failures
- I inspected them manually and found out that they all are caused by
the fact that we're returning more accurate results now (see bullet (2)
above).
Without such assertions 'ninja check' works just fine, as well as
SPEC2006.

Compile time testing:
CTMark/Os:
 - mafft/pairlocalalign -16.98%
 - tramp3d-v4/tramp3d-v4 -12.72%
 - lencod/lencod -11.51%
 - Bullet/bullet -4.36%
 - ClamAV/clamscan -3.66%
 - 7zip/7zip-benchmark -3.19%
 - sqlite3/sqlite3 -2.95%
 - SPASS/SPASS -2.74%
 - Average -5.81%

Performance testing:
The changes are expected to be neutral for runtime performance.

Reviewers: sanjoy, atrick, pete

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297992 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[WebAssembly] Fix some broken type encodings in wasm binary
Derek Schuff [Thu, 16 Mar 2017 20:49:48 +0000 (20:49 +0000)]
[WebAssembly] Fix some broken type encodings in wasm binary

A recent change switch the in-memory wasm value types
to be signed integers, but I missing a few cases where
these were being writing to the binary.

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

Patch by Sam Clegg

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297991 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoSilence -Wcovered-switch-default warning.
Zachary Turner [Thu, 16 Mar 2017 20:45:11 +0000 (20:45 +0000)]
Silence -Wcovered-switch-default warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297990 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[InstCombine] avoid breaking up bitcasted vector min/max patterns (PR32306)
Sanjay Patel [Thu, 16 Mar 2017 20:42:45 +0000 (20:42 +0000)]
[InstCombine] avoid breaking up bitcasted vector min/max patterns (PR32306)

As the related tests show, we're not canonicalizing to this form for scalars or vectors yet,
but this solves the immediate problem in:
https://bugs.llvm.org/show_bug.cgi?id=32306

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297989 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoClarify a comment about mapped_iterator. NFC
Jonathan Roelofs [Thu, 16 Mar 2017 20:37:59 +0000 (20:37 +0000)]
Clarify a comment about mapped_iterator. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297988 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoArchiveWriter: Remove unused variables. NFC.
Peter Collingbourne [Thu, 16 Mar 2017 20:35:07 +0000 (20:35 +0000)]
ArchiveWriter: Remove unused variables. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297987 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[InstCombine] add tests for PR32306 and missed min/max canonicalization; NFC
Sanjay Patel [Thu, 16 Mar 2017 20:31:38 +0000 (20:31 +0000)]
[InstCombine] add tests for PR32306 and missed min/max canonicalization; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297986 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoCreate msbuild only when using MSVC
Reid Kleckner [Thu, 16 Mar 2017 20:24:14 +0000 (20:24 +0000)]
Create msbuild only when using MSVC

Summary:
I could be wrong but it seems to have no use for MinGW.

Related diff: https://reviews.llvm.org/D29772

Reviewers: chandlerc, rnk

Reviewed By: rnk

Patch by: Mateusz MikuĊ‚a

Subscribers: rnk, llvm-commits, mgorny

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297985 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[PDB] Add support for parsing Flags from PDB Stream.
Zachary Turner [Thu, 16 Mar 2017 20:19:11 +0000 (20:19 +0000)]
[PDB] Add support for parsing Flags from PDB Stream.

This was discovered when running `llvm-pdbdump diff` against
two files, the second of which was generated by running the
first one through pdb2yaml and then yaml2pdb.

The second one was missing some bytes from the PDB Stream, and
tracking this down showed that at the end of the PDB Stream were
some additional bytes that we were ignoring.  Looking back
to the reference code, these seem to specify some additional
flags that indicate whether the PDB supports various optional
features.

This patch adds support for reading, writing, and round-tripping
these flags through YAML and the raw dumper, and updates the
tests accordingly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297984 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[llvm-pdbdump] Add support for diffing the PDB Stream.
Zachary Turner [Thu, 16 Mar 2017 20:18:41 +0000 (20:18 +0000)]
[llvm-pdbdump] Add support for diffing the PDB Stream.

In doing so I discovered that we completely ignore some bytes
of the PDB Stream after we "finish" loading it.  These bytes
seem to specify some additional information about what kind
of data is present in the PDB.  A subsequent patch will add
code to read in those fields and store their values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297983 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert commit r297971 because of issues reported by msan.
Adrian Prantl [Thu, 16 Mar 2017 20:11:54 +0000 (20:11 +0000)]
Revert commit r297971 because of issues reported by msan.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297982 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoTargetInstrInfo: Provide default implementation of isTailCall().
Matthias Braun [Thu, 16 Mar 2017 20:02:30 +0000 (20:02 +0000)]
TargetInstrInfo: Provide default implementation of isTailCall().

In fact this default implementation should be the only implementation,
keep it virtual for now to accomodate targets that don't model flags
correctly.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297980 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[globalisel] Correct one more simple immediate that should be a ConstantInt.
Daniel Sanders [Thu, 16 Mar 2017 19:59:19 +0000 (19:59 +0000)]
[globalisel] Correct one more simple immediate that should be a ConstantInt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297979 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AVX-512] Add tests for kandn, kor, kxor, and kxnor intrinsics.
Craig Topper [Thu, 16 Mar 2017 19:58:06 +0000 (19:58 +0000)]
[AVX-512] Add tests for kandn, kor, kxor, and kxnor intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297978 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[llvm-pdbdump] clang-format Diff.cpp
Zachary Turner [Thu, 16 Mar 2017 19:52:15 +0000 (19:52 +0000)]
[llvm-pdbdump] clang-format Diff.cpp

Looks like this file did not have clang-format run on
it when its initial revision was committed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297977 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRemove redundant conditions (PR31753). NFCI.
Simon Pilgrim [Thu, 16 Mar 2017 19:52:00 +0000 (19:52 +0000)]
Remove redundant conditions (PR31753). NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297976 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix unused variable warnings.
Adrian Prantl [Thu, 16 Mar 2017 18:33:01 +0000 (18:33 +0000)]
Fix unused variable warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297973 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoSalvage debug info from instructions about to be deleted
Adrian Prantl [Thu, 16 Mar 2017 18:22:52 +0000 (18:22 +0000)]
Salvage debug info from instructions about to be deleted

This patch improves debug info quality in InstCombine by looking at
values that are about to be deleted, checking whether there are any
dbg.value instrinsics referring to them, and potentially encoding the
semantics of the deleted instruction into the dbg.value's
DIExpression.

In the example in the testcase (which was extracted from XNU) there is a sequence of

  %4 = load %struct.entry*, %struct.entry** %next2, align 8, !dbg !41
  %5 = bitcast %struct.entry* %4 to i8*, !dbg !42
  %add.ptr4 = getelementptr inbounds i8, i8* %5, i64 -8, !dbg !43
  %6 = bitcast i8* %add.ptr4 to %struct.entry*, !dbg !44
  call void @llvm.dbg.value(metadata %struct.entry* %6, i64 0, metadata !20, metadata !21), !dbg 34

When these instructions are eliminated by instcombine one after
another, we can still salvage the otherwise dead debug info:

- Bitcasts have no effect, so have the dbg.value point to operand(0)
- Loads can be expressed via a DW_OP_deref
- Constant gep instructions can be replaced by DWARF expression arithmetic

The API introduced by this patch is not specific to instcombine and
can be useful in other places, too.

rdar://problem/30725338

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297971 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoLTO: Create temporary cache files in the cache directory instead of $TMPDIR.
Peter Collingbourne [Thu, 16 Mar 2017 18:20:06 +0000 (18:20 +0000)]
LTO: Create temporary cache files in the cache directory instead of $TMPDIR.

This fixes a race condition where another linker process can observe a
partially written file if we copy it from another file system, and allows
the link to be independent of the amount of free disk space in $TMPDIR.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297970 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAttempt to fix bot failure on Windows.
Adrian Prantl [Thu, 16 Mar 2017 18:06:04 +0000 (18:06 +0000)]
Attempt to fix bot failure on Windows.
Looks like this expression was accidentally using 32-bit arithmetic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297969 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[globalisel] Correct G_CONSTANT path of selectArithImmed()
Daniel Sanders [Thu, 16 Mar 2017 18:04:50 +0000 (18:04 +0000)]
[globalisel] Correct G_CONSTANT path of selectArithImmed()

Earlier stages of GlobalISel always use ConstantInt in G_CONSTANT so that's
what we should check for.

This fixes a crash introduced in r297782.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297968 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRearrange fields. NFC.
Adrian Prantl [Thu, 16 Mar 2017 17:42:47 +0000 (17:42 +0000)]
Rearrange fields. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297967 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRename methods in DwarfExpression to adhere to the LLVM coding guidelines.
Adrian Prantl [Thu, 16 Mar 2017 17:42:45 +0000 (17:42 +0000)]
Rename methods in DwarfExpression to adhere to the LLVM coding guidelines.
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297966 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoPR32288: More efficient encoding for DWARF expr subregister access.
Adrian Prantl [Thu, 16 Mar 2017 17:14:56 +0000 (17:14 +0000)]
PR32288: More efficient encoding for DWARF expr subregister access.

Citing http://bugs.llvm.org/show_bug.cgi?id=32288

  The DWARF generated by LLVM includes this location:

  0x55 0x93 0x04 DW_OP_reg5 DW_OP_piece(4) When GCC's DWARF is simply
  0x55 (DW_OP_reg5) without the DW_OP_piece. I believe it's reasonable
  to assume the DWARF consumer knows which part of a register
  logically holds the value (low bytes, high bytes, how many bytes,
  etc) for a primitive value like an integer.

This patch gets rid of the redundant DW_OP_piece when a subregister is
at offset 0. It also adds previously missing subregister masking when
a subregister is followed by another operation.

(This reapplies r297960 with two additional testcase updates).

rdar://problem/31069390
https://reviews.llvm.org/D31010

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297965 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[cmake] Refactor warning flag logic to use Unix warnings with clang-cl
Reid Kleckner [Thu, 16 Mar 2017 17:05:16 +0000 (17:05 +0000)]
[cmake] Refactor warning flag logic to use Unix warnings with clang-cl

Summary:
clang-cl understands the GCC-style -W[no-]foo flags, and for the most
part ignores MSVC -wd flags. So, let's pass the curated set of warning
flags we use on Unix on Windows. We can also stop passing /W4 -wd*,
which for the most part corresponds to -Wall -Wextra with a bunch of
flags that we mostly ignore.

I had to disable -Wnon-virtual-dtor on Windows, because it fires on
every COM class ever. I filed PR32286 to fix this.

So far I've only found two instances of -Wstring-conversion in the
WinASan code, which I'll fix. Other than that we seem clean.

Reviewers: hans

Subscribers: mgorny, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297964 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[IR] Inline some Function accessors
Reid Kleckner [Thu, 16 Mar 2017 16:57:31 +0000 (16:57 +0000)]
[IR] Inline some Function accessors

I checked that all of these out-of-line methods previously compiled to
simple loads and bittests, so they are pretty good candidates for
inlining. In particular, arg_size() and arg_empty() are popular and are
just two loads, so they seem worth inlining.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297963 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert "PR32288: More efficient encoding for DWARF expr subregister access."
Adrian Prantl [Thu, 16 Mar 2017 16:38:22 +0000 (16:38 +0000)]
Revert "PR32288: More efficient encoding for DWARF expr subregister access."

This reverts commit 2bf453116889a576956892ea9683db4fcd96e30e while investigating buildbot breakage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297962 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoPR32288: More efficient encoding for DWARF expr subregister access.
Adrian Prantl [Thu, 16 Mar 2017 16:34:14 +0000 (16:34 +0000)]
PR32288: More efficient encoding for DWARF expr subregister access.

Citing http://bugs.llvm.org/show_bug.cgi?id=32288

  The DWARF generated by LLVM includes this location:

  0x55 0x93 0x04 DW_OP_reg5 DW_OP_piece(4) When GCC's DWARF is simply
  0x55 (DW_OP_reg5) without the DW_OP_piece. I believe it's reasonable
  to assume the DWARF consumer knows which part of a register
  logically holds the value (low bytes, high bytes, how many bytes,
  etc) for a primitive value like an integer.

This patch gets rid of the redundant DW_OP_piece when a subregister is
at offset 0. It also adds previously missing subregister masking when
a subregister is followed by another operation.

rdar://problem/31069390
https://reviews.llvm.org/D31010

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297960 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoTest commit.
Hiroshi Inoue [Thu, 16 Mar 2017 16:30:06 +0000 (16:30 +0000)]
Test commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297959 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AMDGPU] Run always inliner early in opt
Stanislav Mekhanoshin [Thu, 16 Mar 2017 16:11:46 +0000 (16:11 +0000)]
[AMDGPU] Run always inliner early in opt

We can mark functions to always inline early in the opt. Since we do not have
call support this early inlining creates opportunities for inter-procedural
optimizations which would not occur otherwise.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297958 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86] Add PR22338 test case
Simon Pilgrim [Thu, 16 Mar 2017 15:10:42 +0000 (15:10 +0000)]
[X86] Add PR22338 test case

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297957 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix: Refactor SimplifyCFG:canSinkInstructions [NFC]
Aditya Kumar [Thu, 16 Mar 2017 14:09:18 +0000 (14:09 +0000)]
Fix: Refactor SimplifyCFG:canSinkInstructions [NFC]

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297955 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[BasicTTIImpl] Bugfix in getIntrinsicInstrCost()
Jonas Paulsson [Thu, 16 Mar 2017 14:05:34 +0000 (14:05 +0000)]
[BasicTTIImpl] Bugfix in getIntrinsicInstrCost()

Don't call getScalarizationOverhead(RetTy, true, false) if RetTy is void type.

Review: Hal Finkel
https://reviews.llvm.org/D31024

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297954 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[InstCombine] Liberate assert in InstCombiner::visitZExt
Bjorn Pettersson [Thu, 16 Mar 2017 13:22:01 +0000 (13:22 +0000)]
[InstCombine] Liberate assert in InstCombiner::visitZExt

Summary:
The call to canEvaluateZExtd in InstCombiner::visitZExt may
return with BitsToClear == SrcTy->getScalarSizeInBits(), but
there is an assert that BitsToClear should be smaller than
SrcTy->getScalarSizeInBits().

I have a test case that triggers the assert, but it only happens
for my downstream target. I've not been able to trigger it for
any upstream target.

The assert triggered for a piece of code such as this
  %shr1 = lshr i16 undef, 15
  ...
  %shr2 = lshr i16 %shr1, 1
  %conv = zext i16 %shr2 to i32

Normally the lshr instructions are constant folded before we
visit the zext (that is why it is so hard to reproduce).
The original pattern, before instcombine, is of course a lot more
complicated in my test case. The shift count in the second lshr
is for example determined by the outcome of a PHI instruction.
It seems like other rewrites by instcombine leads up to
the pattern above. And then the zext is pulled from the
worklist, and visited (hitting the assert), before we detect
that the lshr instrucions can be constant folded.

Anyway, since the canEvaluateZExtd may return with BitsToClear
equal to SrcTy->getScalarSizeInBits(), and since the rewrite
that converts the expression type to avoid a zero extend works
also for the case where SrcBitsKept ends up being zero, then
it should be OK to liberate the assert to
  assert(BitsToClear <= SrcTy->getScalarSizeInBits() &&
         "Unreasonable BitsToClear");

Reviewers: hfinkel

Reviewed By: hfinkel

Subscribers: hfinkel, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297952 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert "[PGO] Value profile for size of memory intrinsic calls"
Eric Liu [Thu, 16 Mar 2017 13:16:35 +0000 (13:16 +0000)]
Revert "[PGO] Value profile for size of memory intrinsic calls"

This commit reverts r297897 and r297909.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297951 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Support] Add support for getting file system permissions on Windows and implement...
James Henderson [Thu, 16 Mar 2017 11:22:09 +0000 (11:22 +0000)]
[Support] Add support for getting file system permissions on Windows and implement sys::fs::set/getPermissions to work with them

This change adds support for functions to set and get file permissions, in a similar manner to the C++17 permissions() function in <filesystem>. The setter uses chmod on Unix systems and SetFileAttributes on Windows, setting the permissions as passed in. The getter simply uses the existing status() function.

Prior to this change, status() would always return an unknown value for the permissions on a Windows file, making it impossible to test the new function on Windows. I have therefore added support for this as well. On Linux, prior to this change, the permissions included the file type, which should actually be accessed via a different member of the file_status class.

Note that on Windows, only the *_write permission bits have any affect - if any are set, the file is writable, and if not, the file is read-only. This is in common with what MSDN describes for their behaviour of std::filesystem::permissions(), and also what boost::filesystem does.

The motivation behind this change is so that we can easily test behaviour on read-only files in LLVM unit tests, but I am sure that others may find it useful in some situations.

Reviewers: zturner, amccarth, aaron.ballman

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297945 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[PM/Inliner] Fix a bug in r297374 where we would leave stale calls in
Chandler Carruth [Thu, 16 Mar 2017 10:45:42 +0000 (10:45 +0000)]
[PM/Inliner] Fix a bug in r297374 where we would leave stale calls in
the work queue and crash when trying to visit them after deleting the
function containing those calls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297940 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[PM/Inliner] Add a test case that encapsulates the core issue addressed
Chandler Carruth [Thu, 16 Mar 2017 10:13:55 +0000 (10:13 +0000)]
[PM/Inliner] Add a test case that encapsulates the core issue addressed
in r297374.

I've extracted a small version of this from the C++ metaprogram Richard
came up with to exercise these kinds of issues and written comments to
describe both how to reproduce a fresh version of the test case and what
likely failure modes are.

The test case is still a bit brittle as it depends on the particular
inline cost modeling and SCC visitation order, but it definitely would
have caught the bug right away when developing things so it seems
a really valuable test case to have.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297935 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFixing typos.
Oren Ben Simhon [Thu, 16 Mar 2017 08:15:52 +0000 (08:15 +0000)]
Fixing typos.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297932 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[SelectionDAG] Optimize VSELECT->SETCC of incompatible or illegal types.
Jonas Paulsson [Thu, 16 Mar 2017 07:17:12 +0000 (07:17 +0000)]
[SelectionDAG]  Optimize VSELECT->SETCC of incompatible or illegal types.

Don't scalarize VSELECT->SETCC when operands/results needs to be widened,
or when the type of the SETCC operands are different from those of the VSELECT.

(VSELECT SETCC) and (VSELECT (AND/OR/XOR (SETCC,SETCC))) are handled.

The previous splitting of VSELECT->SETCC in DAGCombiner::visitVSELECT() is
no longer needed and has been removed.

Updated tests:

test/CodeGen/ARM/vuzp.ll
test/CodeGen/NVPTX/f16x2-instructions.ll
test/CodeGen/X86/2011-10-19-widen_vselect.ll
test/CodeGen/X86/2011-10-21-widen-cmp.ll
test/CodeGen/X86/psubus.ll
test/CodeGen/X86/vselect-pcmp.ll

Review: Eli Friedman, Simon Pilgrim
https://reviews.llvm.org/D29489

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297930 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ADCE] Remove redundent code [NFC]
Tobias Grosser [Thu, 16 Mar 2017 03:59:23 +0000 (03:59 +0000)]
[ADCE] Remove redundent code [NFC]

Summary:
In commit r289548 ([ADCE] Add code to remove dead branches) a redundant loop
nest was accidentally introduced, which implements exactly the same
functionality as has already been available right after. This redundancy has
been found when inspecting the ADCE code in the context of our recent
discussions on post-dominator modeling. This redundant code was also eliminated
by r296535 (which sparked the discussion), but only as part of a larger semantic
change of the post-dominance modeling. As this redundency in [ADCE] is really
just an oversight completely independent of the post-dominance changes under
discussion, we remove this redundancy independently.

Reviewers: dberlin, david2050

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297929 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix pessimising moves.
Peter Collingbourne [Thu, 16 Mar 2017 03:54:38 +0000 (03:54 +0000)]
Fix pessimising moves.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297928 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoSupport: Add a cache pruning policy parser.
Peter Collingbourne [Thu, 16 Mar 2017 03:42:00 +0000 (03:42 +0000)]
Support: Add a cache pruning policy parser.

The idea is that the policy string fully specifies the policy and is portable
between clients.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297927 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Fixing test from 297920 to add Hexagon triple.
Colin LeMahieu [Thu, 16 Mar 2017 01:52:10 +0000 (01:52 +0000)]
[Hexagon] Fixing test from 297920 to add Hexagon triple.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297926 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoCodeGen: BlockPlacement: Reduce TriangleChainCount to 2
Kyle Butt [Thu, 16 Mar 2017 01:32:29 +0000 (01:32 +0000)]
CodeGen: BlockPlacement: Reduce TriangleChainCount to 2

This produces a 1% speedup on an important internal Google benchmark
(protocol buffers), with no other regressions in google or in the llvm
test-suite. Only 5 targets in the entire llvm test-suite are affected,
and on those 5 targets the size increase is 0.027%

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297925 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoCheck that line table entries don't spill over between sections even if they're empty...
David Blaikie [Thu, 16 Mar 2017 00:52:18 +0000 (00:52 +0000)]
Check that line table entries don't spill over between sections even if they're empty at the end of a section

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297922 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoSimplify/make more explicit (by making less explicit in some ways) some function...
David Blaikie [Thu, 16 Mar 2017 00:43:19 +0000 (00:43 +0000)]
Simplify/make more explicit (by making less explicit in some ways) some function calls

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297921 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Updating inline saturate lanes for v62 version.
Colin LeMahieu [Thu, 16 Mar 2017 00:35:28 +0000 (00:35 +0000)]
[Hexagon] Updating inline saturate lanes for v62 version.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297920 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[libFuzzer] add a dummy LLVMFuzzerMutate to afl/afl_driver.cpp (https://github.com...
Kostya Serebryany [Wed, 15 Mar 2017 23:54:40 +0000 (23:54 +0000)]
[libFuzzer] add a dummy LLVMFuzzerMutate to afl/afl_driver.cpp (https://github.com/google/oss-fuzz/issues/460)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297919 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[libFuzzer] call __sanitizer_print_memory_profile with two params
Kostya Serebryany [Wed, 15 Mar 2017 23:27:53 +0000 (23:27 +0000)]
[libFuzzer] call __sanitizer_print_memory_profile with two params

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297916 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRemove redundant condition (PR32263). NFCI.
Simon Pilgrim [Wed, 15 Mar 2017 23:27:43 +0000 (23:27 +0000)]
Remove redundant condition (PR32263). NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297915 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAMDGPU: Allow sinking of addressing modes for atomic_inc/dec
Matt Arsenault [Wed, 15 Mar 2017 23:15:12 +0000 (23:15 +0000)]
AMDGPU: Allow sinking of addressing modes for atomic_inc/dec

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297913 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert "[libFuzzer] Use ChooseUnitIdxToMutate to pick item for crossover."
Vitaly Buka [Wed, 15 Mar 2017 23:08:18 +0000 (23:08 +0000)]
Revert "[libFuzzer] Use ChooseUnitIdxToMutate to pick item for crossover."

Fails LLVMFuzzer.LLVMFuzzer.value-profile-strncmp.test.

This reverts commit r297891.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297912 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert "Revert "[PGO] Minor cleanup for count instruction in SelectInstVisitor.""
Vitaly Buka [Wed, 15 Mar 2017 23:07:41 +0000 (23:07 +0000)]
Revert "Revert "[PGO] Minor cleanup for count instruction in SelectInstVisitor.""

Previously reverted wrong revision.

This reverts commit r297910.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297911 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert "[PGO] Minor cleanup for count instruction in SelectInstVisitor."
Vitaly Buka [Wed, 15 Mar 2017 23:06:22 +0000 (23:06 +0000)]
Revert "[PGO] Minor cleanup for count instruction in SelectInstVisitor."

Fails LLVMFuzzer.LLVMFuzzer.value-profile-strncmp.test

This reverts commit r297892.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297910 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix build failure from r297897.
Rong Xu [Wed, 15 Mar 2017 23:00:19 +0000 (23:00 +0000)]
Fix build failure from r297897.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297909 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoSupport: Simplify the CachePruning API. NFCI.
Peter Collingbourne [Wed, 15 Mar 2017 22:54:18 +0000 (22:54 +0000)]
Support: Simplify the CachePruning API. NFCI.

Change the function that implements the pruning into a free function that
takes the policy as a struct argument.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297907 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRemoved unnecessary semicolon. NFCI.
Simon Pilgrim [Wed, 15 Mar 2017 22:50:47 +0000 (22:50 +0000)]
Removed unnecessary semicolon. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297906 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[StackColoring] Remove unused header file for post-order traversal. Update comment...
Craig Topper [Wed, 15 Mar 2017 22:40:26 +0000 (22:40 +0000)]
[StackColoring] Remove unused header file for post-order traversal. Update comment that indicated we were using it when we really use a depth-first search. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297904 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoCodeGenPrepare: Sink addressing modes for atomics
Matt Arsenault [Wed, 15 Mar 2017 22:35:20 +0000 (22:35 +0000)]
CodeGenPrepare: Sink addressing modes for atomics

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297903 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoTry to fix build break due to template argument deduction.
Zachary Turner [Wed, 15 Mar 2017 22:32:59 +0000 (22:32 +0000)]
Try to fix build break due to template argument deduction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297902 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[llvm-pdbdump] Add support for diffing the String Table.
Zachary Turner [Wed, 15 Mar 2017 22:19:30 +0000 (22:19 +0000)]
[llvm-pdbdump] Add support for diffing the String Table.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297901 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[pdb] Write the module info and symbol record streams.
Zachary Turner [Wed, 15 Mar 2017 22:18:53 +0000 (22:18 +0000)]
[pdb] Write the module info and symbol record streams.

Previously we did not have support for writing detailed
module information for each module, as well as the symbol
records.  This patch adds support for this, and in doing
so enables the ability to construct minimal PDBs from
just a few lines of YAML.  A test is added to illustrate
this functionality.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297900 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix up grammar in a comment.
Eric Christopher [Wed, 15 Mar 2017 21:50:46 +0000 (21:50 +0000)]
Fix up grammar in a comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297898 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[PGO] Value profile for size of memory intrinsic calls
Rong Xu [Wed, 15 Mar 2017 21:47:27 +0000 (21:47 +0000)]
[PGO] Value profile for size of memory intrinsic calls

This patch adds the value profile support to profile the size parameter of
memory intrinsic calls: memcpy, memcmp, and memmov.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297897 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoSecond attempt for fix Hexagon buildbot by moving test to under X86/
Zvi Rackover [Wed, 15 Mar 2017 21:13:45 +0000 (21:13 +0000)]
Second attempt for fix Hexagon buildbot by moving test to under X86/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297893 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[PGO] Minor cleanup for count instruction in SelectInstVisitor.
Rong Xu [Wed, 15 Mar 2017 21:05:24 +0000 (21:05 +0000)]
[PGO] Minor cleanup for count instruction in SelectInstVisitor.

Summary:
NSIs can be double-counted by different operations in
SelectInstVisitor. Sink the the update to VM_counting mode only.
Also reset the value for each counting operation.

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: xur, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297892 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[libFuzzer] Use ChooseUnitIdxToMutate to pick item for crossover.
Vitaly Buka [Wed, 15 Mar 2017 20:59:27 +0000 (20:59 +0000)]
[libFuzzer] Use ChooseUnitIdxToMutate to pick item for crossover.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297891 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAdd GDB pretty-printer for llvm::Twine type
David Blaikie [Wed, 15 Mar 2017 20:51:44 +0000 (20:51 +0000)]
Add GDB pretty-printer for llvm::Twine type

Patch by Simon Marchi!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297889 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoLimit test's triple in attempt to fix broken buildbot
Zvi Rackover [Wed, 15 Mar 2017 20:29:58 +0000 (20:29 +0000)]
Limit test's triple in attempt to fix broken buildbot

Regression test for a target-independent bug keeps failing in the
Hexagon backend due to what appears an unrelated issue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297888 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoNFC: Corrects comments that were supposed to go in with earlier commit.
Adrian McCarthy [Wed, 15 Mar 2017 20:29:06 +0000 (20:29 +0000)]
NFC:  Corrects comments that were supposed to go in with earlier commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297887 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[EarlyCSE] reduce indent; NFCI
Sanjay Patel [Wed, 15 Mar 2017 20:25:05 +0000 (20:25 +0000)]
[EarlyCSE] reduce indent; NFCI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297886 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[tablegen][globalisel] Trivial changes to reduce size of following patch. NFC.
Daniel Sanders [Wed, 15 Mar 2017 20:18:38 +0000 (20:18 +0000)]
[tablegen][globalisel] Trivial changes to reduce size of following patch. NFC.

Summary:
* Move namespace {
* Trivial: Typo
* RuleMatcher: Separate class and definition
* Trivial: const findNodeEquiv

Reviewers: t.p.northover, qcolombet, aditya_nandakumar, ab, rovka

Reviewed By: rovka

Subscribers: dberris, kristof.beyls, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297884 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoIntroduce NativeEnumModules and NativeCompilandSymbol
Adrian McCarthy [Wed, 15 Mar 2017 20:17:58 +0000 (20:17 +0000)]
Introduce NativeEnumModules and NativeCompilandSymbol

Together, these allow lldb-pdbdump to list all the modules from a PDB using a
native reader (rather than DIA).

Note that I'll probably be specializing NativeRawSymbol in a subsequent patch.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297883 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DAGCombine] Bail out if can't create a vector with at least two elements
Zvi Rackover [Wed, 15 Mar 2017 19:48:36 +0000 (19:48 +0000)]
[DAGCombine] Bail out if can't create a vector with at least two elements

Summary:

Fixes pr32278

Reviewers: igorb, craig.topper, RKSimon, spatel, hfinkel

Reviewed By: RKSimon

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297878 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[WebAssembly] Update format of 'names' section.
Derek Schuff [Wed, 15 Mar 2017 19:36:02 +0000 (19:36 +0000)]
[WebAssembly] Update format of 'names' section.

This change updates to the format of the 'names' sectionin the
generated wasm binary to match the latest changesto the design
and 'wabt'.

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

Patch by Sam Clegg

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297877 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86] Add missing BITREVERSE costs for SSE2 vectors and i8/i16/i32/i64 scalars
Simon Pilgrim [Wed, 15 Mar 2017 19:34:55 +0000 (19:34 +0000)]
[X86] Add missing BITREVERSE costs for SSE2 vectors and i8/i16/i32/i64 scalars

Prep work for PR31810

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297876 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[GlobalISel] Avoid translating synthetic constants to new G_CONSTANTS.
Ahmed Bougacha [Wed, 15 Mar 2017 19:21:11 +0000 (19:21 +0000)]
[GlobalISel] Avoid translating synthetic constants to new G_CONSTANTS.

Currently, we create a G_CONSTANT for every "synthetic" integer
constant operand (for instance, for the G_GEP offset).
Instead, share the G_CONSTANTs we might have created by going through
the ValueToVReg machinery.

When we're emitting synthetic constants, we do need to get Constants from
the context.  One could argue that we shouldn't modify the context at
all (for instance, this means that we're going to use a tad more memory
if the constant wasn't used elsewhere), but constants are mostly
harmless.  We currently do this for extractvalue and all.

For constant fcmp, this does mean we'll emit an extra COPY, which is not
necessarily more optimal than an extra materialized constant.
But that preserves the current intended design of uniqued G_CONSTANTs,
and the rematerialization problem exists elsewhere and should be
resolved with a single coherent solution.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297875 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[GlobalISel][AArch64] Select ADDXri.
Ahmed Bougacha [Wed, 15 Mar 2017 19:20:59 +0000 (19:20 +0000)]
[GlobalISel][AArch64] Select ADDXri.

We're now able to select ADDWri thanks to the new complex pattern
support.  Extend that to ADDXri.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297874 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAMDGPU: Fix unnecessary ands when packing f16 vectors
Matt Arsenault [Wed, 15 Mar 2017 19:04:26 +0000 (19:04 +0000)]
AMDGPU: Fix unnecessary ands when packing f16 vectors

computeKnownBits didn't handle fp_to_fp16 to report
the high bits as 0. ARM maps the generic node to an instruction
that does not modify the high bits of the register, so introduce
a target node where the high bits are known 0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297873 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoARM: avoid clobbering register in v6 jump-table expansion.
Tim Northover [Wed, 15 Mar 2017 18:38:13 +0000 (18:38 +0000)]
ARM: avoid clobbering register in v6 jump-table expansion.

If we got unlucky with register allocation and actual constpool placement, we
could end up producing a tTBB_JT with an index that's already been clobbered.

Technically, we might be able to fix this situation up with a MOV, but I think
the constant islands pass is complex enough without having to deal with more
weird edge-cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297871 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[PGO] Refactor the code for value profile annotation
Rong Xu [Wed, 15 Mar 2017 18:23:39 +0000 (18:23 +0000)]
[PGO] Refactor the code for value profile annotation

This patch refactors the code for value profile annotation to facilitate
of adding other kind of value profiles.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297870 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[GlobalISel] Insert translated switch icmp blocks after switch parent.
Ahmed Bougacha [Wed, 15 Mar 2017 18:22:37 +0000 (18:22 +0000)]
[GlobalISel] Insert translated switch icmp blocks after switch parent.

Now that we preserve the IR layout, we would end up with all the newly
synthesized switch comparison blocks at the end of the function.
Instead, use a hopefully more reasonable layout, with the comparison
blocks immediately following the switch comparison blocks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297869 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[GlobalISel] Preserve IR block layout.
Ahmed Bougacha [Wed, 15 Mar 2017 18:22:33 +0000 (18:22 +0000)]
[GlobalISel] Preserve IR block layout.

It makes the output function layout more predictable;  the layout has
an effect on performance, we don't want it to be at the mercy of the
translator's visitation order and such.
The predictable output is also easier to digest.

getOrCreateBB isn't appropriately named anymore, as it never needs to
create anything.  Rename it and extract the MBB creation logic out of it.

A couple tests were sensitive to the order. Update them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297868 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[GlobalISel] Use ASCII quote/apostrophe in comment. NFC.
Ahmed Bougacha [Wed, 15 Mar 2017 18:22:24 +0000 (18:22 +0000)]
[GlobalISel] Use ASCII quote/apostrophe in comment. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297867 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAMDGPU: Minor SIAnnotateControlFlow cleanups
Matt Arsenault [Wed, 15 Mar 2017 18:00:12 +0000 (18:00 +0000)]
AMDGPU: Minor SIAnnotateControlFlow cleanups

Newline fixes, early return, range loops.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297865 91177308-0d34-0410-b5e6-96231b3b80d8