147751 Commits

Author SHA1 Message Date
Sanjoy Das
fe33eb8710 Tighten the API for ScalarEvolutionNormalization
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300331 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-14 15:49:59 +00:00
Sanjoy Das
cfd7f99b33 Remove NormalizeAutodetect; NFC
It is cleaner to have a callback based system where the logic of
whether an add recurrence is normalized or not lives on IVUsers.

This is one step in a multi-step cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300330 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-14 15:49:53 +00:00
Krzysztof Parzyszek
c7e0860814 [Hexagon] Make a couple of passes compliant with -opt-bisect-limit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300329 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-14 15:26:34 +00:00
Simon Pilgrim
c15f9695db [Bugpoint] Use boolean AND instead of bitwise AND (PR32660)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300327 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-14 15:21:15 +00:00
Simon Pilgrim
99a634fdf1 [X86][SSE] Update MOVNTDQA non-temporal loads to generic implementation (LLVM)
MOVNTDQA non-temporal aligned vector loads can be correctly represented using generic builtin loads, allowing us to remove the existing x86 intrinsics.

Clang companion patch: D31766.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300325 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-14 15:05:35 +00:00
Nirav Dave
693dd9f10c Fix missing virtual destructor to silence build warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300322 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-14 13:34:33 +00:00
Nirav Dave
ede58cd844 Reorder StoreMergeCandidates to run faster. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300321 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-14 13:34:30 +00:00
Dmitry Preobrazhensky
7ad0e8bdbf [AMDGPU][MC] Corrected ds_write_src2_* to require one offset instead of two.
Fixed bug 32551: https://bugs.llvm.org//show_bug.cgi?id=32551

Reviewers: vpykhtin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300319 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-14 12:28:07 +00:00
Dmitry Preobrazhensky
e0e3f37944 [AMDGPU][MC] Enabled constants for src operands of s_cbranch_g_fork
Fixed bug 32619: https://bugs.llvm.org//show_bug.cgi?id=32619

Reviewers: artem.tamazov, vpykhtin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300318 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-14 11:52:26 +00:00
Andrew V. Tischenko
613b188e31 Fix for PR#30562: Selection DAG error: Detected cycle in SelectionDAG.
Patch by Dinar Temirbulatov


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300314 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-14 09:17:09 +00:00
Alex Denisov
1ad79db10e Add more test cases for StringRef::edit_distance
Example strings taken from here: http://www.let.rug.nl/~kleiweg/lev/



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300312 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-14 08:34:32 +00:00
Andrew V. Tischenko
3796561c6e This patch closes PR#32216: Better testing of schedule model instruction latencies/throughputs.
The details are here: https://reviews.llvm.org/D30941


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300311 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-14 07:44:23 +00:00
Gil Rapaport
e92557c930 [LV] Remove implicit single basic block assumption
This patch is part of D28975's breakdown - no change in output intended.

LV's code currently assumes the vectorized loop is a single basic block up
until predicateInstructions() is called. This patch removes two manifestations
of this assumption (loop phi incoming values, dominator tree update) by
replacing the use of vectorLoopBody with the vectorized loop's latch/header.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300310 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-14 07:30:23 +00:00
Craig Topper
3557926315 [ValueTracking] Calculate the KnownZeros for Intrinsic::ctpop without using a temporary APInt to count leading zeros on.
The APInt was created from an 'unsigned' and we just wanted to know how many bits the value needed to represent it. We can just use Log2_32 from MathExtras.h to get the info.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300309 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-14 06:43:34 +00:00
Craig Topper
7796f70177 [ValueTracking] Use APInt::isNegative(). NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300308 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-14 06:43:32 +00:00
Craig Topper
24f1072151 [ValueTracking] Use APInt::sext instead of zext and setBitsFrom. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300307 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-14 06:43:29 +00:00
Craig Topper
d62c8b3151 [InstCombine] Use APInt::setSignBit and APInt::isNegative(). NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300305 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-14 05:09:04 +00:00
Xinliang David Li
de136fdf4c Fix test failure on windows: pass module to getInstrProfXXName calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300302 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-14 03:03:24 +00:00
Peter Collingbourne
a9b9e013db Object, LTO: Add target triple to irsymtab and LTO API.
Start using it in LLD to avoid needing to read bitcode again just to get the
target triple, and in llvm-lto2 to avoid printing symbol table information
that is inappropriate for the target.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300300 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-14 02:55:06 +00:00
Daniel Berlin
c432779417 NewGVN: Don't propagate over phi backedges where undef causes us to
have >1 value, unless we can prove the phi node is cycle free.

