OSDN Git Service

android-x86/external-llvm.git
6 years ago[libFuzzer tests] Only enable libFuzzer tests if
George Karpenkov [Fri, 4 Aug 2017 19:29:16 +0000 (19:29 +0000)]
[libFuzzer tests] Only enable libFuzzer tests if
-DLIBFUZZER_ENABLE_TESTS=ON is set.

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

6 years ago[SystemZ] Add support for 128-bit atomic load/store/cmpxchg
Ulrich Weigand [Fri, 4 Aug 2017 18:57:58 +0000 (18:57 +0000)]
[SystemZ] Add support for 128-bit atomic load/store/cmpxchg

This adds support for the main 128-bit atomic operations,
using the SystemZ instructions LPQ, STPQ, and CDSG.

Generating these instructions is a bit more complex than usual
since the i128 type is not legal for the back-end.  Therefore,
we have to hook the LowerOperationWrapper and ReplaceNodeResults
TargetLowering callbacks.

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

6 years ago[SystemZ] Eliminate unnecessary serialization operations
Ulrich Weigand [Fri, 4 Aug 2017 18:53:35 +0000 (18:53 +0000)]
[SystemZ] Eliminate unnecessary serialization operations

We currently emit a serialization operation (bcr 14, 0) before every
atomic load and after every atomic store.  This is overly conservative.
The SystemZ architecture actually does not require any serialization
for atomic loads, and a serialization after an atomic store only if
we need to enforce sequential consistency.  This is what other compilers
for the platform implement as well.

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

6 years agoFix PR33514
Evgeny Stupachenko [Fri, 4 Aug 2017 18:46:13 +0000 (18:46 +0000)]
Fix PR33514

Summary:
The bug was uncovered after fix of  PR23384 (part 3 of 3).
The patch restricts pointer multiplication in SCEV computaion for ICmpZero.

Reviewers: qcolombet

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

From: Evgeny Stupachenko <evstupac@gmail.com>
                         <evgeny.v.stupachenko@intel.com>

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

6 years ago[libFuzzer] make trace-pc.test more reliable
Kostya Serebryany [Fri, 4 Aug 2017 18:43:39 +0000 (18:43 +0000)]
[libFuzzer] make trace-pc.test more reliable

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

6 years ago[AMDGPU] Implement llvm.amdgcn.set.inactive intrinsic
Connor Abbott [Fri, 4 Aug 2017 18:36:54 +0000 (18:36 +0000)]
[AMDGPU] Implement llvm.amdgcn.set.inactive intrinsic

Summary:
This intrinsic lets us set inactive lanes to an identity value when
implementing wavefront reductions. In combination with Whole Wavefront
Mode, it lets inactive lanes be skipped over as required by GLSL/Vulkan.
Lowering the intrinsic needs to happen post-RA so that RA knows that the
destination isn't completely overwritten due to the EXEC shenanigans, so
we need another pseudo-instruction to represent the un-lowered
intrinsic.

Reviewers: tstellar, arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye

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

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

6 years ago[AMDGPU] Add support for Whole Wavefront Mode
Connor Abbott [Fri, 4 Aug 2017 18:36:52 +0000 (18:36 +0000)]
[AMDGPU] Add support for Whole Wavefront Mode

Summary:
Whole Wavefront Wode (WWM) is similar to WQM, except that all of the
lanes are always enabled, regardless of control flow. This is required
for implementing wavefront reductions in non-uniform control flow, where
we need to use the inactive lanes to propagate intermediate results, so
they need to be enabled. We need to propagate WWM to uses (unless
they're explicitly marked as exact) so that they also propagate
intermediate results correctly. We do the analysis and exec mask munging
during the WQM pass, since there are interactions with WQM for things
that require both WQM and WWM. For simplicity, WWM is entirely
block-local -- blocks are never WWM on entry or exit of a block, and WWM
is not propagated to the block level.  This means that computations
involving WWM cannot involve control flow, but we only ever plan to use
WWM for a few limited purposes (none of which involve control flow)
anyways.

Shaders can ask for WWM using the @llvm.amdgcn.wwm intrinsic. There
isn't yet a way to turn WWM off -- that will be added in a future
change.

Finally, it turns out that turning on inactive lanes causes a number of
problems with register allocation. While the best long-term solution
seems like teaching LLVM's register allocator about predication, for now
we need to add some hacks to prevent ourselves from getting into trouble
due to constraints that aren't currently expressed in LLVM. For the gory
details, see the comments at the top of SIFixWWMLiveness.cpp.

Reviewers: arsenm, nhaehnle, tpr

Subscribers: kzhuravl, wdng, mgorny, yaxunl, dstuttard, t-tye, llvm-commits

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

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

6 years ago[AMDGPU] refactor WQM pass in preparation for WWM (NFCI)
Connor Abbott [Fri, 4 Aug 2017 18:36:50 +0000 (18:36 +0000)]
[AMDGPU] refactor WQM pass in preparation for WWM (NFCI)

Summary:
Right now, the WQM pass conflates two different things when tracking the
Needs of an instruction:

1. Needs can be StateWQM, which is propagated to other instructions, and
means that this instruction (and everything it depends on) must be
calculated in WQM.
2. Needs can be StateExact, which is not propagated to other
instructions, and means that this instruction must not be calculated in
WQM and WQM-ness must not be propagated past this instruction.

This works now because there are only two different states, but in the
future we want to be able to express things like "calculate this in WQM,
but please disable WWM and don't propagate it" (to implement
@llvm.amdgcn.set.inactive). In order to do this, we need to split the
per-instruction Needs field in two: a new Needs field, which can only
contain StateWQM (and in the future, StateWWM) and is propagated to
sources, and a Disables field, which can also contain just StateWQM or
nothing for now.

We keep the per-block tracking the same for now, by translating
Needs/Disables to the old representation with only StateWQM or
StateExact. The other place that needs special handling is when we
emit the state transitions. We could just translate back to the old
representation there as well, which we almost do, but instead of 0 as a
placeholder value for "any state," we explicitly or together all the
states an instruction is allowed to be in. This lets us refactor the
code in preparation for WWM, where we'll need to be able to handle
things like "this instruction must be in Exact or WQM, but not WWM."

Reviewers: arsenm, nhaehnle, tpr

Subscribers: kzhuravl, wdng, yaxunl, dstuttard, t-tye, llvm-commits

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

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

