139831 Commits

Author SHA1 Message Date
Guozhi Wei
8bb12b9f5e [PPC] Shorter sequence to load 64bit constant with same hi/lo words
This is a patch to implement pr30640.

When a 64bit constant has the same hi/lo words, we can use rldimi to copy the low word into high word of the same register.

This optimization caused failure of test case bperm.ll because of not optimal heuristic in function SelectAndParts64. It chooses AND or ROTATE to extract bit groups from a register, and OR them together. This optimization lowers the cost of loading 64bit constant mask used in AND method, and causes different code sequence. But actually ROTATE method is better in this test case. The reason is in ROTATE method the final OR operation can be avoided since rldimi can insert the rotated bits into target register directly. So this patch also enhances SelectAndParts64 to prefer ROTATE method when the two methods have same cost and there are multiple bit groups need to be ORed together.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284276 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 20:41:50 +00:00
Kostya Serebryany
58313a9d67 [libFuzzer] remove subdir fuzzer-test-suite as it is now superseded with https://github.com/google/fuzzer-test-suite
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284275 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 20:26:40 +00:00
Kostya Serebryany
3af68729f8 [libFuzzer] add -trace_cmp=1 (guiding mutations based on the observed CMP instructions). This is a reincarnation of the previously deleted -use_traces, but using a different approach for collecting traces. Still a toy, but at least it scales well. Also fix -merge in trace-pc-guard mode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284273 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 20:20:33 +00:00
Saleem Abdulrasool
775adebaec vim: add norecurse attribute
Add missing attribute to the keyword set.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284270 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 19:48:34 +00:00
Saleem Abdulrasool
59cf785a62 vim: add comdat keyword
The attribute may be applied to a function.  Highlight it as a keyword.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284269 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 19:48:31 +00:00
Sanjay Patel
1167ade633 [DAG] avoid creating illegal node when transforming negated shifted sign bit
Eli noted this potential bug in the post-commit thread for:
https://reviews.llvm.org/rL284239
...but I'm not sure how to trigger it, so there's no test case yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284268 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 19:46:31 +00:00
Tom Stellard
18cea770a0 AMDGPU/SI: Use new SimplifyDemandedBits helper for multi-use operations
Summary:
We are using this helper for our 24-bit arithmetic combines, so we are now able to eliminate multi-use operations that mask the high-bits of 24-bit inputs (e.g. and x, 0xffffff)

Reviewers: arsenm, nhaehnle

Subscribers: tony-tye, arsenm, kzhuravl, wdng, nhaehnle, llvm-commits, yaxunl

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284267 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 19:14:29 +00:00
Tom Stellard
2e1f3bbb4b TargetLowering: Add SimplifyDemandedBits() helper to TargetLoweringOpt
Summary:
The main purpose of this new helper is to enable simplifying operations that
have multiple uses.  SimplifyDemandedBits does not handle multiple uses
currently, and this new function makes it possible to optimize:

and v1, v0, 0xffffff
mul24 v2, v1, v1      ; Multiply ignoring high 8-bits.

To:

mul24 v2, v0, v0

Where before this would not be optimized, because v1 has multiple uses.

Reviewers: bogner, arsenm

Subscribers: nhaehnle, wdng, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284266 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 19:14:26 +00:00
Krzysztof Parzyszek
e5a36c1fc3 The real fix for post-r284255 failures
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284264 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 19:06:25 +00:00
Krzysztof Parzyszek
a22fe3ecda Workaround to eliminate check-llvm failures after r284255
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284262 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 18:36:42 +00:00
David L Kreitzer
4475acba12 Add a pass to optimize patterns of vectorized interleaved memory accesses for
X86. The pass optimizes as a unit the entire wide load + shuffles pattern
produced by interleaved vectorization. This initial patch optimizes one pattern
(64-bit elements interleaved by a factor of 4). Future patches will generalize
to additional patterns.

Patch by Farhana Aleen

