Commit Graph

151938 Commits

Author SHA1 Message Date
Simon Pilgrim
9a59c1b6f3 [X86] Add F16C scheduling tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308138 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-16 14:34:18 +00:00
Simon Pilgrim
3b094f2e91 [X86] Add POPCNT scheduling tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308137 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-16 14:22:39 +00:00
Simon Pilgrim
3cccc12f37 [X86] Add BMI2 scheduling tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308136 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-16 14:09:15 +00:00
Simon Pilgrim
6294089b16 [X86] Add BMI1 scheduling tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308135 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-16 13:59:44 +00:00
Simon Pilgrim
d4b88dfddf [X86] Add LZCNT scheduling tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308133 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-16 13:40:44 +00:00
Simon Pilgrim
298666c1b4 [X86][SSE4A] Add EXTRQ/INSERTQ values to BTVER2 scheduling model
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308132 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-16 12:06:06 +00:00
Simon Pilgrim
0ad8dddb9f [X86][AVX] Regenerate tests with constant broadcast comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308131 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-16 11:43:16 +00:00
Simon Pilgrim
a4a73ad242 [X86][AVX] Regenerate vector tzcnt tests with constant broadcast comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308130 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-16 11:40:23 +00:00
Simon Pilgrim
6d326a5991 [X86][AVX] Regenerate vector idiv tests with constant broadcast comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308129 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-16 11:38:14 +00:00
Simon Pilgrim
b55c234941 [X86][AVX] Regenerate combine tests with constant broadcast comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308128 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-16 11:36:11 +00:00
Hiroshi Inoue
e3b8cd6b61 fix typos in comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308127 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-16 08:11:56 +00:00
Hiroshi Inoue
2dd9bf3147 fix typos in comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308126 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-16 07:48:48 +00:00
Craig Topper
a72a0bef4d [InstSimplify] Use commutable matchers to simplify some code. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308125 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-16 06:57:41 +00:00
Craig Topper
279ac88b99 [InstCombine] Move (0 - x) & 1 --> x & 1 to SimplifyDemandedUseBits.
This removes a dedicated matcher and allows us to support more than just an AND masking the lower bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308124 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-16 05:37:58 +00:00
Teresa Johnson
d07283cddf Fix bot failures from r308114
Finally figured out that some bots were failing from r308114
with the message:
  llvm-lto2: LTO::run failed: No available targets are compatible with this triple.
after adding in some other checking that finally caused this to show up
in the FileCheck output.

Added "REQUIRES: x86-registered-target" which should fix it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308119 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-16 00:28:22 +00:00
Teresa Johnson
0feaa81d50 Attempt 2 to debug bot failures
Modify checks from r308114 even more, to see if I can narrow down
why some bots are still failing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308116 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-16 00:01:16 +00:00
Teresa Johnson
c30a2bafbd Attempt to debug bot failures
Simplifying checks from r308114, to see if I can narrow down why some
bots are still failing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308115 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-15 23:31:32 +00:00
Teresa Johnson
1599b9c3d6 Restore with fix "[ThinLTO] Ensure we always select the same function copy to import"
This restores r308078/r308079 with a fix for bot non-determinisim (make
sure we run llvm-lto in single threaded mode so the debug output doesn't get
interleaved).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308114 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-15 22:58:06 +00:00
Craig Topper
fce917909c [IR] Implement Constant::isNegativeZeroValue/isZeroValue/isAllOnesValue/isOneValue/isMinSignedValue for ConstantDataVector without going through getElementAsConstant
Summary:
Currently these methods call ConstantDataVector::getSplatValue which uses getElementsAsConstant to create a Constant object representing the element value. This method incurs a map lookup to see if we already have created such a Constant before and if not allocates a new Constant object.

This patch changes these methods to use getElementAsAPFloat and getElementAsInteger so we can just examine the data values directly.

Reviewers: spatel, pcc, dexonsmith, bogner, craig.topper

Reviewed By: craig.topper

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308112 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-15 22:06:19 +00:00
Craig Topper
1cadf61272 [InstCombine] Improve the expansion in SimplifyUsingDistributiveLaws to handle cases where one side doesn't simplify, but the other side resolves to an identity value
Summary:
If one side simplifies to the identity value for inner opcode, we can replace the value with just the operation that can't be simplified.

I've removed a couple now unneeded special cases in visitAnd and visitOr. There are probably other cases I missed.

Reviewers: spatel, majnemer, hfinkel, dberlin

Reviewed By: spatel

