OSDN Git Service
Matthias Braun [Tue, 27 Sep 2016 19:38:55 +0000 (19:38 +0000)]
Statistic: Bring back printing on exit by default
Turns out several external projects relied on llvm printing statistics
on exit. Let's go back to this behaviour by default and have an optional
parameter to disable it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282532
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 27 Sep 2016 18:58:50 +0000 (18:58 +0000)]
[lit] Add instructions to run lit's test suite
- Patch by Brian Gesiak.
- https://reviews.llvm.org/D24968
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282525
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Tue, 27 Sep 2016 18:50:30 +0000 (18:50 +0000)]
[llvm-cxxfilt] Use llvm::outs(). Simplify.
This adds a dependency on Support/. As llvm-cxxfilt will grow
support for options this will be needed anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282523
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 27 Sep 2016 18:48:02 +0000 (18:48 +0000)]
[x86] use isNullFPConstant(); NFCI
Also, put the related FP logic functions together to see the similarities.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282522
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Tue, 27 Sep 2016 18:45:31 +0000 (18:45 +0000)]
[DebugInfo] Add comments to phi dbg.value tracking code, NFC
LLVM developers might be surprised to learn that there are blocks
without valid insertion points (catchswitch), so it seems worth calling
that out explicitly. Also add a FIXME about what we should really be
doing if we ever need to make optimized Windows EH code debuggable.
While I'm here, make auto usage more consistent with LLVM standards and
avoid an unecessary call to insertBefore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282521
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Tue, 27 Sep 2016 18:24:33 +0000 (18:24 +0000)]
[RDF] Add "dead" flag to node attributes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282520
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Tue, 27 Sep 2016 18:18:44 +0000 (18:18 +0000)]
[RDF] Special treatment of exception handling registers
A landing pad can have live-in registers that are defined by the runtime,
not the program (exception pointer register and exception selector
register). Make sure to recognize that case and not link these registers
with any defs in the program.
Each landing pad will have phi nodes added at the beginning to provide
definitions of these registers, but the uses of those phi nodes will not
have any reaching defs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282519
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Tue, 27 Sep 2016 18:08:40 +0000 (18:08 +0000)]
Improve CMake output of host and target triple
Summary:
The previous output was confusing as it would output "Taget triple:
x86_64-unknown-linux-gnu" even when LLVM_HOST_TRIPLE or
LLVM_DEFAULT_TARGET_TRIPLE were set on the CMake command line
Patch by: Alex Richardson!
Reviewers: beanz
Subscribers: Eugene.Zelenko
Differential Revision: https://reviews.llvm.org/D17067
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282516
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Tue, 27 Sep 2016 18:01:48 +0000 (18:01 +0000)]
[SCEV] Replace a struct with a function; NFC
We can do this now thanks to C++11 lambdas.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282515
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Tue, 27 Sep 2016 18:01:46 +0000 (18:01 +0000)]
[SCEV] Use find instead of find_as; NFC
We don't need the extra generality here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282514
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Tue, 27 Sep 2016 18:01:44 +0000 (18:01 +0000)]
[SCEV] Reduce the scope of a struct; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282513
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Tue, 27 Sep 2016 18:01:42 +0000 (18:01 +0000)]
[SCEV] Remove custom RAII wrapper; NFC
Instead use the pre-existing `scope_exit` class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282512
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Tue, 27 Sep 2016 18:01:38 +0000 (18:01 +0000)]
[SCEV] Make PendingLoopPredicates more frugal; NFCI
I don't expect `PendingLoopPredicates` to have very many
elements (e.g. when -O3'ing the sqlite3 amalgamation,
`PendingLoopPredicates` has at most 3 elements). So now we use a
`SmallPtrSet` for it instead of the more heavyweight `DenseSet`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282511
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Tue, 27 Sep 2016 17:47:24 +0000 (17:47 +0000)]
[CMake] Use if(... IN_LIST ...) instead of list(FIND...)
NFC. This is just a little code cleanup to make things easier to read and understand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282510
91177308-0d34-0410-b5e6-
96231b3b80d8
Keith Walker [Tue, 27 Sep 2016 16:46:07 +0000 (16:46 +0000)]
Propagate DBG_VALUE entries when there are unvisited predecessors
Variables are sometimes missing their debug location information in
blocks in which the variables should be available. This would occur
when one or more predecessor blocks had not yet been visited by the
routine which propagated the information from predecessor blocks.
This is addressed by only considering predecessor blocks which have
already been visited.
The solution to this problem was suggested by Daniel Berlin on the
LLVM developer mailing list.
Differential Revision: https://reviews.llvm.org/D24927
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282506
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Tue, 27 Sep 2016 16:39:24 +0000 (16:39 +0000)]
Revert "Output optimization remarks in YAML"
This reverts commit r282499.
The GCC bots are failing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282503
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Tue, 27 Sep 2016 16:37:30 +0000 (16:37 +0000)]
Add llvm::join_items to StringExtras.
llvm::join_items is similar to llvm::join, which produces a string
by concatenating a sequence of values together separated by a
given separator. But it differs in that the arguments to
llvm::join() are same-type members of a container, whereas the
arguments to llvm::join_items are arbitrary types passed into
a variadic template. The only requirement on parameters to
llvm::join_items (including for the separator themselves) is
that they be implicitly convertible to std::string or have
an overload of std::string::operator+
Differential Revision: https://reviews.llvm.org/D24880
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282502
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 27 Sep 2016 16:17:42 +0000 (16:17 +0000)]
[lit] Fix refacto introduced by rL282479.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282501
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Tue, 27 Sep 2016 16:15:16 +0000 (16:15 +0000)]
Output optimization remarks in YAML
This allows various presentation of this data using an external tool.
This was first recommended here[1].
As an example, consider this module:
1 int foo();
2 int bar();
3
4 int baz() {
5 return foo() + bar();
6 }
The inliner generates these missed-optimization remarks today (the
hotness information is pulled from PGO):
remark: /tmp/s.c:5:10: foo will not be inlined into baz (hotness: 30)
remark: /tmp/s.c:5:18: bar will not be inlined into baz (hotness: 30)
Now with -pass-remarks-output=<yaml-file>, we generate this YAML file:
--- !Missed
Pass: inline
Name: NotInlined
DebugLoc: { File: /tmp/s.c, Line: 5, Column: 10 }
Function: baz
Hotness: 30
Args:
- Callee: foo
- String: will not be inlined into
- Caller: baz
...
--- !Missed
Pass: inline
Name: NotInlined
DebugLoc: { File: /tmp/s.c, Line: 5, Column: 18 }
Function: baz
Hotness: 30
Args:
- Callee: bar
- String: will not be inlined into
- Caller: baz
...
This is a summary of the high-level decisions:
* There is a new streaming interface to emit optimization remarks.
E.g. for the inliner remark above:
ORE.emit(DiagnosticInfoOptimizationRemarkMissed(
DEBUG_TYPE, "NotInlined", &I)
<< NV("Callee", Callee) << " will not be inlined into "
<< NV("Caller", CS.getCaller()) << setIsVerbose());
NV stands for named value and allows the YAML client to process a remark
using its name (NotInlined) and the named arguments (Callee and Caller)
without parsing the text of the message.
Subsequent patches will update ORE users to use the new streaming API.
* I am using YAML I/O for writing the YAML file. YAML I/O requires you
to specify reading and writing at once but reading is highly non-trivial
for some of the more complex LLVM types. Since it's not clear that we
(ever) want to use LLVM to parse this YAML file, the code supports and
asserts that we're writing only.
On the other hand, I did experiment that the class hierarchy starting at
DiagnosticInfoOptimizationBase can be mapped back from YAML generated
here (see D24479).
* The YAML stream is stored in the LLVM context.
* In the example, we can probably further specify the IR value used,
i.e. print "Function" rather than "Value".
* As before hotness is computed in the analysis pass instead of
DiganosticInfo. This avoids the layering problem since BFI is in
Analysis while DiagnosticInfo is in IR.
[1] https://reviews.llvm.org/D19678#419445
Differential Revision: https://reviews.llvm.org/D24587
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282499
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Tue, 27 Sep 2016 16:15:11 +0000 (16:15 +0000)]
Sort headers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282498
91177308-0d34-0410-b5e6-
96231b3b80d8
Manuel Klimek [Tue, 27 Sep 2016 15:47:29 +0000 (15:47 +0000)]
project_id is from another era in phabricator land and does not provide any value.
Patch by Eitan Adler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282494
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 27 Sep 2016 15:45:57 +0000 (15:45 +0000)]
Add xxhash to llvm.
It will be used for fast fingerprinting in lld at least.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282493
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexander Kornienko [Tue, 27 Sep 2016 14:49:45 +0000 (14:49 +0000)]
[docs] Fix naming style in the example
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282490
91177308-0d34-0410-b5e6-
96231b3b80d8
Konstantin Zhuravlyov [Tue, 27 Sep 2016 14:42:48 +0000 (14:42 +0000)]
[AMDGPU] Enable changing instprinter's behavior based on the per-function
subtarget
This is a prerequisite for coming waitcnt changes
Differential Revision: https://reviews.llvm.org/D24939
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282489
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Dardis [Tue, 27 Sep 2016 13:15:54 +0000 (13:15 +0000)]
[mips] Disable tail calls temporarily
Disable tail calls while the remaining bugs are fixed. Enable only for tests.
Reviewers: vkalintiris
Differential Review: https://reviews.llvm.org/D24912
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282487
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Dardis [Tue, 27 Sep 2016 12:25:15 +0000 (12:25 +0000)]
[mips] Add rsqrt, recip for MIPS
Add rsqrt.[ds], recip.[ds] for MIPS. Correct the microMIPS definitions for
architecture support and register usage.
Reviewers: vkalintiris, zoran.jovanoic
Differential Review: https://reviews.llvm.org/D24499
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282485
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrey Bokhanko [Tue, 27 Sep 2016 12:07:21 +0000 (12:07 +0000)]
[docs] Make WritingAnLLVMPass.rst up-to-date with current state of things
This patch updates WritingAnLLVMPass.rst to make it in line with current state of things.
Specifically:
* Makefile instructions replaced with CMake ones
* Filenames replaced with correct ones
* Example reformatted a bit to make it less confusing and more conforming to LLVM Coding Standards
* opt tool output updated with what it actually prints nowdays
* "gcse" (which doesn't exist anymore) replaced with "gvn" (which still does)
Differential Revision: https://reviews.llvm.org/D24233
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282482
91177308-0d34-0410-b5e6-
96231b3b80d8
Dimitar Vlahovski [Tue, 27 Sep 2016 10:34:43 +0000 (10:34 +0000)]
Trying to fix lldb build breakage probably caused by rL282452
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282479
91177308-0d34-0410-b5e6-
96231b3b80d8
Nemanja Ivanovic [Tue, 27 Sep 2016 08:42:12 +0000 (08:42 +0000)]
[Power9] Builtins for ELF v.2 API conformance - back end portion
This patch corresponds to review:
https://reviews.llvm.org/D24396
This patch adds support for the "vector count trailing zeroes",
"vector compare not equal" and "vector compare not equal or zero instructions"
as well as "scalar count trailing zeroes" instructions. It also changes the
vector negation to use XXLNOR (when VSX is enabled) so as not to increase
register pressure (previously this was done with a splat immediate of all
ones followed by an XXLXOR). This was done because the altivec.h
builtins (patch to follow) use vector negation and the use of an additional
register for the splat immediate is not optimal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282478
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 27 Sep 2016 06:44:30 +0000 (06:44 +0000)]
[X86] Add test case for PR30511 and r282341.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282473
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 27 Sep 2016 06:44:27 +0000 (06:44 +0000)]
[X86] Expand all-ones-vector test to cover 256-bit and 512-bit vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282472
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 27 Sep 2016 06:44:25 +0000 (06:44 +0000)]
[X86] Use std::max to calculate alignment instead of assuming RC->getSize() will not return a value greater than 32. I think it theoretically could be 64 for AVX-512.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282471
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Tue, 27 Sep 2016 03:33:57 +0000 (03:33 +0000)]
[libFuzzer] run re2 test in 8 threads by default
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282469
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Tue, 27 Sep 2016 01:55:08 +0000 (01:55 +0000)]
[sanitizer-coverage] fix a bug in trace-gep
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282467
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Tue, 27 Sep 2016 01:08:33 +0000 (01:08 +0000)]
[sanitizer-coverage] don't emit the CTOR function if nothing has been instrumented
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282465
91177308-0d34-0410-b5e6-
96231b3b80d8
Ivan Krasin [Tue, 27 Sep 2016 00:29:53 +0000 (00:29 +0000)]
Revert r277556. Add -lowertypetests-bitsets-level to control bitsets generation
Summary:
We don't currently need this facility for CFI. Disabling individual hot methods proved
to be a better strategy in Chrome.
Also, the design of the feature is suboptimal, as pointed out by Peter Collingbourne.
Reviewers: pcc
Subscribers: kcc
Differential Revision: https://reviews.llvm.org/D24948
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282461
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Tue, 27 Sep 2016 00:27:40 +0000 (00:27 +0000)]
[libFuzzer] add a test based on openssl-1.0.1f (finds heartbleed)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282460
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Tue, 27 Sep 2016 00:10:20 +0000 (00:10 +0000)]
[libFuzzer] add -exit_on_src_pos to test libFuzzer itself, add a test script for RE2 that uses this flag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282458
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Mon, 26 Sep 2016 23:56:17 +0000 (23:56 +0000)]
LowerTypeTests: Remove unused variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282456
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Mon, 26 Sep 2016 23:54:39 +0000 (23:54 +0000)]
LowerTypeTests: Create LowerTypeTestsModule class and move implementation there. Related simplifications.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282455
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Mon, 26 Sep 2016 23:38:23 +0000 (23:38 +0000)]
[lit] Add a --max-failures option.
- This is primarily useful as a "fail fast" mode for lit, where it will stop
running tests after the first failure.
- Patch by Max Moiseev.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282452
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Mon, 26 Sep 2016 22:53:15 +0000 (22:53 +0000)]
[CodeGen] Add support for emitting .init_array instead of .ctors on FreeBSD.
PR: 30494
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282451
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Mon, 26 Sep 2016 22:38:17 +0000 (22:38 +0000)]
[CodeGen] Switch test as FreeBSD will support .init_array soon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282450
91177308-0d34-0410-b5e6-
96231b3b80d8
Derek Schuff [Mon, 26 Sep 2016 21:18:03 +0000 (21:18 +0000)]
[WebAssembly] Use the frame pointer instead of the stack pointer
When we have dynamic allocas we have a frame pointer, and
when we're lowering frame indexes we should make sure we use it.
Patch by Jacob Gravelle
Differential Revision: https://reviews.llvm.org/D24889
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282442
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Mon, 26 Sep 2016 21:11:03 +0000 (21:11 +0000)]
Next set of additional error checks for invalid Mach-O files for the
other load commands that use the Mach::linkedit_data_command type
but not used in llvm libObject code but used in llvm tool code.
This includes LC_FUNCTION_STARTS, LC_SEGMENT_SPLIT_INFO
and LC_DYLIB_CODE_SIGN_DRS load commands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282441
91177308-0d34-0410-b5e6-
96231b3b80d8
Aditya Kumar [Mon, 26 Sep 2016 21:01:13 +0000 (21:01 +0000)]
Move computation past early return
Reviewers:
rafael
spatel
Differential Revision: https://reviews.llvm.org/D24843
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282440
91177308-0d34-0410-b5e6-
96231b3b80d8
Piotr Padlewski [Mon, 26 Sep 2016 20:37:32 +0000 (20:37 +0000)]
[thinlto] Basic thinlto fdo heuristic
Summary:
This patch improves thinlto importer
by importing 3x larger functions that are called from hot block.
I compared performance with the trunk on spec, and there
were about 2% on povray and 3.33% on milc. These results seems
to be consistant and match the results Teresa got with her simple
heuristic. Some benchmarks got slower but I think they are just
noisy (mcf, xalancbmki, omnetpp)- running the benchmarks again with
more iterations to confirm. Geomean of all benchmarks including the noisy ones
were about +0.02%.
I see much better improvement on google branch with Easwaran patch
for pgo callsite inlining (the inliner actually inline those big functions)
Over all I see +0.5% improvement, and I get +8.65% on povray.
So I guess we will see much bigger change when Easwaran patch will land
(it depends on new pass manager), but it is still worth putting this to trunk
before it.
Implementation details changes:
- Removed CallsiteCount.
- ProfileCount got replaced by Hotness
- hot-import-multiplier is set to 3.0 for now,
didn't have time to tune it up, but I see that we get most of the interesting
functions with 3, so there is no much performance difference with higher, and
binary size doesn't grow as much as with 10.0.
Reviewers: eraman, mehdi_amini, tejohnson
Subscribers: mehdi_amini, llvm-commits
Differential Revision: https://reviews.llvm.org/D24638
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282437
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Mon, 26 Sep 2016 20:08:05 +0000 (20:08 +0000)]
Allow StringRef to be constructed from a null pointer.
Differential Revision: https://reviews.llvm.org/D24904
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282433
91177308-0d34-0410-b5e6-
96231b3b80d8
Nirav Dave [Mon, 26 Sep 2016 19:33:36 +0000 (19:33 +0000)]
Add support for Code16GCC
[X86] The .code16gcc directive parses X86 assembly input in 32-bit mode and
outputs in 16-bit mode. Teach parser to switch modes appropriately.
Reviewers: dwmw2, craig.topper
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D20109
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282430
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Mon, 26 Sep 2016 19:05:37 +0000 (19:05 +0000)]
Add optimization bisect support to an optional Mips pass
Differential Revision: https://reviews.llvm.org/D19513
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282428
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Mon, 26 Sep 2016 18:38:07 +0000 (18:38 +0000)]
Statistic: Only print statistics on exit for -stats
Previously enabling the statistics with EnableStatistics() would lead to
them getting printed to stderr/-info-output-file on exit. However
frontends may want a way to enable statistics and do the printing on
their own instead of the forced printing on exit.
This changes the code so that only the -stats option enables printing on
exit, EnableStatistics() only enables the tracking but requires invoking
one of the PrintStatistics() variants.
Differential Revision: https://reviews.llvm.org/D24819
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282425
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Mon, 26 Sep 2016 18:38:05 +0000 (18:38 +0000)]
MachineInstr: Fix comment typo, further refine comment; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282424
91177308-0d34-0410-b5e6-
96231b3b80d8
Evandro Menezes [Mon, 26 Sep 2016 18:09:21 +0000 (18:09 +0000)]
[AArch64] Fix test triplet
Specify proper target triplet to pass under Windows too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282423
91177308-0d34-0410-b5e6-
96231b3b80d8
Vedant Kumar [Mon, 26 Sep 2016 17:57:13 +0000 (17:57 +0000)]
[llvm-cov] Silence a warning from the MSVC runtime (NFC)
Rework getLongestCommonPrefixLen() so that it doesn't access string null
terminators. The old version with std::mismatch would do this:
|
v
Strings[0] = ['a', nil]
Strings[1] = ['a', 'a', nil]
^
|
This should silence a warning from the MSVC runtime (PR30515). As
before, I tested this out by preparing a coverage report for FileCheck.
Thanks to Yaron Keren for the report!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282422
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Mon, 26 Sep 2016 17:44:31 +0000 (17:44 +0000)]
Update MemorySSA unittest to account for non-pruned SSA form
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282421
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Mon, 26 Sep 2016 17:29:25 +0000 (17:29 +0000)]
AMDGPU/SI: Don't crash on anonymous GlobalValues
Summary:
We need to call AsmPrinter::getNameWithPrefix() in order to handle
anonymous GlobalValues (e.g. @0, @1).
Reviewers: arsenm, b-sumner
Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, tony-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D24865
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282420
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Mon, 26 Sep 2016 17:22:54 +0000 (17:22 +0000)]
Remove pruning of phi nodes in MemorySSA - it makes updating harder
Reviewers: george.burgess.iv
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D24923
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282419
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthew Simpson [Mon, 26 Sep 2016 17:08:37 +0000 (17:08 +0000)]
[LV] Scalarize instructions marked scalar after vectorization
This patch ensures that we actually scalarize instructions marked scalar after
vectorization. Previously, such instructions may have been vectorized instead.
Differential Revision: https://reviews.llvm.org/D23889
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282418
91177308-0d34-0410-b5e6-
96231b3b80d8
Gor Nishanov [Mon, 26 Sep 2016 15:49:28 +0000 (15:49 +0000)]
[Coroutines] Part14: Handle coroutines with no suspend points.
Summary:
If coroutine has no suspend points, remove heap allocation and turn a coroutine into a normal function.
Also, if a pattern is detected that coroutine resumes or destroys itself prior to coro.suspend call, turn the suspend point into a simple jump to resume or cleanup label. This pattern occurs when coroutines are used to propagate errors in functions that return expected<T>.
Reviewers: majnemer
Subscribers: mehdi_amini, llvm-commits
Differential Revision: https://reviews.llvm.org/D24408
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282414
91177308-0d34-0410-b5e6-
96231b3b80d8
Geoff Berry [Mon, 26 Sep 2016 15:34:47 +0000 (15:34 +0000)]
[AArch64] Improve add/sub/cmp isel of uxtw forms.
Don't match the UXTW extended reg forms of ADD/ADDS/SUB/SUBS if the
32-bit to 64-bit zero-extend can be done for free by taking advantage
of the 32-bit defining instruction zeroing the upper 32-bits of the X
register destination. This enables better instruction selection in a
few cases, such as:
sub x0, xzr, x8
instead of:
mov x8, xzr
sub x0, x8, w9, uxtw
madd x0, x1, x1, x8
instead of:
mul x9, x1, x1
add x0, x9, w8, uxtw
cmp x2, x8
instead of:
sub x8, x2, w8, uxtw
cmp x8, #0
add x0, x8, x1, lsl #3
instead of:
lsl x9, x1, #3
add x0, x9, w8, uxtw
Reviewers: t.p.northover, jmolloy
Subscribers: mcrosier, aemerson, llvm-commits, rengolin
Differential Revision: https://reviews.llvm.org/D24747
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282413
91177308-0d34-0410-b5e6-
96231b3b80d8
Evandro Menezes [Mon, 26 Sep 2016 15:32:33 +0000 (15:32 +0000)]
Add support to optionally limit the size of jump tables.
Many high-performance processors have a dedicated branch predictor for
indirect branches, commonly used with jump tables. As sophisticated as such
branch predictors are, they tend to have well defined limits beyond which
their effectiveness is hampered or even nullified. One such limit is the
number of possible destinations for a given indirect branches that such
branch predictors can handle.
This patch considers a limit that a target may set to the number of
destination addresses in a jump table.
Patch by: Evandro Menezes <e.menezes@samsung.com>, Aditya Kumar
<aditya.k7@samsung.com>, Sebastian Pop <s.pop@samsung.com>.
Differential revision: https://reviews.llvm.org/D21940
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282412
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Bataev [Mon, 26 Sep 2016 13:18:59 +0000 (13:18 +0000)]
[InstCombine] Fixed bug introduced in r282237
The index of the new insertelement instruction was evaluated in the
wrong way, it was considered as the index of the inserted value instead
of index of the position, where the value should be inserted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282401
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Mon, 26 Sep 2016 12:38:03 +0000 (12:38 +0000)]
Fix typo in comment, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282399
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrea Di Biagio [Mon, 26 Sep 2016 12:07:23 +0000 (12:07 +0000)]
[InstCombine] Teach the udiv folding logic how to handle constant expressions.
This patch fixes PR30366.
Function foldUDivShl() worked under the assumption that one of the values
in input to the function was always an instance of llvm::Instruction.
However, function visitUDivOperand() (the only user of foldUDivShl) was
clearly violating that precondition; internally, visitUDivOperand() uses pattern
matches to check the operands of a udiv. Pattern matchers for binary operators
know how to handle both Instruction and ConstantExpr values.
This patch fixes the problem in foldUDivShl(). Now we use pattern matchers
instead of explicit casts to Instruction. The reduced test case from PR30366
has been added to test file InstCombine/udiv-simplify.ll.
Differential Revision: https://reviews.llvm.org/D24565
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282398
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan McKay [Mon, 26 Sep 2016 11:35:32 +0000 (11:35 +0000)]
[AVR] Add AVRMCExpr
Summary: This adds the AVRMCExpr headers and implementation.
Reviewers: arsenm, ruiu, grosbach, kparzysz
Subscribers: wdng, beanz, mgorny, kparzysz, jtbandes, llvm-commits
Differential Revision: https://reviews.llvm.org/D20503
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282397
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam Kolton [Mon, 26 Sep 2016 11:29:03 +0000 (11:29 +0000)]
Revert "[AMDGPU] Disassembler: print label names in branch instructions"
This reverts commit
6c6dbe625263ec9fcf8de0df27263cf147cde550.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282396
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam Kolton [Mon, 26 Sep 2016 10:05:50 +0000 (10:05 +0000)]
[AMDGPU] Disassembler: print label names in branch instructions
Summary: Add AMDGPUSymbolizer for finding names for labels from ELF symbol table.
Reviewers: vpykhtin, artem.tamazov, tstellarAMD
Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, tony-tye
Differential Revision: https://reviews.llvm.org/D24802
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282394
91177308-0d34-0410-b5e6-
96231b3b80d8
James Molloy [Mon, 26 Sep 2016 07:26:24 +0000 (07:26 +0000)]
[ARM] Promote small global constants to constant pools
If a constant is unamed_addr and is only used within one function, we can save
on the code size and runtime cost of an indirection by changing the global's storage
to inside the constant pool. For example, instead of:
ldr r0, .CPI0
bl printf
bx lr
.CPI0: &format_string
format_string: .asciz "hello, world!\n"
We can emit:
adr r0, .CPI0
bl printf
bx lr
.CPI0: .asciz "hello, world!\n"
This can cause significant code size savings when many small strings are used in one
function (4 bytes per string).
This recommit contains fixes for a nasty bug related to fast-isel fallback - because
fast-isel doesn't know about this optimization, if it runs and emits references to
a string that we inline (because fast-isel fell back to SDAG) we will end up
with an inlined string and also an out-of-line string, and we won't emit the
out-of-line string, causing backend failures.
It also contains fixes for emitting .text relocations which made the sanitizer
bots unhappy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282387
91177308-0d34-0410-b5e6-
96231b3b80d8
Zvi Rackover [Mon, 26 Sep 2016 06:42:07 +0000 (06:42 +0000)]
[X86] Optimization for replacing LEA with MOV at frame index elimination time
Summary:
Replace a LEA instruction of the form 'lea (%esp), %ebx' --> 'mov %esp, %ebx'
MOV is preferable over LEA because usually there are more issue-slots available to execute MOVs than LEAs. Latest processors also support zero-latency MOVs.
Fixes pr29022.
Reviewers: hfinkel, delena, igorb, myatsina, mkuper
Differential Revision: https://reviews.llvm.org/D24705
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282385
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Mon, 26 Sep 2016 06:29:21 +0000 (06:29 +0000)]
[PM] Refactor this unittest a bit to remove duplicated code. This was
suggested at one point during code review and I deferred it to
a follow-up commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282383
91177308-0d34-0410-b5e6-
96231b3b80d8
Ayman Musa [Mon, 26 Sep 2016 06:22:08 +0000 (06:22 +0000)]
[X86][avx512] Fix bug in masked compress store.
Differential Revision: https://reviews.llvm.org/D23984
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282381
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Mon, 26 Sep 2016 04:49:58 +0000 (04:49 +0000)]
[SCEV] Fix the order of members in the initializer list.
Noticed due to the warning on this line. Sanjoy is on
a less-than-awesome internet connection, so committing on his behalf.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282380
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Mon, 26 Sep 2016 04:17:12 +0000 (04:17 +0000)]
[PM] Add a unittest covering the invalidation of a Module analysis from
a function pass nested inside of a CGSCC pass manager.
This is very similar to the previous unittest but makes sure the
invalidation logic works across all the layers here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282378
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Mon, 26 Sep 2016 04:01:55 +0000 (04:01 +0000)]
[PM] Add a unittest for invalidating module analyses with an SCC pass.
This reinstates r280447. Original commit log:
This wasn't really well explicitly tested with a nice unittest before.
It seems good to have reasonably broken out unittests for this kind of
functionality as I'm workin go other invalidation features to make sure
none of the existing ones regress.
This still has too much duplicated code, I plan to factor that out in
a subsequent commit to use common helpers for repeated parts of this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282377
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 26 Sep 2016 02:44:10 +0000 (02:44 +0000)]
[SCEV] Assign LoopPropertiesCache in the move constructor
In a previous change I collapsed two different caches into one. When
doing that I noticed that ScalarEvolution's move constructor was not
moving those caches.
To keep the previous change simple, I've moved that bugfix into this
separate change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282376
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 26 Sep 2016 02:44:07 +0000 (02:44 +0000)]
[SCEV] Combine two predicates into one; NFC
Both `loopHasNoSideEffects` and `loopHasNoAbnormalExits` involve walking
the loop and maintaining similar sorts of caches. This commit changes
SCEV to compute both the predicates via a single walk, and maintain a
single cache instead of two.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282375
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 26 Sep 2016 01:10:27 +0000 (01:10 +0000)]
[SCEV] Make it obvious BackedgeTakenInfo's constructor steals storage
Specifically, it moves SCEVUnionPredicates from its input into its own
storage. Make this obvious at the type level.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282374
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 26 Sep 2016 01:10:25 +0000 (01:10 +0000)]
[SCEV] Further isolate incidental data structure; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282373
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 26 Sep 2016 01:10:22 +0000 (01:10 +0000)]
[SCEV] Simplify BackedgeTakenInfo::getMax; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282372
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 26 Sep 2016 00:22:18 +0000 (00:22 +0000)]
Appease MSVC
... by not default move constructors and operator= s. Defaulting these
works in clang, but not in MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282370
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 26 Sep 2016 00:00:51 +0000 (00:00 +0000)]
Attempt to appease MSVC
... by explicitly deleting the copy constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282369
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Sun, 25 Sep 2016 23:12:08 +0000 (23:12 +0000)]
[SCEV] Reserve space in SmallVector; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282368
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Sun, 25 Sep 2016 23:12:06 +0000 (23:12 +0000)]
[SCEV] Document a gotcha; NFC
We should re-consider the design decision that led to this gotcah, but
for now just document it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282367
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Sun, 25 Sep 2016 23:12:04 +0000 (23:12 +0000)]
[SCEV] Have ExitNotTakenInfo keep a pointer to its predicate; NFC
SCEVUnionPredicate is a "heavyweight" structure, so it is beneficial to
store the (optional) data out of line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282366
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Sun, 25 Sep 2016 23:12:00 +0000 (23:12 +0000)]
[SCEV] Simplify tracking ExitNotTakenInfo instances; NFC
This change simplifies a data structure optimization in the
`BackedgeTakenInfo` class for loops with exactly one computable exit.
I've sanity checked that this does not regress compile time performance,
using sqlite3's amalgamated build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282365
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Sun, 25 Sep 2016 23:11:57 +0000 (23:11 +0000)]
[SCEV] Rename a couple of fields; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282364
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Sun, 25 Sep 2016 23:11:55 +0000 (23:11 +0000)]
[SCEV] Remove incidental data structure; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282363
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Sun, 25 Sep 2016 23:11:51 +0000 (23:11 +0000)]
[SCEV] Clang format most of the SCEV header; NFC
The indentation for the declared classes was not as per LLVM coding
style.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282362
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 25 Sep 2016 16:34:11 +0000 (16:34 +0000)]
[X86] Remove what appears to be leftover MMX code involving (v1i64 scalar_to_vector).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282361
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 25 Sep 2016 16:34:09 +0000 (16:34 +0000)]
[X86] Remove patterns for scalar_to_vector from FR32/FR64 to 256-bit vectors. Lowering explicitly avoids creating this pattern.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282360
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 25 Sep 2016 16:34:06 +0000 (16:34 +0000)]
[AVX-512] Replace get512BitSuperRegister with calls to TargetRegisterInfo::getMatchingSuperReg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282359
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 25 Sep 2016 16:34:02 +0000 (16:34 +0000)]
[AVX-512] Fix some patterns predicates to properly enforce priority for various versions of CVTDQ2PD instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282358
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 25 Sep 2016 16:33:59 +0000 (16:33 +0000)]
[AVX-512] Add rounding versions of instructions to hasUndefRegUpdate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282357
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 25 Sep 2016 16:33:57 +0000 (16:33 +0000)]
[AVX-512] Add the scalar unsigned integer to fp conversion instructions to hasUndefRegUpdate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282356
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 25 Sep 2016 16:33:53 +0000 (16:33 +0000)]
[AVX-512] Remove duplicate instructions for converting integer to scalar floating point. We can use patterns to point to the other instructions instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282355
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Sun, 25 Sep 2016 04:06:39 +0000 (04:06 +0000)]
Add a comment on StringRef::contains(char)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282350
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Sun, 25 Sep 2016 03:57:34 +0000 (03:57 +0000)]
Fix signed / unsigned comparison.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282348
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Sun, 25 Sep 2016 03:27:29 +0000 (03:27 +0000)]
Add some predicated searching functions to StringRef.
This adds 4 new functions to StringRef, which can be used to
take or drop characters while a certain condition is met, or
until a certain condition is met. They are:
take_while - Return characters until a condition is not met.
take_until - Return characters until a condition is met.
drop_while - Remove characters until a condition is not met.
drop_until - Remove characters until a condition is met.
Internally, all of these functions delegate to two additional
helper functions which can be used to search for the position
of a character meeting or not meeting a condition, which are:
find_if - Find the first character matching a predicate.
find_if_not - Find the first character not matching a predicate.
Differential Revision: https://reviews.llvm.org/D24842
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282346
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 25 Sep 2016 01:03:10 +0000 (01:03 +0000)]
[AVX-512] Don't use two opcodes for INTR_TYPE_SCALAR_MASK_RM. The handling was such that if the second opcode was present the first was ingored, so we can just have one opcode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282344
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 24 Sep 2016 21:42:49 +0000 (21:42 +0000)]
[X86] Teach combineShuffle to avoid creating floating point operations with integer types and integer operations with floating point types. Seems isOperationLegal lies for mismatched types and operations.
Fixes PR30511.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282341
91177308-0d34-0410-b5e6-
96231b3b80d8