Differential revision: http://reviews.llvm.org/D24681


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284260 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 18:20:41 +00:00
Tom Stellard
a9c6165732 AMDGPU/SI: Don't allow unaligned scratch access
Summary: The hardware doesn't support this.

Reviewers: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, llvm-commits, tony-tye

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284257 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 18:10:39 +00:00
Krzysztof Parzyszek
4869102e4f [RDF] Switch RegisterRef to be a pair (Register, LaneMask)
Use PackedRegisterRef to store the register information in the graph nodes.

This commit also removes support for virtual registers. It has never been
tested or used. It will be possible to add it back if there is a need.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284255 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 17:57:55 +00:00
David L Kreitzer
a7945e6304 [safestack] Use non-thread-local unsafe stack pointer for Contiki OS
Patch by Michael LeMay

Differential revision: http://reviews.llvm.org/D19852


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284254 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 17:56:00 +00:00
Eric Christopher
a79c08f373 Revert "In preparation for removing getNameWithPrefix off of
TargetMachine," as it's causing sanitizer/memory issues until I
can track down this set.

This reverts commit r284203

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284252 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 17:28:23 +00:00
Vedant Kumar
20bdbbe5e9 [Coverage] Support loading multiple binaries into a CoverageMapping
Add support for loading multiple coverage readers into a single
CoverageMapping instance. This should make it easier to prepare a
unified coverage report for multiple binaries.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284251 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 17:16:53 +00:00
Rafael Espindola
7c52e33346 Move alignTo computation inside the if.
This is an improvement when compiling with llvm. llvm doesn't inline
the call to insert, so the align is always executed and shows up in
the profile.

With gcc the call to insert is inlined and the align computation moved
and done only if needed.

With this patch we explicitly only compute it if it is needed.

In the two tests with debug info, the speedup was

scylla
  master 3.008959365
  patch  2.932080942 1.02621974786x faster

firefox
  master 6.709823604
  patch  6.592387227 1.01781393795x faster

