Commit Graph

141766 Commits

Author SHA1 Message Date
Kostya Serebryany
d0c8980196 [libFuzzer] treat -rss_limit_mb=0 as no limit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288389 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 17:56:15 +00:00
Kuba Mracek
0be1dd284d Recommit r287403 (reverted in r287804): [lit] When setting SDKROOT on Darwin, use '--sdk macosx' to find the right SDK path.
This shouls now be safe and not break any more bots.  It's strictly better to use '--sdk macosx', otherwise xcrun can return weird things for example when you have Command Line Tools or the SDK installed into '/'.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288385 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 17:45:22 +00:00
Adam Nemet
36dece4b3b [GVN, OptDiag] Print the interesting instructions involved in missed load-elimination
[recommitting after the fix in r288307]

This includes the intervening store and the load/store that we're trying
to forward from in the optimization remark for the missed load
elimination.

This is hooked up under a new mode in ORE that allows for compile-time
budget for a bit more analysis to print more insightful messages.  This
mode is currently enabled for -fsave-optimization-record (-Rpass is
trickier since it is controlled in the front-end).

With this we can now print the red remark in http://lab.llvm.org:8080/artifacts/opt-view_test-suite/build/SingleSource/Benchmarks/Dhrystone/CMakeFiles/dry.dir/html/_org_test-suite_SingleSource_Benchmarks_Dhrystone_dry.c.html#L446

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288381 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 17:34:50 +00:00
Adam Nemet
04e94f7838 [GVN, OptDiag] Include the value that is forwarded in load elimination
[recommitting after the fix in r288307]

This requires some changes to the opt-diag API.  Hal and I have
discussed this at the Dev Meeting and came up with a streaming delimiter
(setExtraArgs) to solve this.