Fixes PR 32607.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300299 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-14 02:53:37 +00:00
Sanjoy Das
96ed206326 Use range-for; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300292 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-14 01:33:15 +00:00
Sanjoy Das
5dbce153e7 Use transform instead of manual loop; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300291 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-14 01:33:13 +00:00
NAKAMURA Takumi
0b8d594c8b LLVMCodeGen: Add ProfileData into deps corresponding to r300277.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300289 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-14 00:36:06 +00:00
Stanislav Mekhanoshin
b02882850b [AMDGPU] added SIInstrInfo::getAddNoCarry() helper
Addressed rest of post submit comments from D31993.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300288 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-14 00:33:44 +00:00
Lang Hames
cf5b18b700 [ORC] Re-enable the Error/Expected unit tests that were disabled in r300177.
The tests were failing due to an occasional deadlock in SerializationTraits
for Error: Both serializers and deserializers were protected by a single
mutex and in the unit test (where both ends of the RPC are in the same
process) one side might obtain the mutex, then block waiting for input,
leaving the other side of the connection unable to obtain the mutex to
write the data the first side was waiting for. Splitting the mutex into
two (one for serialization, one for deserialization) appears to have fixed the
issue.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300286 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-14 00:06:12 +00:00
Reid Kleckner
fefad770b8 Simplify some Verifier attribute checks with AttributeSet
Now that we have a type that can represent the attributes on a single
return, function, or parameter, we can pass it around directly rather
than passing around AttributeList and Idx. Removes some more one-based
argument attribute index counting.

NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300285 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-14 00:06:06 +00:00
Matthias Braun
dc1a361ccd MIRLangRef: Add a section on simplifying .mir tests
Differential Revision: http://reviews.llvm.org/D32058

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300282 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 23:45:14 +00:00
Xinliang David Li
2fc706bf3c [Profile] PE binary coverage bug fix
PR/32584

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300277 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 23:37:12 +00:00
Adam Nemet
0100c808ce [AArch64] Avoid partial register writes on lane 0 of BUILD_VECTOR for i8/i16/f16
This further improves Ahmed's change in rL299482.  See the new comment for the
rationale.

The patch recovers most of the regression for bzip2 after D31965. We're down
to +2.68% from +6.97%.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300276 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 23:32:47 +00:00
Konstantin Zhuravlyov
2b1bb6d8f8 AMDGPU/GFX9: Do not use v_pack_b32_f16 when packing
Differential Revision: https://reviews.llvm.org/D31819


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300275 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 23:17:00 +00:00
Hans Wennborg
c941e1f94e build_llvm_package.bat: Move to VS2017
It's required for building the clang-format plugin after r300225.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300273 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 23:13:23 +00:00
Reid Kleckner
1c35defd74 [IR] Make getParamAttributes take argument numbers, not ArgNo+1
Add hasParamAttribute() and use it instead of hasAttribute(ArgNo+1,
Kind) everywhere.

The fact that the AttributeList index for an argument is ArgNo+1 should
be a hidden implementation detail.

NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300272 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 23:12:13 +00:00
Alexei Starovoitov
c67ef6aaf7 [bpf] Fix memory offset check for loads and stores
If the offset cannot fit into the instruction, an addition to the
pointer is emitted before the actual access. However, BPF offsets are
16-bit but LLVM considers them to be, for the matter of this check,
to be 32-bit long.

This causes the following program:

int bpf_prog1(void *ign)
{

volatile unsigned long t = 0x8983984739ull;
return *(unsigned long *)((0xffffffff8fff0002ull) + t);

}

To generate the following (wrong) code:

0: 18 01 00 00 39 47 98 83 00 00 00 00 89 00 00 00

r1 = 590618314553ll

2: 7b 1a f8 ff 00 00 00 00 *(u64 *)(r10 - 8) = r1
3: 79 a1 f8 ff 00 00 00 00 r1 = *(u64 *)(r10 - 8)
4: 79 10 02 00 00 00 00 00 r0 = *(u64 *)(r1 + 2)
5: 95 00 00 00 00 00 00 00 exit

Fix it by changing the offset check to 16-bit.

Patch by Nadav Amit <nadav.amit@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Differential Revision: https://reviews.llvm.org/D32055

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300269 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 22:24:13 +00:00
Matthias Braun
1130138bb1 MIRLangRef: Simplify/update documentation
- Refer to options by `-option` instead of `option`
- Use `-mtriple=` instead of `-march` in the example (-march will still
  target the default operating system which is usually not what you want
  in a test)
- Rephrase sentence because output does not go to stdout by default (you
  need -o - for that as should be expected).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300268 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 22:14:45 +00:00