6 years ago[AMDGPU] Add an llvm.amdgcn.wqm intrinsic for WQM
Connor Abbott [Fri, 4 Aug 2017 18:36:49 +0000 (18:36 +0000)]
[AMDGPU] Add an llvm.amdgcn.wqm intrinsic for WQM

Summary:
Previously, we assumed that certain types of instructions needed WQM in
pixel shaders, particularly DS instructions and image sampling
instructions. This was ok because with OpenGL, the assumption was
correct. But we want to start using DPP instructions for derivatives as
well as other things, so the assumption that we can infer whether to use
WQM based on the instruction won't continue to hold. This intrinsic lets
frontends like Mesa indicate what things need WQM based on their
knowledge of the API, rather than second-guessing them in the backend.
We need to keep around the old method of enabling WQM, but eventually we
should remove it once Mesa catches up. For now, this will let us use DPP
instructions for computing derivatives correctly.

Reviewers: arsenm, tpr, nhaehnle

Subscribers: kzhuravl, wdng, yaxunl, dstuttard, llvm-commits, t-tye

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

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

6 years ago[MachineOperand] Add ChangeToTargetIndex method. NFC
Marcello Maggioni [Fri, 4 Aug 2017 18:24:09 +0000 (18:24 +0000)]
[MachineOperand] Add ChangeToTargetIndex method. NFC

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

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

6 years ago[Support] Remove getPathFromOpenFD, it was unused
Reid Kleckner [Fri, 4 Aug 2017 17:43:49 +0000 (17:43 +0000)]
[Support] Remove getPathFromOpenFD, it was unused

Summary:
It was added to support clang warnings about includes with case
mismatches, but it ended up not being necessary.

Reviewers: twoh, rafael

Subscribers: hiraditya, llvm-commits

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

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

6 years agoFixing buildbots: do not register check-fuzzer if clang or asan are not
George Karpenkov [Fri, 4 Aug 2017 17:43:29 +0000 (17:43 +0000)]
Fixing buildbots: do not register check-fuzzer if clang or asan are not
present.

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

6 years agoDrop Windows support from libFuzzer tests.
George Karpenkov [Fri, 4 Aug 2017 17:43:28 +0000 (17:43 +0000)]
Drop Windows support from libFuzzer tests.

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

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

6 years agoPort libFuzzer tests to LIT. Do not require two-stage build for check-fuzzer.
George Karpenkov [Fri, 4 Aug 2017 17:19:45 +0000 (17:19 +0000)]
Port libFuzzer tests to LIT. Do not require two-stage build for check-fuzzer.

This revision ports all libFuzzer tests apart from the unittest to LIT.
The advantages of doing so include:

 - Tests being self-contained
 - Much easier debugging of a single test
 - No need for using a two-stage compilation

The unit-test is still compiled using CMake, but it does not need a
freshly built compiler.

NOTE: The previous two-stage bot configuration will NOT work, as in the
second stage build LLVM_USE_SANITIZER is set, which disables ASAN from
being built.
Thus bots will be reconfigured in the next few commits.

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

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

6 years ago[Inliner] Fix a typo in option description. NFC.
Easwaran Raman [Fri, 4 Aug 2017 17:15:17 +0000 (17:15 +0000)]
[Inliner] Fix a typo in option description. NFC.

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

6 years ago[ARM] Use searchable-table for banked registers
Javed Absar [Fri, 4 Aug 2017 17:10:11 +0000 (17:10 +0000)]
[ARM] Use searchable-table for banked registers

This is a continuation of https://reviews.llvm.org/D36219

This patch uses reverse mapping (encoding->name) in
ARMInstPrinter::printBankedRegOperand to get rid of
hard-coded values (as pointed out by @olista01).

Reviewed by: @fhahn, @rovka, @olista01
Differential Revision: https://reviews.llvm.org/D36260

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

6 years ago[ArgPromotion] Preserve alignment of byval argument in new alloca
Reid Kleckner [Fri, 4 Aug 2017 17:09:11 +0000 (17:09 +0000)]
[ArgPromotion] Preserve alignment of byval argument in new alloca

The frontend may have requested a higher alignment for any reason, and
downstream optimizations may already have taken advantage of it.  We
should keep the same alignment when moving the allocation from the
parameter area to the local variable area.

Fixes PR34038

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

6 years ago[ConstantInt] Use ConstantInt::getValue instead of Constant::getUniqueInteger in...
Craig Topper [Fri, 4 Aug 2017 16:59:29 +0000 (16:59 +0000)]
[ConstantInt] Use ConstantInt::getValue instead of Constant::getUniqueInteger in a few places where we obviously have a ConstantInt. NFC

getUniqueInteger will ultimately call ConstantInt::getValue, but calling ConstantInt::getValue should be inlined.

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

6 years ago[AArch64] Fix an assertion for pre-index generation with unscaled loads/stores.
Chad Rosier [Fri, 4 Aug 2017 16:44:06 +0000 (16:44 +0000)]
[AArch64] Fix an assertion for pre-index generation with unscaled loads/stores.

Differential Revision: https://reviews.llvm.org/D36248
PR34035

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

6 years agoAdjust the hotness threshold from 99.9% to 99%.
Dehao Chen [Fri, 4 Aug 2017 16:20:54 +0000 (16:20 +0000)]
Adjust the hotness threshold from 99.9% to 99%.

Summary: We originally set the hotness threshold as 99.9% to be consistent with gcc FDO. But because the inline heuristic is different between 2 compilers: llvm uses bottom-up algorithm while gcc uses priority based. The LLVM algorithm tends to inline too much early that prevents hot callsites from further inlined into its caller. Due to this restriction, we think it is reasonable to lower the hotness threshold to give priority to those that are really hot. Our experiments show that this change would improve performance on large applications. Note that the inline heuristic has great room for further tuning. Once the inline heuristics are refined, we could adjust this threshold to allow inlining for less hot callsites.

Reviewers: davidxl, tejohnson, eraman

Reviewed By: tejohnson

Subscribers: sanjoy, llvm-commits

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

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

6 years ago[InstCombine] Fold single-use variable into assert.
Benjamin Kramer [Fri, 4 Aug 2017 16:08:41 +0000 (16:08 +0000)]
[InstCombine] Fold single-use variable into assert.

Avoids unused variable warnings in Release builds. No functional change.

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

6 years ago[InstCombine] Remove the (not (sext)) case from foldBoolSextMaskToSelect and inline...
Craig Topper [Fri, 4 Aug 2017 16:07:20 +0000 (16:07 +0000)]
[InstCombine] Remove the (not (sext)) case from foldBoolSextMaskToSelect and inline the remaining code to match visitOr