Subscribers: grandinj, llvm-commits, spatel

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308111 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-15 21:49:49 +00:00
Simon Pilgrim
4902f1b31a [X86][AVX] Regenerate tests with constant broadcast comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308110 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-15 21:17:35 +00:00
Simon Pilgrim
c877b6eac8 [X86][AVX] Regenerate tests with constant broadcast comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308109 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-15 20:28:09 +00:00
Simon Pilgrim
5cb1c23dce Strip trailing whitespace. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308108 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-15 19:29:19 +00:00
Reid Kleckner
4a5ccd44d5 [CodeView] Dump BuildInfoSym and ProcSym type indices
I need to print the type index in hex so that I can match it in
FileCheck for a test I'm writing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308107 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-15 18:10:39 +00:00
Reid Kleckner
0b189e17f8 Fix mis-use of std::lower_bound
Binary search in C++ is such a PITA. =/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308106 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-15 18:10:15 +00:00
Sanjay Patel
c09fbb030f [InstCombine] improve (1 << x) & 1 --> zext(x == 0) folding
1. Add a one-use check to prevent increasing instruction count.
2. Generalize the pattern matching to include vector types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308105 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-15 17:26:01 +00:00
Craig Topper
59f9abe0f8 [InstCombine] Add test cases for (X & (Y | ~X)) -> (X & Y) where the not is an inverted compare. NFC
Do the same for (X | (Y & ~X)) -> (X | Y)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308104 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-15 17:09:23 +00:00
Craig Topper
c301a9eeef [InstCombine] Move 4 test cases from a test that didn't use FileCheck and merge them into a existing test file. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308103 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-15 17:09:22 +00:00
Sanjay Patel
9e7e63adc7 [InstCombine] add tests for (1 << x) & 1 --> zext(x == 0) ; NFC
This fold hit the trifecta:
1. It was untested.
2. It oversteps (multiuse is not checked, so increases instruction count).
3. It is incomplete (doesn't work for vectors).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308102 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-15 15:55:07 +00:00
Chandler Carruth
49ca68c80a [wasm] Update two tests for r308025 which causes scheduling changes due
to the newly improved AA information.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308100 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-15 15:44:36 +00:00
Sanjay Patel
e039298b16 [InstCombine] allow (0 - x) & 1 --> x & 1 for vectors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308098 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-15 15:29:47 +00:00
Sanjay Patel
170e6bc8a4 [InstCombine] remove dead code/tests; NFCI
These patterns and tests were added to InstSimplify with:
https://reviews.llvm.org/rL303004


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308096 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-15 15:01:33 +00:00
Chandler Carruth
feeb38706f Revert r308078 (and subsequent tweak in r308079) which introduces a test
that appears to exhibit non-determinism and is flaking on the bots
pretty consistently.

r308078: [ThinLTO] Ensure we always select the same function copy to import
r308079: Require asserts in new test that uses debug flag

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308095 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-15 13:50:26 +00:00
Florian Hahn
e998b6e37f [LoopInterchange] Add some optimization remarks.
Reviewers: anemet, karthikthecool, blitz.opensource

Reviewed By: anemet

Subscribers: mzolotukhin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308094 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-15 13:13:19 +00:00
Nuno Lopes
4b03014d14 [docs] AliasAnalysis: clarify that PartialAlias doesn't enforce
objects to start at the same address

As discussed on the ML, there's consensus that this is what the implementations
do and it seems sensible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308090 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-15 09:09:24 +00:00
Chandler Carruth
ed504111e8 [PM/LCG] Teach the LazyCallGraph to maintain reference edges from every
function to every defined function known to LLVM as a library function.

LLVM can introduce calls to these functions either by replacing other
library calls or by recognizing patterns (such as memset_pattern or
vector math patterns) and replacing those with calls. When these library
functions are actually defined in the module, we need to have reference
edges to them initially so that we visit them during the CGSCC walk in
the right order and can effectively rebuild the call graph afterward.

This was discovered when building code with Fortify enabled as that is
a common case of both inline definitions of library calls and
simplifications of code into calling them.

This can in extreme cases of LTO-ing with libc introduce *many* more
reference edges. I discussed a bunch of different options with folks but
all of them are unsatisfying. They either make the graph operations
substantially more complex even when there are *no* defined libfuncs, or
they introduce some other complexity into the callgraph. So this patch
goes with the simplest possible solution of actual synthetic reference
edges. If this proves to be a memory problem, I'm happy to implement one
of the clever techniques to save memory here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308088 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-15 08:08:19 +00:00
Simon Atanasyan
b515119244 [mips] Handle the long-calls feature flags in the MIPS backend
If the `long-calls` feature flags is enabled, disable use of the `jal`
instruction. Instead of that call a function by by first loading its
address into a register, and then using the contents of that register.

Differential revision: https://reviews.llvm.org/D35168

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308087 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-15 07:14:25 +00:00
NAKAMURA Takumi
55ceb9c2d8 SystemZCodeGen: Update libdeps. r308024 introduced LoopDataPrefetchPass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308086 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-15 06:32:12 +00:00
Yonghong Song
d7e9378a79 bpf: fix a compilation bug due to unused variable for release build
Signed-off-by: Yonghong Song <yhs@fb.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308083 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-15 06:08:08 +00:00
Matt Arsenault
078c435803 AMDGPU: Return correct type during argument lowering
The type needs to be casted back to the original argument type.
Fixes an assert that for some reason is only run when
using -debug.

Includes an additional combine to avoid test regressions
from having conversions mixed with multiple Assert[SZ]ext
nodes. On subtargets where i16 is legal, this was producing an i32
register with an i16 AssertZExt, truncated to i16 with another i8
AssertZExt.

t2: i32,ch = CopyFromReg t0, Register:i32 %vreg0
t3: i16 = truncate t2
t5: i16 = AssertZext t3, ValueType:ch:i8
t6: i8 = truncate t5
t7: i32 = zero_extend t6

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308082 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-15 05:52:59 +00:00
Dinar Temirbulatov
31b76d9b4a [SLPVectorizer] Add an extra parameter to tryScheduleBundle function, NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308081 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-15 05:43:54 +00:00
Yonghong Song
7c423e0690 bpf: generate better lowering code for certain select/setcc instructions
Currently, for code like below,
===
  inner_map = bpf_map_lookup_elem(outer_map, &port_key);
  if (!inner_map) {
    inner_map = &fallback_map;
  }
===
the compiler generates (pseudo) code like the below:
===
  I1: r1 = bpf_map_lookup_elem(outer_map, &port_key);
  I2: r2 = 0
  I3: if (r1 == r2)
  I4:   r6 = &fallback_map
  I5: ...
===

During kernel verification process, After I1, r1 holds a state
map_ptr_or_null. If I3 condition is not taken
(path [I1, I2, I3, I5]), supposedly r1 should become map_ptr.
Unfortunately, kernel does not recognize this pattern
and r1 remains map_ptr_or_null at insn I5. This will cause
verificaiton failure later on.

Kernel, however, is able to recognize pattern "if (r1 == 0)"
properly and give a map_ptr state to r1 in the above case.

LLVM here generates suboptimal code which causes kernel verification
failure. This patch fixes the issue by changing BPF insn pattern
matching and lowering to generate proper codes if the righthand
parameter of the above condition is a constant. A test case
is also added.

Signed-off-by: Yonghong Song <yhs@fb.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308080 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-15 05:41:42 +00:00
Teresa Johnson
cf17bf01ef Require asserts in new test that uses debug flag
This should fix bot failures from r308078.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308079 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-15 05:27:57 +00:00
Teresa Johnson
5758e8da00 [ThinLTO] Ensure we always select the same function copy to import
Summary:
Check if the first eligible callee is under the instruction threshold.
Checking this on the first eligible callee ensures that we don't end
up selecting different callees to import when we invoke this routine
with different thresholds due to reaching the callee via paths that
are shallower or hotter (when there are multiple copies, i.e. with
weak or linkonce linkage). We don't want to leave the decision of which
copy to import up to the backend.

Reviewers: mehdi_amini

Subscribers: inglorion, fhahn, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308078 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-15 04:53:05 +00:00
Haicheng Wu
8c939cb97f [TTI] Refine the cost of EXT in getUserCost()
Now, getUserCost() only checks the src and dst types of EXT to decide it is free
or not. This change first checks the types, then calls isExtFreeImpl(), and
check if EXT can form ExtLoad at last. Currently, only AArch64 has customized
implementation of isExtFreeImpl() to check if EXT can be folded into its use.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308076 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-15 02:12:16 +00:00
Kostya Serebryany
2cf034ebb7 [libFuzzer] remove stale code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308075 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-15 01:31:40 +00:00
Jakub Kuderski
37b0ef0bdf [Dominators] Fix reachable visitation and reenable a unit test
This fixes a minor bug in insertion to a reachable node that caused
DominatorTree.InsertDeleteExhaustive flakiness. The patch also adds
a new testcase for this exact failure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308074 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-15 01:27:16 +00:00
Jakub Kuderski
eff738f7cf [Dominators] Temporarily disable a flaky unit test
The DominatorTree.InsertDeleteExhaustive uses a RNG with a
constant seed to generate different sequences of updates. The test
fails on some buildbots and this patch disables it for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308070 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-14 23:49:12 +00:00
Justin Bogner
948973b73f [libFuzzer] Allow non-fuzzer args after -ignore_remaining_args=1
With this change, libFuzzer will ignore any arguments after a sigil
argument, but it will preserve these arguments at the end of the
command line when launching subprocesses. Using this, its possible to
handle positional and single-dash arguments to the program under test
by discarding everything up to -ignore_remaining_args=1 in
LLVMFuzzerInitialize.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308069 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-14 23:33:04 +00:00
Adrian Prantl
f8411a4be9 Add missing space to comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308068 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-14 23:23:58 +00:00