OSDN Git Service
Peter Collingbourne [Fri, 2 Dec 2016 02:55:30 +0000 (02:55 +0000)]
Fix GlobalISel build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288460
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 2 Dec 2016 02:26:02 +0000 (02:26 +0000)]
ConstantFolding: Factor code into helper function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288459
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Fri, 2 Dec 2016 02:24:42 +0000 (02:24 +0000)]
IR: Change the gep_type_iterator API to avoid always exposing the "current" type.
Instead, expose whether the current type is an array or a struct, if an array
what the upper bound is, and if a struct the struct type itself. This is
in preparation for a later change which will make PointerType derive from
Type rather than SequentialType.
Differential Revision: https://reviews.llvm.org/D26594
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288458
91177308-0d34-0410-b5e6-
96231b3b80d8
Paul Robinson [Fri, 2 Dec 2016 01:55:17 +0000 (01:55 +0000)]
[DWARF] Put linkage-name on abstract origin even when there's a declaration.
In r266692, we made it possible to emit linkage names for just inlined
functions, putting the attribute on the abstract origin. Make sure we
don't think the linkage-name was already emitted on a declaration.
Differential Revision: http://reviews.llvm.org/D27320
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288450
91177308-0d34-0410-b5e6-
96231b3b80d8
Teresa Johnson [Fri, 2 Dec 2016 01:02:30 +0000 (01:02 +0000)]
[ThinLTO] Stop importing constant global vars as copies in the backend
Summary:
We were doing an optimization in the ThinLTO backends of importing
constant unnamed_addr globals unconditionally as a local copy (regardless
of whether the thin link decided to import them). This should be done in
the thin link instead, so that resulting exported references are marked
and promoted appropriately, but will need a summary enhancement to mark
these variables as constant unnamed_addr.
The function import logic during the thin link was trying to handle
this proactively, by conservatively marking all values referenced in
the initializer lists of exported global variables as also exported.
However, this only handled values referenced directly from the
initializer list of an exported global variable. If the value is itself
a constant unnamed_addr variable, we could end up exporting its
references as well. This caused multiple issues. The first is that the
transitively exported references weren't promoted. Secondly, some could
not be promoted/renamed (e.g. they had a section or other constraint).
recursively, instead of just adding the first level of initializer list
references to the ExportList directly.
Remove this optimization and the associated handling in the function
import backend. SPEC measurements indicate we weren't getting much
from it in any case.
Fixes PR31052.
Reviewers: mehdi_amini
Subscribers: krasin, llvm-commits
Differential Revision: https://reviews.llvm.org/D26880
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288446
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 2 Dec 2016 00:54:45 +0000 (00:54 +0000)]
AMDGPU: Use wider scalar spills for SGPR spilling
Since the spill is for the whole wave, these
don't have the swizzling problems that vector stores do
and a single 4-byte allocation is enough to spill a 64 element
register. This should reduce the number of spill instructions and
put all the spills for a register in the same cacheline.
This should save allocated private size, but for now it doesn't.
The extra slots are allocated for each component, but never used
because the frame layout is essentially finalized before frame
indices are replaced. For always using the scalar store path,
this should probably be moved into processFunctionBeforeFrameFinalized.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288445
91177308-0d34-0410-b5e6-
96231b3b80d8
Wolfgang Pieb [Fri, 2 Dec 2016 00:37:57 +0000 (00:37 +0000)]
When instructions are hoisted out of loops by MachineLICM, remove their debug loc.
This prevents erratic stepping behavior as well as incorrect source attribution
for sample profiling.
Reviewers: dblakie
Subscribers: llvm-commit
Differential Revision: https://reviews.llvm.org/D27290
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288442
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Fri, 2 Dec 2016 00:11:01 +0000 (00:11 +0000)]
SDAG: Avoid a large, usually empty SmallVector in a recursive function
This SmallVector is using up 128 bytes on the stack every time despite
almost always being empty[1], and since this function can recurse quite
deeply that adds up to a lot of overhead. We've seen this run afoul of
ulimits in some cases with ASAN on.
Replacing the SmallVector with a std::vector trades an occasional heap
allocation for vastly less stack usage.
[1]: I gathered some stats on an internal test suite and the vector
was non-empty in only 45,000 of 10,000,000 calls to this function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288441
91177308-0d34-0410-b5e6-
96231b3b80d8
Geoff Berry [Thu, 1 Dec 2016 23:43:55 +0000 (23:43 +0000)]
[AArch64] Fold more spilled/refilled COPYs.
Summary:
Make AArch64InstrInfo::foldMemoryOperandImpl more general by folding all
full COPYs between register classes of the same size that are either
spilled or refilled.
Reviewers: MatzeB, qcolombet
Subscribers: aemerson, rengolin, mcrosier, llvm-commits
Differential Revision: https://reviews.llvm.org/D27271
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288439
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Thu, 1 Dec 2016 23:39:08 +0000 (23:39 +0000)]
[MC] Refactor emitELFSize to make usage more consistent. NFC.
Move the cast<MCSymbolELF> inside emitELFSize, so that:
- it's done in one place instead of at each call
- it's more consistent with similar functions like EmitCOFFSafeSEH
- ambiguity between cast<> and dyn_cast<> is avoided (which also
eliminates an unnecessary dyn_cast call)
This also makes it easier to experiment with using ".size" directives on
non-ELF targets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288437
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Thu, 1 Dec 2016 23:13:11 +0000 (23:13 +0000)]
llvm-modextract: Call keep() on the output stream before exiting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288435
91177308-0d34-0410-b5e6-
96231b3b80d8
Oleg Ranevskyy [Thu, 1 Dec 2016 22:58:35 +0000 (22:58 +0000)]
[ARM] Fix for 64-bit CAS expansion on ARM32 with -O0
Summary:
This patch fixes comparison of 64-bit atomic with its expected value in CMP_SWAP_64 expansion.
Currently, the low words are compared with CMP, while the high words are compared with SBC. SBC expects the carry flag to be set if CMP detects a difference. CMP might leave the carry unset for unequal arguments though if the first one is >= than the second. This might cause the comparison logic to detect false equality.
Example of the broken C++ code:
```
std::atomic<long long> at(2);
long long ll = 1;
std::atomic_compare_exchange_strong(&at, &ll, 3);
```
Even though the atomic `at` and the expected value `ll` are not equal and `atomic_compare_exchange_strong` returns `false`, `at` is changed to 3.
The patch replaces SBC with CMPEQ.
Reviewers: t.p.northover
Subscribers: aemerson, rengolin, llvm-commits, asl
Differential Revision: https://reviews.llvm.org/D27315
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288433
91177308-0d34-0410-b5e6-
96231b3b80d8
Artem Belevich [Thu, 1 Dec 2016 22:52:15 +0000 (22:52 +0000)]
Revert "[SLP] Fix for PR6246: vectorization for scalar ops on vector elements."
This reverts r288412 which causes severe compile-time regression.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288431
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Thu, 1 Dec 2016 22:39:51 +0000 (22:39 +0000)]
RegisterCoalscer: Only coalesce complete reserved registers.
The coalescer eliminates copies from reserved registers of the form:
%vregX = COPY %rY
in the case where %rY is a reserved register. However this turns out to
be invalid if only some of the subregisters are reserved (see also
https://reviews.llvm.org/D26648).
Differential Revision: https://reviews.llvm.org/D26687
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288428
91177308-0d34-0410-b5e6-
96231b3b80d8
Eugene Zelenko [Thu, 1 Dec 2016 22:26:55 +0000 (22:26 +0000)]
Fix broken buildbots because of r288424 (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288426
91177308-0d34-0410-b5e6-
96231b3b80d8
Eugene Zelenko [Thu, 1 Dec 2016 22:13:24 +0000 (22:13 +0000)]
[ADT, Support, TableGen] 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@288424
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 1 Dec 2016 22:04:16 +0000 (22:04 +0000)]
[dsymutil] Simplify a lazy-init condition/expression
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288423
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 1 Dec 2016 21:59:09 +0000 (21:59 +0000)]
[debug info] Minor cleanup from D27170/r288399
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288421
91177308-0d34-0410-b5e6-
96231b3b80d8
Chih-Hung Hsieh [Thu, 1 Dec 2016 21:56:33 +0000 (21:56 +0000)]
[SelectionDAG] getRawSubclassData should not return HasDebugValue.
This change fixes a regression in r279537 and
makes getRawSubclassData behave like r279536.
Without this change, the fp128-g.ll test case will have an
infinite loop involving SoftenFloatRes_LOAD.
Differential Revision: http://reviews.llvm.org/D26942
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288420
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Thu, 1 Dec 2016 21:31:59 +0000 (21:31 +0000)]
AArch64: fix 128-bit cmpxchg at -O0 (again, again).
This time the issue is fortunately just a simple mistake rather than a horrible
design spectre. I thought SUBS/SBCS provided sufficient NZCV flags for
comparing two 64-bit values, but they don't.
The fix is slightly clunkier in AArch64 because we can't use conditional
execution to emit a pair of CMPs. Traditionally an "icmp ne i128" would map to
an EOR/EOR/ORR/CBNZ, but that uses more registers so it's easier to go with a
CSET/CINC/CBNZ combination. Slightly less efficient, but this is -O0 anyway.
Thanks to Anton Korobeynikov for pointing out the issue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288418
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Thu, 1 Dec 2016 20:54:29 +0000 (20:54 +0000)]
Improve documentation on MSVC workaround for AlignedCharArray (NFC)
The comment only mentioned "old version of MSVC".
Differential Revision: https://reviews.llvm.org/D27312
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288417
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 1 Dec 2016 20:49:34 +0000 (20:49 +0000)]
Fix unused variable warning in Release builds. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288416
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Thu, 1 Dec 2016 20:17:06 +0000 (20:17 +0000)]
[PR29121] Don't fold if it would produce atomic vector loads or stores
The instcombine code which folds loads and stores into their use types can trip up if the use is a bitcast to a type which we can't directly load or store in the IR. In principle, such types shouldn't exist, but in practice they do today. This is a workaround to avoid a bug while we work towards the long term goal.
Differential Revision: https://reviews.llvm.org/D24365
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288415
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Thu, 1 Dec 2016 20:08:47 +0000 (20:08 +0000)]
Factor out common parts of LVI and Float2Int into ConstantRange [NFCI]
This just extracts out the transfer rules for constant ranges into a single shared point. As it happens, neither bit of code actually overlaps in terms of the handled operators, but with this change that could easily be tweaked in the future.
I also want to have this separated out to make experimenting with a eager value info implementation and possibly a ValueTracking-like fixed depth recursion peephole version. There's no reason all four of these can't share a common implementation which reduces the chances of bugs.
Differential Revision: https://reviews.llvm.org/D27294
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288413
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Bataev [Thu, 1 Dec 2016 20:06:53 +0000 (20:06 +0000)]
[SLP] Fix for PR6246: vectorization for scalar ops on vector elements.
When trying to vectorize trees that start at insertelement instructions
function tryToVectorizeList() uses vectorization factor calculated as
MinVecRegSize/ScalarTypeSize. But sometimes it does not work as tree
cost for this fixed vectorization factor is too high.
Patch tries to improve the situation. It tries different vectorization
factors from max(PowerOf2Floor(NumberOfVectorizedValues),
MinVecRegSize/ScalarTypeSize) to MinVecRegSize/ScalarTypeSize and tries
to choose the best one.
Differential Revision: https://reviews.llvm.org/D27215
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288412
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Thu, 1 Dec 2016 20:02:12 +0000 (20:02 +0000)]
[WebAssembly] Define more wasm binary encoding constants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288411
91177308-0d34-0410-b5e6-
96231b3b80d8
David L Kreitzer [Thu, 1 Dec 2016 19:56:39 +0000 (19:56 +0000)]
Refactored X86InterleavedAccess into a class. NFCI.
Patch by Farhana Aleen
Differential Revision: https://reviews.llvm.org/D25986
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288410
91177308-0d34-0410-b5e6-
96231b3b80d8
Vedant Kumar [Thu, 1 Dec 2016 19:38:50 +0000 (19:38 +0000)]
[tablegen] Delete duplicates from a vector without skipping elements
Tablegen's -gen-instr-info pass has a bug in its emitEnums() routine.
The function intends for values in a vector to be deduplicated, but it
accidentally skips over elements after performing a deletion.
I think there are smarter ways of doing this deduplication, but we can
do that in a follow-up commit if there's interest. See the thread:
[PATCH] TableGen InstrMapping Bug fix.
Patch by Tyler Kenney!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288408
91177308-0d34-0410-b5e6-
96231b3b80d8
Vedant Kumar [Thu, 1 Dec 2016 19:38:48 +0000 (19:38 +0000)]
Remove unused header, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288407
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Thu, 1 Dec 2016 19:32:15 +0000 (19:32 +0000)]
Move most EH from MachineModuleInfo to MachineFunction
Recommitting r288293 with some extra fixes for GlobalISel code.
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@288405
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Thu, 1 Dec 2016 19:12:55 +0000 (19:12 +0000)]
Fix a bug with llvm-size and the -m option with multiple files not printing the file names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288402
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 1 Dec 2016 19:10:10 +0000 (19:10 +0000)]
Fix unused variable warning in Release builds. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288401
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Thu, 1 Dec 2016 19:08:38 +0000 (19:08 +0000)]
Fix module map to create a module for the configured header Config/abi-breaking.h
A client of a header that relies on ABI breaking should get the macro
exported there.
Before this, the unittest for Support/Error including Support/Error.h
didn't get the macro exported by the Support module, because the
latter only re-export its submodules and included module, not
textual headers.
Hopefully, it'll also fix the build with local submodule visibility,
since the LLVM_Utils contains two submodules: ADT and Support. They
both include abi-breaking.h that defines a symbol. The textual
inclusion lead to a double definition of the symbol which broke
the parent module.
Differential Revision: https://reviews.llvm.org/D27273
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288400
91177308-0d34-0410-b5e6-
96231b3b80d8
Greg Clayton [Thu, 1 Dec 2016 18:56:29 +0000 (18:56 +0000)]
This change removes the dependency on DwarfDebug that was used for DW_FORM_ref_addr by making a new DIEUnit class in DIE.cpp.
The DIEUnit class represents a compile or type unit and it owns the unit DIE as an instance variable. This allows anyone with a DIE, to get the unit DIE, and then get back to its DIEUnit without adding any new ivars to the DIE class. Why was this needed? The DIE class has an Offset that is always the CU relative DIE offset, not the "offset in debug info section" as was commented in the header file (the comment has been corrected). This is great for performance because most DIE references are compile unit relative and this means most code that accessed the DIE's offset didn't need to make it into a compile unit relative offset because it already was. When we needed to emit a DW_FORM_ref_addr though, we needed to find the absolute offset of the DIE by finding the DIE's compile/type unit. This class did have the absolute debug info/type offset and could be added to the CU relative offset to compute the absolute offset. With this change we can easily get back to a DIE's DIEUnit which will have this needed offset. Prior to this is required having a DwarfDebug and required calling:
DwarfCompileUnit *DwarfDebug::lookupUnit(const DIE *CU) const;
Now we can use the DIEUnit class to do so without needing DwarfDebug. All clients now use DIEUnit objects (the DwarfDebug stack and the DwarfLinker). A follow on patch for the DWARF generator will also take advantage of this.
Differential Revision: https://reviews.llvm.org/D27170
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288399
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Bataev [Thu, 1 Dec 2016 18:42:42 +0000 (18:42 +0000)]
[SLP] Fixed cost model for horizontal reduction.
Currently when cost of scalar operations is evaluated the vector type is
used for scalar operations. Patch fixes this issue and fixes evaluation
of the vector operations cost.
Several test showed that vector cost model is too optimistic. It
allowed vectorization of 8 or less add/fadd operations, though scalar
code is faster. Actually, only for 16 or more operations vector code
provides better performance.
Differential Revision: https://reviews.llvm.org/D26277
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288398
91177308-0d34-0410-b5e6-
96231b3b80d8
Mandeep Singh Grang [Thu, 1 Dec 2016 18:42:04 +0000 (18:42 +0000)]
[llvm] Implement support for -defsym assembler option
Summary:
Changes to llvm-mc to move common logic to separate function.
Related clang patch: https://reviews.llvm.org/D26213
Reviewers: rafael, t.p.northover, colinl, echristo, rengolin
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D26214
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288396
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 1 Dec 2016 18:27:19 +0000 (18:27 +0000)]
[X86][SSE] Moved shuffle mask widening/narrowing helper functions earlier in the file.
Will be necessary for a future patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288395
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Thu, 1 Dec 2016 18:02:07 +0000 (18:02 +0000)]
[libFuzzer] add a test for r288389 (-rss_limit_mb=0 means no limit).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288392
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Thu, 1 Dec 2016 18:00:50 +0000 (18:00 +0000)]
[SystemZ] Fix fallout from r288374
Avoid undefined behavior due to too-large shift count.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288391
91177308-0d34-0410-b5e6-
96231b3b80d8
Weiming Zhao [Thu, 1 Dec 2016 18:00:36 +0000 (18:00 +0000)]
[AsmParser] Diagnose empty symbol for .set directive
Summary: Diagnose empty symbol to avoid hitting assertion in MCContext::getOrCreateSymbol
Reviewers: eli.friedman, rengolin
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D26728
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288390
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Thu, 1 Dec 2016 17:56:15 +0000 (17:56 +0000)]
[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
Kuba Mracek [Thu, 1 Dec 2016 17:45:22 +0000 (17:45 +0000)]
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
Adam Nemet [Thu, 1 Dec 2016 17:34:50 +0000 (17:34 +0000)]
[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
Adam Nemet [Thu, 1 Dec 2016 17:34:44 +0000 (17:34 +0000)]
[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
Alexey Bataev [Thu, 1 Dec 2016 17:26:54 +0000 (17:26 +0000)]
[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
Ulrich Weigand [Thu, 1 Dec 2016 17:10:27 +0000 (17:10 +0000)]
[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
Alexey Bataev [Thu, 1 Dec 2016 16:45:04 +0000 (16:45 +0000)]
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
Adam Nemet [Thu, 1 Dec 2016 16:40:32 +0000 (16:40 +0000)]
[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
Alexey Bataev [Thu, 1 Dec 2016 16:11:48 +0000 (16:11 +0000)]
[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
Simon Pilgrim [Thu, 1 Dec 2016 16:00:14 +0000 (16:00 +0000)]
[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
Simon Pilgrim [Thu, 1 Dec 2016 15:41:40 +0000 (15:41 +0000)]
[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
Pavel Labath [Thu, 1 Dec 2016 15:20:34 +0000 (15:20 +0000)]
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
Asaf Badouh [Thu, 1 Dec 2016 15:19:10 +0000 (15:19 +0000)]
[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
Simon Pilgrim [Thu, 1 Dec 2016 14:56:48 +0000 (14:56 +0000)]
[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
Daniel Jasper [Thu, 1 Dec 2016 14:33:50 +0000 (14:33 +0000)]
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
Nicolai Haehnle [Thu, 1 Dec 2016 14:04:13 +0000 (14:04 +0000)]
[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
Simon Pilgrim [Thu, 1 Dec 2016 13:47:02 +0000 (13:47 +0000)]
[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
Simon Pilgrim [Thu, 1 Dec 2016 11:52:37 +0000 (11:52 +0000)]
[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
Simon Pilgrim [Thu, 1 Dec 2016 11:26:07 +0000 (11:26 +0000)]
[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
Davide Italiano [Thu, 1 Dec 2016 08:48:14 +0000 (08:48 +0000)]
[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
Davide Italiano [Thu, 1 Dec 2016 08:36:12 +0000 (08:36 +0000)]
[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
Eric Christopher [Thu, 1 Dec 2016 07:50:12 +0000 (07:50 +0000)]
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
Peter Collingbourne [Thu, 1 Dec 2016 07:00:35 +0000 (07:00 +0000)]
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
Peter Collingbourne [Thu, 1 Dec 2016 06:53:47 +0000 (06:53 +0000)]
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
Peter Collingbourne [Thu, 1 Dec 2016 06:51:47 +0000 (06:51 +0000)]
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
Peter Collingbourne [Thu, 1 Dec 2016 06:21:08 +0000 (06:21 +0000)]
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
Peter Collingbourne [Thu, 1 Dec 2016 06:00:53 +0000 (06:00 +0000)]
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
Peter Collingbourne [Thu, 1 Dec 2016 05:52:32 +0000 (05:52 +0000)]
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
Peter Collingbourne [Thu, 1 Dec 2016 05:47:58 +0000 (05:47 +0000)]
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
Philip Reames [Thu, 1 Dec 2016 04:37:35 +0000 (04:37 +0000)]
Revert previous whitespace change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288312
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Thu, 1 Dec 2016 04:37:09 +0000 (04:37 +0000)]
Test commit of whitespace to check permissions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288311
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Thu, 1 Dec 2016 03:56:43 +0000 (03:56 +0000)]
[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
Ivan Krasin [Thu, 1 Dec 2016 02:54:54 +0000 (02:54 +0000)]
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
Peter Collingbourne [Thu, 1 Dec 2016 02:51:12 +0000 (02:51 +0000)]
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
Kostya Serebryany [Thu, 1 Dec 2016 02:06:56 +0000 (02:06 +0000)]
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
Kostya Serebryany [Thu, 1 Dec 2016 01:33:44 +0000 (01:33 +0000)]
[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
Derek Schuff [Thu, 1 Dec 2016 00:11:15 +0000 (00:11 +0000)]
[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
Matthias Braun [Wed, 30 Nov 2016 23:49:01 +0000 (23:49 +0000)]
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
Matthias Braun [Wed, 30 Nov 2016 23:48:50 +0000 (23:48 +0000)]
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
Matthias Braun [Wed, 30 Nov 2016 23:48:42 +0000 (23:48 +0000)]
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
Matthias Braun [Wed, 30 Nov 2016 23:48:26 +0000 (23:48 +0000)]
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
Peter Collingbourne [Wed, 30 Nov 2016 23:19:05 +0000 (23:19 +0000)]
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
Paul Robinson [Wed, 30 Nov 2016 23:14:27 +0000 (23:14 +0000)]
[PS4] Tighten up a triple check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288286
91177308-0d34-0410-b5e6-
96231b3b80d8
Eugene Zelenko [Wed, 30 Nov 2016 23:10:42 +0000 (23:10 +0000)]
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
Paul Robinson [Wed, 30 Nov 2016 22:49:55 +0000 (22:49 +0000)]
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
Kostya Serebryany [Wed, 30 Nov 2016 22:39:35 +0000 (22:39 +0000)]
[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
David Callahan [Wed, 30 Nov 2016 22:32:58 +0000 (22:32 +0000)]
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
Joel Jones [Wed, 30 Nov 2016 22:25:24 +0000 (22:25 +0000)]
[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
Evgeny Stupachenko [Wed, 30 Nov 2016 22:23:51 +0000 (22:23 +0000)]
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
Matthias Braun [Wed, 30 Nov 2016 22:17:10 +0000 (22:17 +0000)]
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
Kostya Serebryany [Wed, 30 Nov 2016 21:53:32 +0000 (21:53 +0000)]
[libFuzzer] extend -print_coverage to print the comma-separated list of covered dirs. Note: the Windows stub for DirName is left unimplemented
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288276
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Wed, 30 Nov 2016 21:44:26 +0000 (21:44 +0000)]
[LibFuzzer] Add Windows implementations of some IO functions.
This patch moves some posix specific file i/o code into a new
file, FuzzerIOPosix.cpp, and provides implementations for these
functions on Windows in FuzzerIOWindows.cpp. This is another
incremental step towards getting libfuzzer working on Windows,
although it still should not be expected to be fully working.
Patch by Marcos Pividori
Differential Revision: https://reviews.llvm.org/D27233
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288275
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Wed, 30 Nov 2016 21:13:57 +0000 (21:13 +0000)]
[LoopUnroll] Implement profile-based loop peeling
This implements PGO-driven loop peeling.
The basic idea is that when the average dynamic trip-count of a loop is known,
based on PGO, to be low, we can expect a performance win by peeling off the
first several iterations of that loop.
Unlike unrolling based on a known trip count, or a trip count multiple, this
doesn't save us the conditional check and branch on each iteration. However,
it does allow us to simplify the straight-line code we get (constant-folding,
etc.). This is important given that we know that we will usually only hit this
code, and not the actual loop.
This is currently disabled by default.
Differential Revision: https://reviews.llvm.org/D25963
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288274
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 30 Nov 2016 20:48:54 +0000 (20:48 +0000)]
[InstCombine] allow more narrowing transforms for logic ops
We had a limited version of this for scalar 'and'; this expands
the transform to 'or' and 'xor' and allows vectors types too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288273
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 30 Nov 2016 20:20:49 +0000 (20:20 +0000)]
[InstCombine] add tests to show potentially missed logic+trunc transforms; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288270
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Wed, 30 Nov 2016 19:55:49 +0000 (19:55 +0000)]
CODE_OWNERS: Take ownership of Loop Strenght Reduce.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288268
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Wed, 30 Nov 2016 19:12:53 +0000 (19:12 +0000)]
[git-llvm] Use --force-interactive when commiting to enable SVN to prompt password
When svn does not know the password and it has to prompt, it needs to query.
However it won't when invoked from the Python script and instead fails with:
svn:
E215004: Authentication failed and interactive prompting is disabled; see the --force-interactive option
Differential Revision: https://reviews.llvm.org/D27274
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288266
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Wed, 30 Nov 2016 19:08:41 +0000 (19:08 +0000)]
Fix macro check for ABI breacking check: should use #if instead of #ifndef
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288265
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Wed, 30 Nov 2016 19:06:14 +0000 (19:06 +0000)]
[LibFuzzer] Split up some functions among different headers.
In an effort to get libfuzzer working on Windows, we need to make
a distinction between what functions require platform specific
code (e.g. different code on Windows vs Linux) and what code
doesn't. IO functions, for example, tend to be platform
specific.
This patch separates out some of the functions which will need
to have platform specific implementations into different headers,
so that we can then provide different implementations for each
platform.
Aside from that, this patch contains no functional change. It
is purely a re-organization.
Patch by Marcos Pividori
Differential Revision: https://reviews.llvm.org/D27230
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288264
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 30 Nov 2016 18:50:26 +0000 (18:50 +0000)]
AMDGPU: Move mir tests into mir test directory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288262
91177308-0d34-0410-b5e6-
96231b3b80d8