Summary:
The (not (sext)) case is really (xor (sext), -1) which should have been simplified to (sext (xor, 1)) before we got here. So we shouldn't need to handle it.

With that taken care of we only need to two cases so don't need the swap anymore. This makes us in sync with the equivalent code in visitOr so inline this to match.

Reviewers: spatel, eli.friedman, majnemer

Reviewed By: spatel

Subscribers: llvm-commits

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

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

6 years ago[InstCombine] Use ConstantInt::getFalse to reduce some code. NFC
Craig Topper [Fri, 4 Aug 2017 16:07:18 +0000 (16:07 +0000)]
[InstCombine] Use ConstantInt::getFalse to reduce some code. NFC

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

6 years ago[ThinLTO] Add FunctionAttrs to ThinLTO index
Charles Saternos [Fri, 4 Aug 2017 16:00:58 +0000 (16:00 +0000)]
[ThinLTO] Add FunctionAttrs to ThinLTO index

Adds function attributes to index: ReadNone, ReadOnly, NoRecurse, NoAlias. This attributes will be used for future ThinLTO optimizations that will propagate function attributes across modules.

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

6 years ago[InstCombine] narrow lshr with constant
Sanjay Patel [Fri, 4 Aug 2017 15:42:47 +0000 (15:42 +0000)]
[InstCombine] narrow lshr with constant

Name: narrow_shift
Pre: C1 < 8
%zx = zext i8 %x to i32
%l = lshr i32 %zx, C1
  =>
%narrowC = trunc i32 C1 to i8
%ns = lshr i8 %x, %narrowC
%l = zext i8 %ns to i32

http://rise4fun.com/Alive/jIV

This isn't directly applicable to PR34046 as written, but we
need to have more narrowing folds like this to be sure that
rotate patterns are recognized.

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

6 years ago[AMDGPU][MC] Enabled expressions as operands
Dmitry Preobrazhensky [Fri, 4 Aug 2017 13:55:24 +0000 (13:55 +0000)]
[AMDGPU][MC] Enabled expressions as operands

See bug 33579: https://bugs.llvm.org//show_bug.cgi?id=33579

Reviewers: vpykhtin, SamWot, arsenm

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

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

6 years ago[DAGCombiner] Extending pattern detection for vector shuffle.
Simon Pilgrim [Fri, 4 Aug 2017 12:46:35 +0000 (12:46 +0000)]
[DAGCombiner] Extending pattern detection for vector shuffle.

If all the operands of a BUILD_VECTOR extract elements from same vector then split the vector efficiently based on the maximum vector access index.

Committed on behalf of @jbhateja (Jatin Bhateja)

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

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

6 years ago[DSE] Merge stores when the later store only writes to memory locations the early...
Filipe Cabecinhas [Fri, 4 Aug 2017 12:28:36 +0000 (12:28 +0000)]
[DSE] Merge stores when the later store only writes to memory locations the early store also wrote to.

Summary:
This fixes PR31777.

If both stores' values are ConstantInt, we merge the two stores
(shifting the smaller store appropriately) and replace the earlier (and
larger) store with an updated constant.

In the future we should also support vectors of integers. And maybe
float/double if we can.

Reviewers: hfinkel, junbuml, jfb, RKSimon, bkramer

Subscribers: llvm-commits

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

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

6 years ago[InstCombine] Canonicalize clamp of float types to minmax in fast mode.
Nikolai Bozhenov [Fri, 4 Aug 2017 12:22:17 +0000 (12:22 +0000)]
[InstCombine] Canonicalize clamp of float types to minmax in fast mode.

Summary:
This commit allows matchSelectPattern to recognize clamp of float
arguments in the presence of FMF the same way as already done for
integers.

This case is a little different though. With integers, given the
min/max pattern is recognized, DAGBuilder starts selecting MIN/MAX
"automatically". That is not the case for float, because for them only
full FMINNAN/FMINNUM/FMAXNAN/FMAXNUM ISD nodes exist and they do care
about NaNs. On the other hand, some backends (e.g. X86) have only
FMIN/FMAX nodes that do not care about NaNS and the former NAN/NUM
nodes are illegal thus selection is not happening. So I decided to do
such kind of transformation in IR (InstCombiner) instead of
complicating the logic in the backend.

Reviewers: spatel, jmolloy, majnemer, efriedma, craig.topper

Reviewed By: efriedma

Subscribers: hiraditya, javed.absar, n.bozhenov, llvm-commits

Patch by Andrei Elovikov <andrei.elovikov@intel.com>

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

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

6 years agoAdd some tests for cast+clamp/min/max before D33186.
Nikolai Bozhenov [Fri, 4 Aug 2017 12:21:03 +0000 (12:21 +0000)]
Add some tests for cast+clamp/min/max before D33186.

Summary:
- add more tests
- pr27236.ll: rename %tmpN -> %N because otherwise a FileCheck
  variable for newly appeared unnamed value would use the same name as
  tmpN (as generated by update_test_checks.py)
- run update_test_checks.py

Reviewers: efriedma

Reviewed By: efriedma

Subscribers: n.bozhenov, llvm-commits

Patch by Andrei Elovikov <andrei.elovikov@intel.com>

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

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

6 years ago[AMDGPU] Fixed MSVC build break
Florian Gross [Fri, 4 Aug 2017 10:53:07 +0000 (10:53 +0000)]
[AMDGPU] Fixed MSVC build break

Error was:

field of type 'llvm::ArgDescriptor' has private default constructor
const AMDGPUFunctionArgInfo AMDGPUArgumentUsageInfo::ExternFunctionInfo{};
                                                                        ^

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

6 years ago[mips][microMIPS] Extending size reduction pass with ADDIUSP and ADDIUR1SP
Zoran Jovanovic [Fri, 4 Aug 2017 10:18:44 +0000 (10:18 +0000)]
[mips][microMIPS] Extending size reduction pass with ADDIUSP and ADDIUR1SP
Author: milena.vujosevic.janicic
The patch extends size reduction pass for MicroMIPS.
The following instructions are examined and transformed, if possible:
ADDIU instruction is transformed into 16-bit instruction ADDIUSP
ADDIU instruction is transformed into 16-bit instruction ADDIUR1SP
Usage of u_int64_t replaced by uint64_t to avoid issues because of which previous patch version was reverted:
Differential Revision: https://reviews.llvm.org/D34511

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