Teresa Johnson
6ac17df7d7 [Support] Fix ErrorOr assertion when /proc/cpuinfo doesn't exist.
The ErrorOr should not be dereferenced on the error path.

Patch by Jacob Young

Reviewers: tejohnson

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300267 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 21:51:49 +00:00
Craig Topper
e7866ab180 [InstCombine] Use APInt::getBitsSetFrom instead of inverting the result of getLowBitsSet. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300265 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 21:49:48 +00:00
Petr Hosek
ed85367738 [CMake][runtimes] Use -nodefaultlibs for the runtimes build
We may not have a working C++ standard library at this point so we
shouldn't rely on it when running CMake checks.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300260 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 21:29:03 +00:00
Zachary Turner
10683346a5 [llvm-pdbdump] Recursively dump class layout.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300258 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 21:11:00 +00:00
Craig Topper
a402bd1ba7 [ValueTracking] Remove duplicate call to computeKnownBits for the operands of Select.
We call it unconditionally on the operands of the select. Then decide if its a min/max and call it on the min/max operands or on the select operands again. Either of those second calls will overwrite the results of the initial call so we can just delete the first call.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300256 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 20:39:37 +00:00
Davide Italiano
77643b4d4f [LCSSA] Efficiently compute blocks dominating at least one exit.
For LCSSA purposes, loop BBs not dominating any of the exits aren't
interesting, as none of the values defined in these blocks can be
used outside the loop.

The way the code computed this information was by comparing each
BB of the loop with each of the exit blocks and ask the dominator tree
about their dominance relation. This is slow.

A more efficient way, implemented here, is that of starting from the
exit blocks and walking the dom upwards until we hit an header. By
transitivity, all the blocks we encounter in our path dominate an exit.

For the testcase provided in PR31851, this reduces compile time on
`opt -O2` by ~25%, going from 1m47s to 1m22s.

Thanks to Dan/MichaelZ for discussions/suggesting the approach/review.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300255 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 20:36:59 +00:00
Reid Kleckner
85740fd11e Fix -Wunused-value warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300254 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 20:32:58 +00:00
Richard Smith
ef30b29ef5 Revert accidentally-committed files in r300252.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300253 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 20:31:21 +00:00
Richard Smith
74413b926a Remove all allocation and divisions from GreatestCommonDivisor
Switch from Euclid's algorithm to Stein's algorithm for computing GCD. This
avoids the (expensive) APInt division operation in favour of bit operations.
Remove all memory allocation from within the GCD loop by tweaking our `lshr`
implementation so it can operate in-place.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300252 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 20:29:59 +00:00
Reid Kleckner
caf5bedd42 [InstCombine] Fix !prof metadata preservation for invokes
Summary:
Bug noticed by inspection.

Extend the test to handle invokes as well as calls, and rewrite it to
not depend on the inliner and other passes.

Also simplify the call site replacement code with CallSite, similar to
what I did to dead arg elimination and arg promotion (rL300235 and
rL300229).

Reviewers: danielcdh, davidxl

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300251 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 20:26:38 +00:00
Davide Italiano
c099906b13 [LCSSA] Assert that we always have a valid loop.
We could otherwise add BBs not belonging to a loop in `formLCSSA`
and later crash when trying to iterate the loop blocks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300244 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 20:05:37 +00:00
Davide Italiano
24b800cc1d [LCSSA] Remove spurious whitespaces. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300243 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 20:02:27 +00:00
Davide Italiano
3ce76120dd [LCSSA] Use auto when the type is obvious. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300242 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 20:01:30 +00:00
Nirav Dave
042486c448 [DAG] Fold away temporary vector in store candidate merge NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300241 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 20:00:27 +00:00
Dehao Chen
14eaa3c97f SamplePGO: convert callsite samples map key from callsite_location to callsite_location+callee_name
Summary: For iterative SamplePGO, an indirect call can be speculatively promoted to multiple direct calls and get inlined. All these promoted direct calls will share the same callsite location (offset+discriminator). With the current implementation, we cannot distinguish between different promotion candidates and its inlined instance. This patch adds callee_name to the key of the callsite sample map. And added helper functions to get all inlined callee samples for a given callsite location. This helps the profile annotator promote correct targets and inline it before annotation, and ensures all indirect call targets to be annotated correctly.

Reviewers: davidxl, dnovillo

Reviewed By: davidxl

Subscribers: andreadb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300240 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 19:52:10 +00:00
Craig Topper
e1c6ddcf64 [ValueTracking] Prevent a call to computeKnownBits if we already know the state of the bit we would calculate. Also reuse a temporary APInt instead of creating a new one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300239 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 19:04:45 +00:00