Arguments after this delimiter are only included in the optimization
records and not in the remarks printed in the compiler output.  (Note,
how in the test the content of the YAML file changes but the remarks on
the compiler output don't.)

This implements the green GVN message with a bug fix at line
http://lab.llvm.org:8080/artifacts/opt-view_test-suite/build/SingleSource/Benchmarks/Dhrystone/CMakeFiles/dry.dir/html/_org_test-suite_SingleSource_Benchmarks_Dhrystone_dry.c.html#L446

The fix is that now we properly include the constant value in the
message: "load of type i32 eliminated in favor of 7"

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288380 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 17:34:44 +00:00
Alexey Bataev
c35da94c10 [SLP] Additional tests with the cost of vector operations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288377 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 17:26:54 +00:00
Ulrich Weigand
a9d6e8b6ee [SystemZ] Fix applyFixup for 12-bit fixups
Now that we have fixups that only fill parts of a byte, it turns
out we have to mask off the bits outside the fixup area when
applying them.  Failing to do so caused invalid object code to
be emitted for bprp with a negative 12-bit displacement.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288374 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 17:10:27 +00:00
Alexey Bataev
7d6a2cb700 Revert "[SLP] Additional tests with the cost of vector operations."
This reverts commit a61718435fc4118c82f8aa6133fd81f803789c1e.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288371 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 16:45:04 +00:00
Adam Nemet
d53651aca3 [GVN] Basic optimization remark support
[recommitting after the fix in r288307]

Follow-on patches will add more interesting cases.

The goal of this patch-set is to get the GVN messages printed in
opt-viewer from Dhrystone as was presented in my Dev Meeting talk.  This
is the optimization view for the function (the last remark in the
function has a bug which is fixed in this series):
http://lab.llvm.org:8080/artifacts/opt-view_test-suite/build/SingleSource/Benchmarks/Dhrystone/CMakeFiles/dry.dir/html/_org_test-suite_SingleSource_Benchmarks_Dhrystone_dry.c.html#L430

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288370 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 16:40:32 +00:00
Alexey Bataev
d9c0875e6d [SLP] Additional tests with the cost of vector operations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288369 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 16:11:48 +00:00
Simon Pilgrim
25c80fbd2a [X86][SSE] Classify AND bitmasks as variable shuffle masks
They are loading the bitmasks from the constant pool so the cost is similar to loading a shuffle mask.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288367 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 16:00:14 +00:00
Simon Pilgrim
3160d05cd6 [X86][SSE] Add support for combining AND bitmasks to shuffles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288365 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 15:41:40 +00:00
Pavel Labath
f8e7cdba56 Remove iostream include from WasmObjectFile
The file does not seems to use c++ iostreams (and is is llvm policy to avoid
that). Committing as obvious.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288364 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 15:20:34 +00:00
Asaf Badouh
400d54c239 [LMT] Restrict nop length to one
not all lakemont MCU support long nop.
we can't assume we can generate long nop by default for MCU.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288363 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 15:19:10 +00:00
Simon Pilgrim
03aab9481f [X86][SSE] Tidied up filecheck prefixes for uitofp fast-math tests.
They should be in 'narrowing' order from common to more specific test prefixes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288338 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 14:56:48 +00:00
Daniel Jasper
7eefb7da59 Silence GCC's -Wenum-compare after r288335 in the same way it is done
in X86FastISel.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288337 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 14:33:50 +00:00
Nicolai Haehnle
77151a0de7 [SelectionDAG] Rename and clarify visitFMULForFMADCombine (NFC)
Summary: Suggested by @spatel in D26602.

Reviewers: spatel, hfinkel

Subscribers: spatel, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288336 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 14:04:13 +00:00
Simon Pilgrim
a88ec277ba [X86][SSE] Add support for combining target shuffles to AND bitmasks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288335 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 13:47:02 +00:00
Simon Pilgrim
b5df2def3b [X86][SSE] Add support for combining ISD::AND with shuffles.
Attempts to convert an AND with a vector of 255 or 0 values into a shuffle (blend) mask.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288333 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 11:52:37 +00:00
Simon Pilgrim
48b2ddb584 [X86][SSE] Added tests showing missed combines of shuffles with ANDs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288330 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 11:26:07 +00:00
Davide Italiano
9217738fa8 [SCCP] Switch over to DEBUG() and drop an #ifdef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288325 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 08:48:14 +00:00
Davide Italiano
236801ef98 [SCCP] Prefer auto when the type is obvious. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288324 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 08:36:12 +00:00
Eric Christopher
e7b3959e01 Temporarily Revert "Move most EH from MachineModuleInfo to MachineFunction"
This apprears to have broken the global isel bot:
http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-globalisel_build/5174/console

This reverts commit r288293.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288322 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 07:50:12 +00:00
Peter Collingbourne
e3134b8c5c Object: Set SF_Indirect in ModuleSymbolTable.
This lets us remove the last use of IRObjectFile::getSymbolGV() in llvm-nm.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288321 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 07:00:35 +00:00
Peter Collingbourne
71fc8a346a Object: Add SF_Executable symbol flag.
This allows us to remove a few uses of IRObjectFile::getSymbolGV() in
llvm-nm.

While here change host-dependent logic in llvm-nm to target-dependent
logic.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288320 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 06:53:47 +00:00
Peter Collingbourne
dc61d3e913 Object: Extract a ModuleSymbolTable class from IRObjectFile.
This class represents a symbol table built from in-memory IR. It provides
access to GlobalValues and should only be used if such access is required
(e.g. in the LTO implementation). We will eventually change IRObjectFile
to read from a bitcode symbol table rather than using ModuleSymbolTable,
so it would not be able to expose the module.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288319 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 06:51:47 +00:00
Peter Collingbourne
c0e425dcdf Bitcode: The index used by ModuleSummaryIndexBitcodeReader is now required, so make it a reference. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288318 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 06:21:08 +00:00
Peter Collingbourne
51b7aa5d98 Bitcode: Introduce BitcodeModule::{has,get}Summary().
These are equivalent to hasGlobalValueSummary() and getModuleSummaryIndex().

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288317 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 06:00:53 +00:00
Peter Collingbourne
11a8ec66fd LTO: Remove ModuleLoader, make loadModuleFromBuffer static and move into its only client, ThinLTOCodeGenerator.
This is no longer the recommended way to load modules for importing, so it should not be public API.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288316 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 05:52:32 +00:00
Peter Collingbourne
ca0a598f5b Bitcode: Correctly handle Fixed and VBR arrays in BitstreamCursor::skipRecord().
The assertions were wrong; we need to call getEncodingData() on the element,
not the array. While here, simplify the skipRecord() implementation for Fixed
and Char6 arrays. This is tested by the code I added to llvm-bcanalyzer
which makes sure that we can skip any record.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288315 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 05:47:58 +00:00
Philip Reames
bba2ee9a6e Revert previous whitespace change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288312 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 04:37:35 +00:00
Philip Reames
7c3f9d9bff Test commit of whitespace to check permissions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288311 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 04:37:09 +00:00
Adam Nemet
01ad70a9f5 [GVN] When merging blocks update LoopInfo if it's available
If LoopInfo is available during GVN, BasicAA will use it.  However
MergeBlockIntoPredecessor does not update LI as it merges blocks.

This didn't use to cause problems because LI was freed before
GVN/BasicAA.  Now with OptimizationRemarkEmitter, the lifetime of LI is
extended so LI needs to be kept up-to-date during GVN.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288307 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 03:56:43 +00:00
Ivan Krasin
c22ac1df07 Use trigrams to speed up SpecialCaseList.
Summary:
it's often the case when the rules in the SpecialCaseList
are of the form hel.o*bar. That gives us a chance to build
trigram index to quickly discard 99% of inputs without
running a full regex. A similar idea was used in Google Code Search
as described in the blog post:
https://swtch.com/~rsc/regexp/regexp4.html

The check is defeated, if there's at least one regex
more complicated than that. In this case, all inputs
will go through the regex. That said, the real-world
rules are often simple or can be simplied. That considerably
speeds up compiling Chromium with CFI and UBSan.

As measured on Chromium's content_message_generator.cc:

before, CFI: 44 s
after, CFI: 23 s
after, CFI, no blacklist: 23 s (~1% slower, but 3 runs were unable to show the difference)
after, regular compilation to bitcode: 23 s

Reviewers: pcc

Subscribers: mgorny, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288303 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 02:54:54 +00:00
Peter Collingbourne
66a1cdb578 LTO: Remove Symbol::getIRName().
Its only use was in the LTO implementation. Also document
Symbol::getName().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288302 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 02:51:12 +00:00
Kostya Serebryany
0719114a69 revert r288283 as it causes debug info (line numbers) to be lost in instrumented code. also revert r288299 which was a workaround for the problem.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288300 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 02:06:56 +00:00
Kostya Serebryany
aa777036e4 [libFuzzer] temporary disable a part of the test broken by r288283
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288299 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 01:33:44 +00:00
Derek Schuff
a95cded1a3 [WebAssembly] Emit .import_global assembler directives
Support a new assembler directive, .import_global, to declare imported
global variables (i.e. those with external linkage and no
initializer). The linker turns these into wasm imports.

Patch by Jacob Gravelle

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288296 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 00:11:15 +00:00
Matthias Braun
29c7b3a03e Move most EH from MachineModuleInfo to MachineFunction
Most of the exception handling members in MachineModuleInfo is actually
per function data (talks about the "current function") so it is better
to keep it at the function instead of the module.

This is a necessary step to have machine module passes work properly.

Also:
- Rename TidyLandingPads() to tidyLandingPads()
- Use doxygen member groups instead of "//===- EH ---"... so it is clear
  where a group ends.
- I had to add an ugly const_cast at two places in the AsmPrinter
  because the available MachineFunction pointers are const, but the code
  wants to call tidyLandingPads() in between
  (markFunctionEnd()/endFunction()).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288293 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-30 23:49:01 +00:00
Matthias Braun
40485c228c Move VariableDbgInfo from MachineModuleInfo to MachineFunction
VariableDbgInfo is per function data, so it makes sense to have it with
the function instead of the module.

This is a necessary step to have machine module passes work properly.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288292 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-30 23:48:50 +00:00
Matthias Braun
14250381b8 Move FrameInstructions from MachineModuleInfo to MachineFunction
This is per function data so it is better kept at the function instead
of the module.

This is a necessary step to have machine module passes work properly.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288291 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-30 23:48:42 +00:00
Matthias Braun
26256fb2f9 MCStreamer: Use "cfi" for CFI related temp labels.
Choosing a "cfi" name makes the intend a bit clearer in an assembly dump
and more importantly the assembly dumps are slightly more stable as the
numbers don't move around anymore when unrelated code calls
createTempSymbol() more or less often.
As they are temp labels the name doesn't influence the generated object
code.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288290 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-30 23:48:26 +00:00
Peter Collingbourne
5c1bc63307 llvm-lto2: Simpler workaround for PR30396.
Maintain the command line resolutions as a map to a list of resolutions
rather than a single resolution, and apply the resolutions in the order
observed. This is not only simpler but allows us to test the scenario where
the two symbols have different resolutions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288288 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-30 23:19:05 +00:00
Paul Robinson
561ad767af [PS4] Tighten up a triple check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288286 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-30 23:14:27 +00:00
Eugene Zelenko
e6159142c4 Fix some Clang-tidy modernize-use-default and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288285 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-30 23:10:42 +00:00
Paul Robinson
241e6793ec Recommit r288212: Emit 'no line' information for interesting 'orphan' instructions.
The LLDB tests are now ready for this patch.

DWARF specifies that "line 0" really means "no appropriate source
location" in the line table.  Use this for branch targets and some
other cases that have no specified source location, to prevent
inheriting unfortunate line numbers from physically preceding
instructions (which might be from completely unrelated source).

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288283 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-30 22:49:55 +00:00
Kostya Serebryany
b89fb12b58 [libFuzzer] extend -rss_limit_mb to crash instantly on a single malloc that exceeds the limit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288281 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-30 22:39:35 +00:00
David Callahan
bcdc161524 Only computeRelativePath() on new members
Summary:
When using thin archives, and processing the same archive multiple times, we were mangling existing entries.  The root cause is that we were calling computeRelativePath() more than once.   Here, we only call it when adding new members to an archive.

Note that D27218 changes the way thin archives are printed, and will break the new unit test included here.  Depending on which one lands first, the other will need to be slightly modified.

Reviewers: rafael, davide

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288280 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-30 22:32:58 +00:00
Joel Jones
3143430807 [AArch64] Refactor LSE support as feature separate from V8.1a support.
Summary:
This is preparation for ThunderX processors that have Large
System Extension (LSE) atomic instructions, but not the 
other instructions introduced by V8.1a.
This will mimic changes to GCC as described here:
https://gcc.gnu.org/ml/gcc-patches/2015-06/msg00388.html

LSE instructions are: LD/ST<op>, CAS*, SWP

Reviewers: t.p.northover, echristo, jmolloy, rengolin

Subscribers: aemerson, mehdi_amini

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288279 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-30 22:25:24 +00:00
Evgeny Stupachenko
e18cb89a65 Fix LSR best register search algorithm.
Summary:
Fix a case when first register in a search has maximum
RegUses.getUsedByIndices(Reg).count()

Reviewers: qcolombet

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

From: Evgeny Stupachenko <evstupac@gmail.com>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288278 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-30 22:23:51 +00:00
Matthias Braun
76914be1f4 Clarify rules for reserved regs, fix aarch64 ones.
No test case necessary as the problematic condition is checked with the
newly introduced assertAllSuperRegsMarked() function.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288277 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-30 22:17:10 +00:00