6 years ago[Polly][PM] Register polly passes with the opt tool for the new-pm path
Philip Pfaffe [Fri, 4 Aug 2017 09:28:09 +0000 (09:28 +0000)]
[Polly][PM] Register polly passes with the opt tool for the new-pm path

Summary: When polly is linked into the tools because of the LLVM_POLLY_LINK_INTO_TOOLS option being set, we need to register its passes with the PassBuilder. Because polly is linked in, we can directly call its callback registration method, which registers the appropriate callbacks with the new PM's PassBuilder. This essentially follows exactly the way it worked with the legacy PM.

Reviewers: grosser, chandlerc, bollu

Reviewed By: grosser

Subscribers: pollydev, llvm-commits

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

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

6 years agoDo not declare a variable which is used only in assert. NFC
Max Kazantsev [Fri, 4 Aug 2017 07:41:24 +0000 (07:41 +0000)]
Do not declare a variable which is used only in assert. NFC

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

6 years ago[IRCE] Handle loops with step different from 1/-1
Max Kazantsev [Fri, 4 Aug 2017 07:01:04 +0000 (07:01 +0000)]
[IRCE] Handle loops with step different from 1/-1

This patch generalizes IRCE to handle IV steps that are not equal to 1 or -1.

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

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

6 years ago[AMDGPU] Preserve inverted bit in SI_IF in presence of SI_KILL
Stanislav Mekhanoshin [Fri, 4 Aug 2017 06:58:42 +0000 (06:58 +0000)]
[AMDGPU] Preserve inverted bit in SI_IF in presence of SI_KILL

In case if SI_KILL is in between of the SI_IF and SI_END_CF we need
to preserve the bits actually flipped by if rather then restoring
the original mask.

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

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

6 years agoAvoid comparison between signed and unsigned in SCEVExitLimitForget tests
Max Kazantsev [Fri, 4 Aug 2017 06:03:51 +0000 (06:03 +0000)]
Avoid comparison between signed and unsigned in SCEVExitLimitForget tests

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

6 years ago[AVR] Update target machine to use new constructor parameters
Dylan McKay [Fri, 4 Aug 2017 05:48:20 +0000 (05:48 +0000)]
[AVR] Update target machine to use new constructor parameters

The required parameters were changed in r309911.

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

6 years ago[IRCE] Recognize loops with unsigned latch conditions
Max Kazantsev [Fri, 4 Aug 2017 05:40:20 +0000 (05:40 +0000)]
[IRCE] Recognize loops with unsigned latch conditions

This patch enables recognition of loops with ult/ugt latch conditions.

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

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

6 years agoRevert "[llvm][llvm-objcopy] Added support for outputting to binary in llvm-objcopy"
Petr Hosek [Fri, 4 Aug 2017 05:33:44 +0000 (05:33 +0000)]
Revert "[llvm][llvm-objcopy] Added support for outputting to binary in llvm-objcopy"

This breaks the build on clang-s390x-linux.

This reverts commit r310018.

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

6 years ago[InstCombine] Move the call to foldSelectICmpAnd into foldSelectInstWithICmp. NFCI
Craig Topper [Fri, 4 Aug 2017 05:12:37 +0000 (05:12 +0000)]
[InstCombine] Move the call to foldSelectICmpAnd into foldSelectInstWithICmp. NFCI

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

6 years ago[InstCombine] Remove unnecessary casts. NFC
Craig Topper [Fri, 4 Aug 2017 05:12:35 +0000 (05:12 +0000)]
[InstCombine] Remove unnecessary casts. NFC

We're calling an overload of getOpcode that already returns Instruction::CastOps.

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

6 years agoFix SCEVExitLimitForget tests to make Sanitizer happy
Max Kazantsev [Fri, 4 Aug 2017 05:06:44 +0000 (05:06 +0000)]
Fix SCEVExitLimitForget tests to make Sanitizer happy

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

6 years agoPrevent unused warning in non-assert builds (introduced in r310014).
Daniel Jasper [Fri, 4 Aug 2017 05:05:29 +0000 (05:05 +0000)]
Prevent unused warning in non-assert builds (introduced in r310014).

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

6 years agoUn-revert r310014: false revert, it wasn't the cause of build break
Victor Leschuk [Fri, 4 Aug 2017 04:51:15 +0000 (04:51 +0000)]
Un-revert r310014: false revert, it wasn't the cause of build break

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

6 years agoRevert r310014 as it breaks build lld-x86_64-darwin13
Victor Leschuk [Fri, 4 Aug 2017 04:43:54 +0000 (04:43 +0000)]
Revert r310014 as it breaks build lld-x86_64-darwin13

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

6 years agoReland "[llvm][llvm-objcopy] Added support for outputting to binary in llvm-objcopy"
Petr Hosek [Fri, 4 Aug 2017 03:17:37 +0000 (03:17 +0000)]
Reland "[llvm][llvm-objcopy] Added support for outputting to binary in llvm-objcopy"

This change adds the "-O binary" flag which directs llvm-objcopy to
output the object file to the same format as GNU objcopy does when given
the flag "-O binary". This was done by splitting the Object class into
two subclasses ObjectELF and ObjectBianry which each output a different
format but relay on the same code to read in the Object in Object.

Patch by Jake Ehrlich

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

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

6 years ago[Support] Update comments about stdout, raw_fd_ostream, and outs()
Reid Kleckner [Fri, 4 Aug 2017 01:39:23 +0000 (01:39 +0000)]
[Support] Update comments about stdout, raw_fd_ostream, and outs()

The full story is in the comments:

  // Do not attempt to close stdout or stderr. We used to try to maintain the
  // property that tools that support writing file to stdout should not also
  // write informational output to stdout, but in practice we were never able to
  // maintain this invariant. Many features have been added to LLVM and clang
  // (-fdump-record-layouts, optimization remarks, etc) that print to stdout, so
  // users must simply be aware that mixed output and remarks is a possibility.

NFC, I am just updating comments to reflect reality.

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

6 years agoTeach GlobalSRA to update the debug info for split-up globals.
Adrian Prantl [Fri, 4 Aug 2017 01:19:54 +0000 (01:19 +0000)]
Teach GlobalSRA to update the debug info for split-up globals.

This is similar to what we are doing in "regular" SROA and creates
DW_OP_LLVM_fragment operations to describe the resulting variables.

rdar://problem/33654891

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

6 years ago[AMDGPU] Add missing hazard for DPP-after-EXEC-write
Connor Abbott [Fri, 4 Aug 2017 01:09:43 +0000 (01:09 +0000)]
[AMDGPU] Add missing hazard for DPP-after-EXEC-write