In all others the difference was in the noise.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284249 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 17:01:39 +00:00
Pierre Gousseau
4594395329 [X86] Take advantage of the lzcnt instruction on btver2 architectures when ORing comparisons to zero.
This change adds transformations such as:
  zext(or(setcc(eq, (cmp x, 0)), setcc(eq, (cmp y, 0))))
  To:
  srl(or(ctlz(x), ctlz(y)), log2(bitsize(x))
This optimisation is beneficial on Jaguar architecture only, where lzcnt has a good reciprocal throughput.
Other architectures such as Intel's Haswell/Broadwell or AMD's Bulldozer/PileDriver do not benefit from it.
For this reason the change also adds a "HasFastLZCNT" feature which gets enabled for Jaguar.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284248 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 16:41:38 +00:00
Sanjay Patel
7aaf99b572 [InstCombine] use m_APInt to allow sub with constant folds for splat vectors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284247 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 16:31:54 +00:00
Mehdi Amini
3b24221ca0 [docs] Update some obsolete information in BitCodeFormat docs.
Summary:
* Describe new (3.3) parameter attribute group encoding, leaving old encoding there with a note about legacy
* Bring TYPE_BLOCK docs up to date
* Remove docs about obsolete (pre 3.0) TYPE_SYMTAB_BLOCK, TST_CODE_ENTRY
* Fix a couple of incorrect comments and remove one unused enum definition along the way

This addresses https://llvm.org/bugs/show_bug.cgi?id=28941.

Patch by: Ismail Badawi <ibadawi@cisco.com>

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284246 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 16:23:09 +00:00
Sanjay Patel
328dede65f [InstCombine] add tests for missing vector folds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284245 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 15:55:34 +00:00
Sanjay Patel
a85c77ddfc [InstCombine] auto-generate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284244 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 15:41:25 +00:00
Sanjay Patel
e2ba2cb572 [InstCombine] remove redundant test
This test was apparently checking for 2 independent folds, but we have
plenty of tests for those individual folds already. We are lacking
vector tests, however, because we don't have the shift folds for vectors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284243 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 15:36:28 +00:00
Sanjay Patel
e6ec388ee9 [InstCombine] update test to use FileCheck and auto-generate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284242 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 15:30:31 +00:00
Sanjay Patel
1d3aecea02 [InstCombine] sub X, sext(bool Y) -> add X, zext(bool Y)
Prefer add/zext because they are better supported in terms of value-tracking.

Note that the backend should be prepared for this IR canonicalization 
(including vector types) after:
https://reviews.llvm.org/rL284015

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284241 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 15:24:31 +00:00
David L Kreitzer
9b8425db90 Define "contiki" OS specifier.
Patch by Michael LeMay

Differential revision: http://reviews.llvm.org/D24897


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284240 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 14:41:46 +00:00
Sanjay Patel
66c0dee698 [DAG] add folds for negated shifted sign bit
The same folds exist in InstCombine already.

This came up as part of:
https://reviews.llvm.org/D25485



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284239 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 14:26:47 +00:00
Sanjay Patel
7f74decc60 [x86] add tests to show missing folds for negated shifted sign bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284238 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 14:14:40 +00:00
Nicolai Haehnle
877e3beed6 AMDGPU: Select 64-bit {ADD,SUB}{C,E} nodes
Summary:
This will be used for 64-bit MULHU, which is in turn used for the 64-bit
divide-by-constant optimization (see D24822).

Reviewers: arsenm, tstellarAMD

Subscribers: kzhuravl, wdng, yaxunl, llvm-commits, tony-tye

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284224 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 10:30:00 +00:00
Diana Picus
d1a990ddbb [GlobalISel] Get the AArch64 tests to work on Linux
Mostly this just means changing the triple from aarch64-apple-ios to the generic
aarch64--. Only one test needs more significant changes, but GlobalISel already
does the right thing so it's ok to just change the checks.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284223 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 10:19:40 +00:00
Nicolai Haehnle
9b219839bc Fix use-after-frees
Extracted from D25313, as suggested by Justin Bogner.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284220 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 09:49:51 +00:00
Simon Dardis
5acb9d0671 [mips] Fix aui/daui/dahi/dati for MIPSR6
For compatiblity with binutils, define these instructions to take
two registers with a 16bit unsigned immediate. Both of the registers
have to be same for dahi and dati.

Reviewers: dsanders, zoran.jovanovic

Differential Review: https://reviews.llvm.org/D21473


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284218 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 09:31:42 +00:00
Nicolai Haehnle
5d662038f2 AMDGPU: Fix use-after-frees
Reviewers: arsenm, tstellarAMD

Subscribers: kzhuravl, wdng, yaxunl, tony-tye, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284215 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 09:03:04 +00:00
Michael Zuckerman
e0043a340f [x86][ms-inline-asm] use of "jmp short" in asm is not supported
Committing in the name of Ziv Izhar: After check-all and LGTM .

The following patch is for compatability with Microsoft.
Microsoft ignores the keyword "short" when used after a jmp, for example:
__asm {
      jmp short label
      label:
      }

A test for that patch will be added in another patch, since it's located in clang's codegen tests. Link will be added shortly.
link to test: https://reviews.llvm.org/D24958

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284211 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 08:09:40 +00:00
Craig Topper
cfa4f53d33 [DAGCombiner] Teach createBuildVecShuffle to handle cases where input vectors are less than half of the output vector size.
This will be needed by a future commit to support sign/zero extending from v8i8 to v8i64 which requires a sign/zero_extend_vector_inreg to be created which requires v8i8 to be concatenated upto v64i8 and goes through this code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284204 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 06:00:42 +00:00
Eric Christopher
172ce59e75 In preparation for removing getNameWithPrefix off of TargetMachine,
sink the current behavior into the callers and sink
TargetMachine::getNameWithPrefix into TargetMachine::getSymbol.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284203 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 05:47:41 +00:00
Eric Christopher
ea40df32e3 Tidy the calls to getCurrentSection().first -> getCurrentSectionOnly to help
readability a bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284202 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 05:47:37 +00:00
Eric Christopher
c675e3184b Tidy up example of getting the pointer size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284201 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 05:45:46 +00:00
Konstantin Zhuravlyov
a91924b28a [AMDGPU] Emit 32-bit lo/hi got and pc relative variant kinds for external and global address space variables
Differential Revision: https://reviews.llvm.org/D25562


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284196 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 04:37:34 +00:00
Konstantin Zhuravlyov
84208dd954 [AMDGPU] Add 32-bit lo/hi got and pc relative variant kinds and emit appropriate relocations
Differential Revision: https://reviews.llvm.org/D25548


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284195 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 04:21:32 +00:00
Konstantin Zhuravlyov
aa6ce79914 [Support/ELF/AMDGPU] Add 32-bit lo/hi got and pc relative relocations
Added relocation names:
  - R_AMDGPU_GOTPCREL32_LO
  - R_AMDGPU_GOTPCREL32_HI
  - R_AMDGPU_REL32_LO
  - R_AMDGPU_REL32_HI

AMDGPU isa only supports 32-bit immediates. In order to access 64-bit address we need to generate 32-bit lo/hi relocations, and do the right math (separate patch). Currently we only generate one 32 bit relocation for lower bits for each access, losing higher bits. Hence we need relocations listed above.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284191 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 04:03:49 +00:00
Mehdi Amini
15a3555c6d Add llvm:: in clEnumVal macro (NFC)
This allows to use llvm🆑:opt without `using namespace llvm;`

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284190 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 03:54:46 +00:00
Matthias Braun
ca81740460 Timer: Fix doxygen comments, use member initializer; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284181 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 00:17:19 +00:00
Teresa Johnson
0a9d04f218 Add interface for querying physical hardware concurrency
Summary:
This will be used by ThinLTO to set the amount of backend
parallelism, which performs better when restricted to the number
of physical cores (on X86 at least, where getHostNumPhysicalCores is
currently defined). If not available this falls back to
thread::hardware_concurrency.

Note I didn't add to the thread class since that is a typedef to
std::thread where available.

Reviewers: mehdi_amini

Subscribers: beanz, llvm-commits, mgorny

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284180 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 00:13:59 +00:00
Saleem Abdulrasool
6ec5391920 CodeGen: use MSVC division on windows itanium
Windows itanium is identical to MSVC when dealing with everything but C++.
Lower the math routines into msvcrt rather than compiler-rt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284175 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-13 23:00:11 +00:00
Saleem Abdulrasool
b0c1779a79 CodeGen: adjust floating point operations in Windows itanium
Windows itanium is equivalent to MSVC except in C++ mode.  Ensure that the
promote the 32-bit floating point operations to their 64-bit equivalences.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284173 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-13 22:38:15 +00:00
Sanjay Patel
52b9988f47 [DAG] hoist DL(N) and fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284170 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-13 22:27:10 +00:00
Kostya Serebryany
76edd8d153 [libFuzzer] more detailed message for disabled leak detection
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284169 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-13 22:24:10 +00:00
Tom Stellard
e900cee9fd LegalizeDAG: Implement PROMOTE for ISD::BITREVERSE
Summary:
This operation is promoted the same way was ISD::BSWAP.  This will
prevent a regression in test/Target/AMDGOU/bitreverse.ll when i16
support is implemented.

Reviewers: bogner, hfinkel

Subscribers: hfinkel, wdng, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284163 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-13 21:03:49 +00:00
David L Kreitzer
120f92e074 [safestack] Reapply r283248 after moving X86-targeted SafeStack tests into
the X86 subdirectory. Original commit message:

Requires a valid TargetMachine to be passed to the SafeStack pass.

Patch by Michael LeMay

Differential revision: http://reviews.llvm.org/D24896


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284161 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-13 20:57:51 +00:00