Commit Graph

141670 Commits

Author SHA1 Message Date
Lang Hames
85334ad0c5 [Object][MachO] Reference-ify some helper function arguments. NFC.
Changes all static helper functions in MachOObjectFile.cpp that expect a
non-null MachOObjectFile pointer to take a reference instead.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288608 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-04 01:56:10 +00:00
Dan Gohman
bbaf9cd246 [MC] Generalize MCContext's SectionSymbols field.
Change SectionSymbols so that it doesn't hard-code ELF types, so that
it can be used for non-ELF targets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288607 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 23:55:57 +00:00
Matt Arsenault
728c815331 DAG: Fold out out of bounds insert_vector_elt
getNode already prevents formation of out of bounds constant
extract_vector_elts. Do the same for insert_vector_elt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288603 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 23:03:26 +00:00
Dan Gohman
2a88a6dddf [WebAssembly] Eliminate an ad-hoc command-line argument.
Use the target triple to determine whether to run the explicit-locals
pass, rather than using a separate command-line argument.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288602 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 23:00:12 +00:00
Saleem Abdulrasool
46db4b27f2 AMDGPU: remove a couple of unused variables
lib/Target/AMDGPU/SIRegisterInfo.cpp: In member function 'void llvm::SIRegisterInfo::spillSGPR(llvm::MachineBasicBlock::iterator, int, llvm::RegScavenger*) const':
	lib/Target/AMDGPU/SIRegisterInfo.cpp:572:30: warning: variable 'SubRC' set but not used [-Wunused-but-set-variable]
	   const TargetRegisterClass *SubRC = nullptr;
	                              ^
	lib/Target/AMDGPU/SIRegisterInfo.cpp: In member function 'void llvm::SIRegisterInfo::restoreSGPR(llvm::MachineBasicBlock::iterator, int, llvm::RegScavenger*) const':
	lib/Target/AMDGPU/SIRegisterInfo.cpp:723:30: warning: variable 'SubRC' set but not used [-Wunused-but-set-variable]
	   const TargetRegisterClass *SubRC = nullptr;
	                              ^