Summary:
Following the docs, we need at least 5 wait states between an EXEC write
and an instruction that uses DPP.

Reviewers: tstellar, arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, llvm-commits

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

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

6 years ago[llvm-cov] Ignore unclosed line segments when setting line counts
Vedant Kumar [Fri, 4 Aug 2017 00:36:24 +0000 (00:36 +0000)]
[llvm-cov] Ignore unclosed line segments when setting line counts

This patch makes a slight change to the way llvm-cov determines line
execution counts. If there are multiple line segments on a line, the
line count is the max count among the regions which start *and* end on
the line. This avoids an issue posed by deferred regions which start on
the same line as a terminated region, e.g:

  if (false)
    return; //< The line count should be 0, even though a new region
            //< starts at the semi-colon.
  foo();

Another change is that counts from line segments which don't correspond
to region entries are considered. This enables the first change, and
corrects an outstanding issue (see the showLineExecutionCounts.cpp test
change).

This is related to D35925.

Testing: check-profile, llvm-cov lit tests

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

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

6 years ago[llvm-cov] NFC: make_unique-ify two allocations
Vedant Kumar [Fri, 4 Aug 2017 00:36:24 +0000 (00:36 +0000)]
[llvm-cov] NFC: make_unique-ify two allocations

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

6 years agoDisable libFuzzer tests on Windows
George Karpenkov [Fri, 4 Aug 2017 00:26:12 +0000 (00:26 +0000)]
Disable libFuzzer tests on Windows

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

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

6 years agoRevert "[TableGen] AsmMatcher: fix OpIdx computation when HasOptionalOperands is...
Vitaly Buka [Fri, 4 Aug 2017 00:25:24 +0000 (00:25 +0000)]
Revert "[TableGen] AsmMatcher: fix OpIdx computation when HasOptionalOperands is true"

Breaks check-llvm under ubsan.

This reverts commit r309949.

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

6 years agoAMDGPU: Remove pointless asserts
Matt Arsenault [Fri, 4 Aug 2017 00:00:13 +0000 (00:00 +0000)]
AMDGPU: Remove pointless asserts

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

6 years agoUse profile summary to disable peeling for huge working sets
Teresa Johnson [Thu, 3 Aug 2017 23:42:58 +0000 (23:42 +0000)]
Use profile summary to disable peeling for huge working sets

Summary:
Detect when the working set size of a profiled application is huge,
by comparing the number of counts required to reach the hot percentile
in the profile summary to a large threshold*.

When the working set size is determined to be huge, disable peeling
to avoid bloating the working set further.

*Note that the selected threshold (15K) is significantly larger than the
largest working set value in SPEC cpu2006 (which is gcc at around 11K).

Reviewers: davidxl

Subscribers: mehdi_amini, mzolotukhin, eraman, llvm-commits

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

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

6 years agoAMDGPU: Don't use report_fatal_error for unsupported call types
Matt Arsenault [Thu, 3 Aug 2017 23:32:41 +0000 (23:32 +0000)]
AMDGPU: Don't use report_fatal_error for unsupported call types

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

6 years agoAMDGPU: Remove error on calls for amdgcn
Matt Arsenault [Thu, 3 Aug 2017 23:24:05 +0000 (23:24 +0000)]
AMDGPU: Remove error on calls for amdgcn

Repurpose the -amdgpu-function-calls flag. Rather
than require it to emit a call, only use it to
run the always inline path or not.

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

6 years agoAMDGPU: Fix implicitarg.ptr handling special inputs
Matt Arsenault [Thu, 3 Aug 2017 23:12:44 +0000 (23:12 +0000)]
AMDGPU: Fix implicitarg.ptr handling special inputs

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

6 years agoSupport: WOA64 and WOA Signals
Martell Malone [Thu, 3 Aug 2017 23:12:33 +0000 (23:12 +0000)]
Support: WOA64 and WOA Signals

Reviewers: rnk

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

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

6 years ago[llvm-pdbutil] Add an option to only dump specific module indices.
Zachary Turner [Thu, 3 Aug 2017 23:11:52 +0000 (23:11 +0000)]
[llvm-pdbutil] Add an option to only dump specific module indices.

Often something interesting (like a symbol) is in a particular
module, and you don't want to dump symbols from all other 300
modules to see the one you want.  This adds a -modi option so that
we only dump the specified module.

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

6 years agoAMDGPU: Pass special input registers to functions
Matt Arsenault [Thu, 3 Aug 2017 23:00:29 +0000 (23:00 +0000)]
AMDGPU: Pass special input registers to functions

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

6 years agoFix typo.
Eric Christopher [Thu, 3 Aug 2017 22:41:12 +0000 (22:41 +0000)]
Fix typo.

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

6 years agoAMDGPU: Add analysis pass for function argument info
Matt Arsenault [Thu, 3 Aug 2017 22:30:46 +0000 (22:30 +0000)]
AMDGPU: Add analysis pass for function argument info

This will allow only adding necessary inputs to callee functions
that need special inputs forwarded from the kernel.

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

6 years ago[Inliner] Increase threshold for hot callsites without PGO.
Easwaran Raman [Thu, 3 Aug 2017 22:23:33 +0000 (22:23 +0000)]
[Inliner] Increase threshold for hot callsites without PGO.

Summary:
This increases the inlining threshold for hot callsites. Hotness is
defined in terms of block frequency of the callsite relative to the
caller's entry block's frequency. Since this requires BFI in the
inliner, this only affects the new PM pipeline. This is enabled by
default at -O3.

This improves the performance of some internal benchmarks. Notably, an
internal benchmark for Gipfeli compression
(https://github.com/google/gipfeli) improves by ~7%. Povray in SPEC2006
improves by ~2.5%. I am running more experiments and will update the
thread if other benchmarks show improvement/regression.

In terms of text size, LLVM test-suite shows an 1.22% text size
increase. Diving into the results, 13 of the benchmarks in the
test-suite increases by > 10%. Most of these are small, but
Adobe-C++/loop_unroll (17.6% increases) and tramp3d(20.7% size increase)
have >250K text size. On a large application, the text size increases by
2%

Reviewers: chandlerc, davidxl

Subscribers: llvm-commits

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

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

6 years ago[Mips] Fix some Clang-tidy modernize-use-using and Include What You Use warnings...
Eugene Zelenko [Thu, 3 Aug 2017 22:12:30 +0000 (22:12 +0000)]
[Mips] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).

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

6 years agoDAG: Provide access to Pass instance from SelectionDAG
Matt Arsenault [Thu, 3 Aug 2017 21:54:00 +0000 (21:54 +0000)]
DAG: Provide access to Pass instance from SelectionDAG

This allows accessing an analysis pass during lowering.

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

6 years ago[GlobalISel] Make GlobalISel a non-optional library.
Quentin Colombet [Thu, 3 Aug 2017 21:52:25 +0000 (21:52 +0000)]
[GlobalISel] Make GlobalISel a non-optional library.

With this change, the GlobalISel library gets always built. In
particular, this is not possible to opt GlobalISel out of the build
using the LLVM_BUILD_GLOBAL_ISEL variable any more.

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

6 years ago[NewGVN] Fix the case where we have a phi-of-ops which goes away.
Davide Italiano [Thu, 3 Aug 2017 21:17:49 +0000 (21:17 +0000)]
[NewGVN] Fix the case where we have a phi-of-ops which goes away.

Patch by Daniel Berlin, fixes PR33196 (and probably something else).

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

6 years ago[PDB] Fix section contributions
Reid Kleckner [Thu, 3 Aug 2017 21:15:09 +0000 (21:15 +0000)]
[PDB] Fix section contributions

Summary:
PDB section contributions are supposed to use output section indices and
offsets, not input section indices and offsets.

This allows the debugger to look up the index of the module that it
should look up in the modules stream for symbol information. With this
change, windbg can now find line tables, but it still cannot print local
variables.

Fixes PR34048

Reviewers: zturner

Subscribers: hiraditya, ruiu, llvm-commits

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

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

6 years ago[LVI] Constant-propagate a zero extension of the switch condition value through case...
Hiroshi Yamauchi [Thu, 3 Aug 2017 21:11:30 +0000 (21:11 +0000)]
[LVI] Constant-propagate a zero extension of the switch condition value through case edges

Summary:
(This is a second attempt as https://reviews.llvm.org/D34822 was reverted.)

LazyValueInfo currently computes the constant value of the switch condition through case edges, which allows the constant value to be propagated through the case edges.

But we have seen a case where a zero-extended value of the switch condition is used past case edges for which the constant propagation doesn't occur.

This patch adds a small logic to handle such a case in getEdgeValueLocal().

This is motivated by the Python 2.7 eval loop in PyEval_EvalFrameEx() where the lack of the constant propagation causes longer live ranges and more spill code than necessary.

With this patch, we see that the code size of PyEval_EvalFrameEx() decreases by ~5.4% and a performance test improves by ~4.6%.

Reviewers: sanjoy

Reviewed By: sanjoy

Subscribers: llvm-commits

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

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

6 years agoMove unit test to the proper location
Taewook Oh [Thu, 3 Aug 2017 21:07:12 +0000 (21:07 +0000)]
Move unit test to the proper location

Summary: Move test/CodeGen/AArch64/reg-bank-128bit.mir to test/CodeGen/AArch64/GlobalISel/reg-bank-128bit.mir so that the test is executed only when global-isel is enabled. lit.local.cfg under test/CodeGen/AArch64/GlobalISel checks if 'global-isel' is in the available_features while the same file under test/CodeGen/AArch64 doesn't.

Reviewers: qcolombet, davide

Reviewed By: davide

Subscribers: davide, aemerson, javed.absar, igorb, kristof.beyls, llvm-commits

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

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

6 years ago[llvm-pdbutil] Allow diff to force module equivalencies.
Zachary Turner [Thu, 3 Aug 2017 20:30:09 +0000 (20:30 +0000)]
[llvm-pdbutil] Allow diff to force module equivalencies.

Sometimes the normal module equivalence detection algorithm doesn't
quite work.  For example, you might build the same program with
MSVC and clang-cl, outputting to different object files, exes, and
PDBs, then compare them.  If the object files have different names
though, then they won't be treated as equivalent.  This way we
can force specific module indices to be treated as equivalent.

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

6 years ago[libFuzzer] Un-reverting change in tests after fixing the failure on Linux.
George Karpenkov [Thu, 3 Aug 2017 20:28:16 +0000 (20:28 +0000)]
[libFuzzer] Un-reverting change in tests after fixing the failure on Linux.

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

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

6 years agotest commit
Connor Abbott [Thu, 3 Aug 2017 20:22:30 +0000 (20:22 +0000)]
test commit

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

6 years agoFix llvm-for-windows-on-linux build after LLVM r272701.
Nico Weber [Thu, 3 Aug 2017 20:10:47 +0000 (20:10 +0000)]
Fix llvm-for-windows-on-linux build after LLVM r272701.

The file is called "intrin.h". When building targeting Windows on a Linux
system, with the SDK mounted in a case-insensitive file system, "Intrin.h" will
miss clang's intrin.h header (because that's not in a case-insensitive file
system) but then find intrin.h in the Microsoft SDK. clang can't handle the
SDK's intrin.h.

https://reviews.llvm.org/D36281

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

6 years agoFix check-lit compatibility with multi-config CMake generators
Greg Bedwell [Thu, 3 Aug 2017 17:55:54 +0000 (17:55 +0000)]
Fix check-lit compatibility with multi-config CMake generators

Multi-configuration CMake generators such as those for Visual Studio or Xcode do not
specify a build config at configure time, but let the user choose at build
time.  In these cases binaries go into build/${Configuration}/bin rather than
build/bin.  Prior to this commit, check-lit would fail when using multi-configuration
generators as it did not know how to resolve ${Configuration} in order
to find tools such as FileCheck.  This commit teaches it to resolve
llvm_tools_dir within lit using the value specified with --param
build_mode.

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

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

6 years agoDisable loop peeling during full unrolling pass.
Teresa Johnson [Thu, 3 Aug 2017 17:52:38 +0000 (17:52 +0000)]
Disable loop peeling during full unrolling pass.

Summary:
Peeling should not occur during the full unrolling invocation early
in the pipeline, but rather later with partial and runtime loop
unrolling. The later loop unrolling invocation will also eventually
utilize profile summary and branch frequency information, which
we would like to use to control peeling. And for ThinLTO we want
to delay peeling until the backend (post thin link) phase, just as
we do for most types of unrolling.

Ensure peeling doesn't occur during the full unrolling invocation
by adding a parameter to the shared implementation function, similar
to the way partial and runtime loop unrolling are disabled.

Performance results for ThinLTO suggest this has a neutral to positive
effect on some internal benchmarks.

Reviewers: chandlerc, davidxl