The variable was assigned to, but never used.  The functions called did not
mutate state.  Simplify the logic and remove the variable.  Identified by gcc
5.4.0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288601 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 22:25:21 +00:00
Saleem Abdulrasool
0b69b1f43c build: allow specifying the component to llvm_install_symlink
Add an optional parameter to `llvm_install_symlink` which allows the symlink
installation to be placed into a specific component rather than the default
value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288600 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 22:03:24 +00:00
Justin Lebar
d0aaae3b9a [PM] Rename lookupPass to lookUpPass.
Summary:
"Lookup" is a noun ("lookup table"), "look up" is a verb ("look up
'table' in the dictionary").

Reviewers: chandlerc

Subscribers: silvas, llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288598 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 19:49:35 +00:00
Justin Lebar
8645bc796c [PM] Get rid of an unused variable in AnalysisManager::clear(IRUnitT&).
Reviewers: chandlerc

Subscribers: silvas, llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288597 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 19:49:31 +00:00
Justin Lebar
6aaaf4ab09 [PM] Consistently use curly braces rather than std::make_pair in AnalysisResults.find().
Reviewers: chandlerc

Subscribers: silvas, llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288596 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 19:49:27 +00:00
Justin Lebar
6f16e4a0ee [PM] Don't walk the AM's ResultsList if nothing was invalidated.
Summary:
Previously in AnalysisManager::invalidate(), we would walk the full
ResultsList even if we knew that nothing was invalidated.

Reviewers: chandlerc

Subscribers: silvas, llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288595 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 19:49:23 +00:00
Justin Lebar
0f33f0738f [PM] Make AnalysisManager::registerPass take its parameter by universal reference.
Summary:
Previously, we were forcing a copy if you passed an lvalue argument; now
we'll take it by reference.

Reviewers: chandlerc

Subscribers: mehdi_amini, silvas, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288594 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 19:49:19 +00:00
Justin Lebar
bd6d5760d3 [PM] Make PassManager's constructor explicit.
Reviewers: chandlerc

Subscribers: silvas, llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288593 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 19:49:15 +00:00
Justin Lebar
c8f08d85ab [PM] Make PreservedAnalyses::preserved take its parameter by const ref.
Summary: Previously we were unnecessarily copying the argument.

Reviewers: chandlerc

Subscribers: mehdi_amini, silvas, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288592 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 19:49:12 +00:00
Craig Topper
ad37a58d2d [AVX-512] Add many of the VPERM instructions to the load folding table. Move VPERMPDZri to the correct table.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288591 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 19:37:39 +00:00
Matt Arsenault
0f9eec21e0 AMDGPU: Clean up struct initializers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288590 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 18:22:49 +00:00
Sanjay Patel
d4ddede406 [InstSimplify] add more helper functions for SimplifyICmpInst; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288589 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 18:03:53 +00:00
Sanjay Patel
b7a44fa355 [InstSimplify] add helper functions for SimplifyICmpInst; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288588 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 17:30:22 +00:00
Craig Topper
ae10a1c682 [AVX-512] Add EVEX VPMADDUBSW and VPMADDWD to the load folding tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288587 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 17:19:15 +00:00
Sanjay Patel
20e9431b19 [InstCombine] change select type to eliminate bitcasts
This solves a secondary problem seen in PR6137:
https://llvm.org/bugs/show_bug.cgi?id=6137#c6

This is similar to the bitwise logic op fold added with:
https://reviews.llvm.org/rL287707

And like that patch, I'm artificially restricting the
transform from vector <-> scalar types until we're sure
that the backend can handle that. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288584 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 15:25:16 +00:00
Craig Topper
c018e3b303 [X86] Fix VEX encoded VPMADDUBSW to not be marked commutable.
This was accidentallly broken in r285515 when we started lowering the intrinsic to an ISD node. Should fix PR31241.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288578 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 05:35:44 +00:00
Craig Topper
09c0f52908 [X86] Add test cases demonstrating where we incorrectly commute VEX VPMADDUSBW due to a bug introduced in r285515.
I believe this is the cause of PR31241.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288577 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 05:35:38 +00:00
Michael Kuperstein
ceceabb371 Remove stale comment. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288572 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 01:59:13 +00:00
Haicheng Wu
f4638220d6 [TTI/CostModel] Correct the way getGEPCost() calls isLegalAddressingMode()
Fix a bug when we call isLegalAddressingMode() from getGEPCost().

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288569 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 01:57:24 +00:00
Kostya Serebryany
4732785cea [sanitizer-coverage] use IRB.SetCurrentDebugLocation after IRB.SetInsertPoint
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288568 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 01:43:30 +00:00
Matthias Braun
5bfd3196df testcase only works in a debug build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288567 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 01:42:32 +00:00
Mehdi Amini
bb4cc15a59 [doc] Add .arcconfig setup to the "how to work with a monorepo" section
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288562 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 01:04:40 +00:00
Matthias Braun
970538c0b4 AArch64CollectLOH: Rewrite as block-local analysis.
Previously this pass was using up to 5% compile time in some cases which
is a bit much for what it is doing. The pass featured a full blown
data-flow analysis which in the default configuration was restricted to a
single block.

This rewrites the pass under the assumption that we only ever work on a
single block. This is done in a single pass maintaining a state machine
per general purpose register to catch LOH patterns.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288561 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 00:52:56 +00:00
Guozhi Wei
9d91f9059d [ppc] Correctly compute the cost of loading 32/64 bit memory into VSR
VSX has instructions lxsiwax/lxsdx that can load 32/64 bit value into VSX register cheaply. That patch makes it known to memory cost model, so the vectorization of the test case in pr30990 is beneficial.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288560 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 00:41:43 +00:00
Ivan Krasin
8460d68f0a Support escaping in TrigramIndex.
Summary:
This is a follow up to r288303, where I have introduced TrigramIndex
to speed up SpecialCaseList for the cases when all rules are
simple wildcards, like *hello*wor.d*.

Here, I add support for escaping, so that it's possible to
specify rules like *c\+\+abi*.

Reviewers: pcc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288553 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02 23:30:16 +00:00
Zachary Turner
1a45ade2ce Resubmit "[LibFuzzer] Split FuzzerUtil for Posix and Windows."
This resubmits r288529, which was resubmitted because it broke a
fuzzer bot.  According to kcc@ the test that broke was flakey
and it is unlikely to be a result of this patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288549 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02 23:02:01 +00:00
Jacques Pienaar
8860d3c0df [lanai] Custom lowering of SHL_PARTS
Summary: Implement custom lowering of SHL_PARTS to enable lowering of left shift with larger than 32-bit shifts.

Reviewers: eliben, majnemer

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288541 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02 22:01:28 +00:00
Eugene Zelenko
fe88eab3e2 [IR] Fix some Clang-tidy modernize-use-equals-delete and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288540 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02 22:00:59 +00:00
Zachary Turner
609477eea7 Revert "[LibFuzzer] Split FuzzerUtil for Posix and Windows."
This reverts commit r288529, as it seems to introduce some
problems on the Linux bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288533 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02 20:54:56 +00:00
Dan Gohman
52e39958c8 [WebAssembly] Fix a compiler warning. NFC.
Fix a warning about a comparison between signed and unsigned integer
expressions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288532 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02 20:13:05 +00:00
Zachary Turner
a6ae0e2562 [LibFuzzer] Introduce a portable WeakAlias implementation.
Windows doesn't really support weak aliases, but with some
linker magic we can get something that's pretty close on
Windows.  This introduces an interface to accessing weakly
aliased symbols that will work on any platform.  Linker
magic changes to come in a separate patch.

Patch by Marcos Pividori
Differential Revision: https://reviews.llvm.org/D27235

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288530 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02 19:41:17 +00:00
Zachary Turner
fd186677a2 [LibFuzzer] Split FuzzerUtil for Posix and Windows.
Pave the way for separating out platform specific
utility functions into separate files.

Patch by Marcos Pividori
Differential Revision: https://reviews.llvm.org/D27234

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288529 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02 19:38:19 +00:00
Rong Xu
e72670cb54 [PGO] Fix PGO use ICE when there are unreachable BBs
For -O0 there might be unreachable BBs, which breaks the assumption that all the
BBs have an auxiliary data structure.  In this patch, we add another interface
called findBBInfo() so that a nullptr can be returned for the unreachable BBs
(and the callers can ignore those BBs).

This fixes the bug reported
https://llvm.org/bugs/show_bug.cgi?id=31209

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288528 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02 19:10:29 +00:00
Ulrich Weigand
49c2555361 [SystemZ] Support remaining atomic instructions
Add assembler support for all atomic instructions that weren't already
supported.  Some of those could be used to implement codegen for 128-bit
atomic operations, but this isn't done here yet.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288526 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02 18:24:16 +00:00
Ulrich Weigand
4b7476c294 [SystemZ] Support floating-point control register instructions
Add assembler support for instructions manipulating the FPC.

Also add codegen support via the GCC compatibility builtins:
  __builtin_s390_sfpc
  __builtin_s390_efpc



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288525 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02 18:21:53 +00:00
Ulrich Weigand
1f697f43c9 [SystemZ] Refactor hasSideEffects setting
Move setting of hasSideEffects out of SystemZInstrFormats.td,
to allow use of the format classes for instructions where this
flag shouldn't be set.  NFC.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288524 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02 18:19:22 +00:00
Matt Arsenault
76a17e03e0 AMDGPU: Implement isCheapAddrSpaceCast
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288523 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02 18:12:53 +00:00
Sanjay Patel
2fbac671c1 [x86] add common check prefix to reduce duplication; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288522 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02 17:58:26 +00:00
Adam Nemet
55f24b0567 [LTOs] Allow generation of hotness information
The flag is passed by the clang driver.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288519 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02 17:53:56 +00:00
Adam Nemet
371623998c Make LTO opt-remarks tests matching stricter
This ensures that we don't generate the hotness attribute by default.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288518 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02 17:53:49 +00:00
Sanjay Patel
b65cc896d9 fix check-label
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288517 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02 17:50:14 +00:00
Sanjay Patel
0acff68bfd [x86] add tests to show missing demanded bits analysis; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288515 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02 17:48:48 +00:00
Simon Pilgrim
88afddf69a [InstCombine] Add vector urem tests
Demonstrate missed opportunity for urem -> and combine for powerof2 or zero non-uniform constant dividers

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288510 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02 17:16:21 +00:00
Simon Pilgrim
d2c7981604 [InstCombine] Regenerate vector srem tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288509 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02 17:12:56 +00:00
Renato Golin
66e793d0de Revert "[SLP] Fix for PR6246: vectorization for scalar ops on vector elements."
This reverts commit r288497, as it broke the AArch64 build of Compiler-RT's
builtins (twice: once in r288412 and once in r288497). We should investigate
this offline.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288508 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02 16:56:26 +00:00
Nicolai Haehnle
42285f5cb7 [DAGCombiner] do not fold (fmul (fadd X, 1), Y) -> (fmad X, Y, Y) by default
Summary:
When X = 0 and Y = inf, the original code produces inf, but the transformed
code produces nan. So this transform (and its relatives) should only be
used when the no-infs-fp-math flag is explicitly enabled.

Also disable the transform using fmad (intermediate rounding) when unsafe-math
is not enabled, since it can reduce the precision of the result; consider this
example with binary floating point numbers with two bits of mantissa:

  x = 1.01
  y = 111

  x * (y + 1) = 1.01 * 1000 = 1010 (this is the exact result; no rounding occurs at any step)

  x * y + x = 1000.11 + 1.01 =r 1000 + 1.01 = 1001.01 =r 1000 (with rounding towards zero)

The example relies on rounding towards zero at least in the second step.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98578

Reviewers: RKSimon, tstellarAMD, spatel, arsenm

Subscribers: wdng, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288506 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02 16:06:18 +00:00