Subscribers: mzolotukhin, llvm-commits, mehdi_amini

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

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

6 years agoDo not want to use BFI to get profile count for sample pgo
Dehao Chen [Thu, 3 Aug 2017 17:11:41 +0000 (17:11 +0000)]
Do not want to use BFI to get profile count for sample pgo

Summary: For SamplePGO, we already record the callsite count in the call instruction itself. So we do not want to use BFI to get profile count as it is less accurate.

Reviewers: tejohnson, davidxl, eraman

Reviewed By: eraman

Subscribers: sanjoy, llvm-commits, mehdi_amini

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

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

6 years ago[X86] Adding a test for vector shuffle extractions.
Simon Pilgrim [Thu, 3 Aug 2017 17:04:59 +0000 (17:04 +0000)]
[X86] Adding a test for vector shuffle extractions.

When both the vector inputs of the shuffle vector is comprising of same vector or shuffle mask is accessing elements from only one operand vector (like in PR33758 test already present).

Committed on behalf of @jbhateja (Jatin Bhateja)

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

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

6 years agoRevert "[AArch64] Simplify AES*Tied pseudo expansion (NFC)."
Tim Northover [Thu, 3 Aug 2017 16:59:36 +0000 (16:59 +0000)]
Revert "[AArch64] Simplify AES*Tied pseudo expansion (NFC)."

This reverts commit r309821.

My suggestion was wrong because it left the MachineOperands tied which
confused the verifier. Since there's no easy way to untie operands, the
original BuildMI solution is probably best.

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

6 years ago[X86][AVX512] Tidied up v64i8 vector shuffle tests with triple
Simon Pilgrim [Thu, 3 Aug 2017 16:56:52 +0000 (16:56 +0000)]
[X86][AVX512] Tidied up v64i8 vector shuffle tests with triple

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

6 years agoAMDGPU/SI: Don't fix a PHI under uniform branch in SIFixSGPRCopies only when sources...
Changpeng Fang [Thu, 3 Aug 2017 16:37:02 +0000 (16:37 +0000)]
AMDGPU/SI: Don't fix a PHI under uniform branch in SIFixSGPRCopies only when sources and destination are all sgprs

Summary:
  If a PHI has at lease one VGPR operand, we have to fix the PHI
in SIFixSGPRCopies.

Reviewer:
  Matt

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

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

6 years agoFix use after free in unit test.
Benjamin Kramer [Thu, 3 Aug 2017 15:59:37 +0000 (15:59 +0000)]
Fix use after free in unit test.

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

6 years ago[DAG] Allow merging of stores of vector loads
Nirav Dave [Thu, 3 Aug 2017 15:51:20 +0000 (15:51 +0000)]
[DAG]  Allow merging of stores of vector loads

Remove restriction disallowing merging of stores vector loads into
larger store of larger vector load.

Reviewers: RKSimon, efriedma, spatel

Subscribers: llvm-commits

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

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

6 years agoRevert r309923, it caused PR34045.
Nico Weber [Thu, 3 Aug 2017 15:41:26 +0000 (15:41 +0000)]
Revert r309923, it caused PR34045.

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

6 years ago[TableGen] AsmMatcher: fix OpIdx computation when HasOptionalOperands is true
Nirav Dave [Thu, 3 Aug 2017 15:40:21 +0000 (15:40 +0000)]
[TableGen] AsmMatcher: fix OpIdx computation when HasOptionalOperands is true

Consider the following instruction: "inst.eq $dst, $src" where ".eq"
is an optional flag operand.  The $src and $dst operands are
registers.  If we parse the instruction "inst r0, r1", the flag is not
present and it will be marked in the "OptionalOperandsMask" variable.
After the matching is complete we call the "convertToMCInst" method.

The current implementation works only if the optional operands are at
the end of the array.  The "Operands" array looks like [token:"inst",
reg:r0, reg:r1].  The first operand that must be added to the MCInst
is the destination, the r0 register.  The "OpIdx" (in the Operands
array) for this register is 2.  However, since the flag is not present
in the Operands, the actual index for r0 should be 1.  The flag is not
present since we rely on the default value.

This patch removes the "NumDefaults" variable and replaces it with an
array (DefaultsOffset).  This array contains an index for each operand
(excluding the mnemonic).  At each index, the array contains the
number of optional operands that should be subtracted.  For the
previous example, this array looks like this: [0, 1, 1].  When we need
to access the r0 register, we compute its index as 2 -
DefaultsOffset[1] = 1.

Patch by Alexandru Guduleasa!

Reviewers: SamWot, nhaustov, niravd

Subscribers: llvm-commits

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

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

6 years ago[NewGVN] fix typos; NFC
Sanjay Patel [Thu, 3 Aug 2017 15:18:27 +0000 (15:18 +0000)]
[NewGVN] fix typos; NFC

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

6 years ago[BDCE] add tests to show invalid/incomplete transforms
Sanjay Patel [Thu, 3 Aug 2017 15:07:37 +0000 (15:07 +0000)]
[BDCE] add tests to show invalid/incomplete transforms

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

6 years ago[GlobalISel] Only merge memory ops for mayLoad or mayStore instrs.
Florian Hahn [Thu, 3 Aug 2017 14:48:22 +0000 (14:48 +0000)]
[GlobalISel] Only merge memory ops for mayLoad or mayStore instrs.

Summary:
We only need to merge memory operands for instructions that access
 memory. This slightly reduces the number of actions executed.

Reviewers: MatzeB, rovka, dsanders

Reviewed By: dsanders

Subscribers: aemerson, igorb, kristof.beyls, llvm-commits

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

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

6 years ago[LiveDebugVariables] Use lexical scope to trim debug value live intervals
Robert Lougher [Thu, 3 Aug 2017 11:54:02 +0000 (11:54 +0000)]
[LiveDebugVariables] Use lexical scope to trim debug value live intervals

The debug value live intervals computed by Live Debug Variables may extend
beyond the range of the debug location's lexical scope. In this case,
splitting of an interval can result in an interval outside of the scope being
created, causing extra unnecessary DBG_VALUEs to be emitted. To prevent this,
trim the intervals to the lexical scope.

This resolves PR33730.

Reviewers: aprantl

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

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

6 years agoPrune linefeed at eof.
NAKAMURA Takumi [Thu, 3 Aug 2017 11:36:44 +0000 (11:36 +0000)]
Prune linefeed at eof.

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

6 years agollvm/Support/CodeGenCWrappers.h: Add missing "llvm/ADT/Optional.h", to fix modules...
NAKAMURA Takumi [Thu, 3 Aug 2017 11:36:42 +0000 (11:36 +0000)]
llvm/Support/CodeGenCWrappers.h: Add missing "llvm/ADT/Optional.h", to fix modules build.

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

6 years ago[SelectionDAG] Resolve PR33978.
Simon Dardis [Thu, 3 Aug 2017 09:38:46 +0000 (09:38 +0000)]
[SelectionDAG] Resolve PR33978.

rL306209 taught SelectionDAG how to add the dereferenceable flag when
expanding memcpy and memmove. The fix however contained a nit where
the offset + size was constructed as an APInt of PointerSize rather
than PointerSizeInBits.

This lead to isDereferenceableAndAlignedPointer() get truncated values or
values which would be sign extended within that function leading to
incorrect results.

Thanks to Alex Crichton for reporting the issue!

This resolves PR33978.

Reviewers: inouehrs

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

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

6 years agoRemoved unused variabled from unit test
Max Kazantsev [Thu, 3 Aug 2017 09:25:44 +0000 (09:25 +0000)]
Removed unused variabled from unit test

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

6 years ago[Cloning] Move distinct GlobalVariable debug info metadata in CloneModule
Ewan Crawford [Thu, 3 Aug 2017 09:23:03 +0000 (09:23 +0000)]
[Cloning] Move distinct GlobalVariable debug info metadata in CloneModule

Duplicating the distinct Subprogram and CU metadata nodes seems like the incorrect thing to do in CloneModule for GlobalVariable debug info. As it results in the scope of the GlobalVariable DI no longer being consistent with the rest of the module, and the new CU is absent from llvm.dbg.cu.

Fixed by adding RF_MoveDistinctMDs to MapMetadata flags for GlobalVariables.

Current unit test IR after clone:
```
@gv = global i32 1, comdat($comdat), !dbg !0, !type !5

define private void @f() comdat($comdat) personality void ()* @persfn !dbg !14 {

!llvm.dbg.cu = !{!10}

!0 = !DIGlobalVariableExpression(var: !1)
!1 = distinct !DIGlobalVariable(name: "gv", linkageName: "gv", scope: !2, file: !3, line: 1, type: !9, isLocal: false, isDefinition: true)
!2 = distinct !DISubprogram(name: "f", linkageName: "f", scope: null, file: !3, line: 4, type: !4, isLocal: true, isDefinition: true, scopeLine: 3, isOptimized: false, unit: !6, variables: !5)
!3 = !DIFile(filename: "filename.c", directory: "/file/dir/")
!4 = !DISubroutineType(types: !5)
!5 = !{}
!6 = distinct !DICompileUnit(language: DW_LANG_C99, file: !7, producer: "CloneModule", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, globals: !8)
!7 = !DIFile(filename: "filename.c", directory: "/file/dir")
!8 = !{!0}
!9 = !DIBasicType(tag: DW_TAG_unspecified_type, name: "decltype(nullptr)")
!10 = distinct !DICompileUnit(language: DW_LANG_C99, file: !7, producer: "CloneModule", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, globals: !11)
!11 = !{!12}
!12 = !DIGlobalVariableExpression(var: !13)
!13 = distinct !DIGlobalVariable(name: "gv", linkageName: "gv", scope: !14, file: !3, line: 1, type: !9, isLocal: false, isDefinition: true)
!14 = distinct !DISubprogram(name: "f", linkageName: "f", scope: null, file: !3, line: 4, type: !4, isLocal: true, isDefinition: true, scopeLine: 3, isOptimized: false, unit: !10, variables: !5)
```

Patched IR after clone:
```
@gv = global i32 1, comdat($comdat), !dbg !0, !type !5

define private void @f() comdat($comdat) personality void ()* @persfn !dbg !2 {

!llvm.dbg.cu = !{!6}

!0 = !DIGlobalVariableExpression(var: !1)
!1 = distinct !DIGlobalVariable(name: "gv", linkageName: "gv", scope: !2, file: !3, line: 1, type: !9, isLocal: false, isDefinition: true)
!2 = distinct !DISubprogram(name: "f", linkageName: "f", scope: null, file: !3, line: 4, type: !4, isLocal: true, isDefinition: true, scopeLine: 3, isOptimized: false, unit: !6, variables: !5)
!3 = !DIFile(filename: "filename.c", directory: "/file/dir/")
!4 = !DISubroutineType(types: !5)
!5 = !{}
!6 = distinct !DICompileUnit(language: DW_LANG_C99, file: !7, producer: "CloneModule", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, globals: !8)
!7 = !DIFile(filename: "filename.c", directory: "/file/dir")
!8 = !{!0}
!9 = !DIBasicType(tag: DW_TAG_unspecified_type, name: "decltype(nullptr)")
```

Reviewers: aprantl, probinson, dblaikie, echristo, loladiro
Reviewed By: aprantl
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D36082

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

6 years ago[ARM] GlobalISel: Select simple G_GLOBAL_VALUE instructions
Diana Picus [Thu, 3 Aug 2017 09:14:59 +0000 (09:14 +0000)]
[ARM] GlobalISel: Select simple G_GLOBAL_VALUE instructions

Add support in the instruction selector for G_GLOBAL_VALUE for ELF and
MachO for the static relocation model. We don't handle Windows yet
because that's Thumb-only, and we don't handle Thumb in general at the
moment.

Support for PIC, ROPI, RWPI and TLS will be added in subsequent commits.

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

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

6 years ago[X86] SET0 to use XMM registers where possible PR26018 PR32862
Dinar Temirbulatov [Thu, 3 Aug 2017 08:50:18 +0000 (08:50 +0000)]
[X86] SET0 to use XMM registers where possible PR26018 PR32862

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

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

6 years ago[SCEV] Re-enable "Cache results of computeExitLimit"
Max Kazantsev [Thu, 3 Aug 2017 08:41:30 +0000 (08:41 +0000)]
[SCEV] Re-enable "Cache results of computeExitLimit"

The patch rL309080 was reverted because it did not clean up the cache on "forgetValue"
method call. This patch re-enables this change, adds the missing check and introduces
two new unit tests that make sure that the cache is cleaned properly.

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

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

6 years ago[globalisel][tablegen] Update a comment to use the name of the constant rather than...
Daniel Sanders [Thu, 3 Aug 2017 08:38:04 +0000 (08:38 +0000)]
[globalisel][tablegen] Update a comment to use the name of the constant rather than the value.

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