Eric Christopher [Mon, 19 Sep 2016 21:55:04 +0000 (21:55 +0000)]
Move the armv8.1-a ras test to a negative with noras test as ras is
included in armv8.1-a by default and so we weren't testing anything.
llvm-svn: 281941
Mehdi Amini [Mon, 19 Sep 2016 21:27:04 +0000 (21:27 +0000)]
BitcodeWriter: fix emission of invoke when calling a var-arg function with operand bundles
llvm-svn: 281940
Evgeniy Stepanov [Mon, 19 Sep 2016 21:26:05 +0000 (21:26 +0000)]
Misleading comments of SplitBlockAndInsertIfThenElse in BasicBlockUtils.h
The comments of SplitBlockAndInsertIfThenElse say the SplitBefore instruction will stay in the old block.
But according to the implementation(split the block at SplitBefore by using splitBasicBlock), the SplitBefore will be moved to the new block.
This patch fixes the comments.
Patch by Zhe Yu Wu.
llvm-svn: 281939
Kostya Kortchinsky [Mon, 19 Sep 2016 21:11:55 +0000 (21:11 +0000)]
[scudo] Modify Scudo to use its own Secondary Allocator
Summary:
The Sanitizer Secondary Allocator was not entirely ideal was Scudo for several
reasons: decent amount of unneeded code, redundant checks already performed by
the front end, unneeded data structures, difficulty to properly protect the
secondary chunks header.
Given that the second allocator is pretty straight forward, Scudo will use its
own, trimming all the unneeded code off of the Sanitizer one. A significant
difference in terms of security is that now each secondary chunk is preceded
and followed by a guard page, thus mitigating overflows into and from the
chunk.
A test was added as well to illustrate the overflow & underflow situations
into the guard pages.
Reviewers: kcc
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D24737
llvm-svn: 281938
Simon Pilgrim [Mon, 19 Sep 2016 20:50:35 +0000 (20:50 +0000)]
[X86][SSE] Updated vector abs tests
Renamed and added v2i64 / v4i64 tests
llvm-svn: 281937
Dan Albert [Mon, 19 Sep 2016 20:42:57 +0000 (20:42 +0000)]
Fix signatures of fallback tow(upper|lower)_l.
Summary:
These functions take and return wint_t, not int:
http://pubs.opengroup.org/onlinepubs/
9699919799/functions/towupper.html
Reviewers: mclow.lists, EricWF
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D24743
llvm-svn: 281936
Eric Liu [Mon, 19 Sep 2016 20:41:39 +0000 (20:41 +0000)]
Add missing dependency to change-namespace.
llvm-svn: 281935
Gabor Horvath [Mon, 19 Sep 2016 20:39:52 +0000 (20:39 +0000)]
[analyzer] Calculate extent size for memory regions allocated by new expression.
ArrayBoundChecker did not detect out of bounds memory access errors in case an
array was allocated by the new expression. This patch resolves this issue.
Patch by Daniel Krupp!
Differential Revision: https://reviews.llvm.org/D24307
llvm-svn: 281934
Kostya Serebryany [Mon, 19 Sep 2016 20:32:34 +0000 (20:32 +0000)]
[libFuzzer] use sleep() instead of std::this_thread::sleep_for to avoid coverage from instrumented libc++
llvm-svn: 281933
Rafael Espindola [Mon, 19 Sep 2016 20:23:19 +0000 (20:23 +0000)]
Use FileCheck variables. NFC.
llvm-svn: 281932
Rafael Espindola [Mon, 19 Sep 2016 19:59:21 +0000 (19:59 +0000)]
Map .data.rel.ro correctly.
An input section named .data.rel.ro now maps to an output section
named .data.rel.ro. Before we were mapping it to .data.
llvm-svn: 281931
Rafael Espindola [Mon, 19 Sep 2016 19:56:51 +0000 (19:56 +0000)]
Make this test a bit stricter.
By making every section on byte and checking the size it now shows how
many sections were concatenated into each output section.
llvm-svn: 281930
Rafael Espindola [Mon, 19 Sep 2016 18:58:30 +0000 (18:58 +0000)]
Don't CHECK the addresses. NFC
That is not what this test is about. This reduces changes in another
patch that changes layout.
llvm-svn: 281929
Dehao Chen [Mon, 19 Sep 2016 18:38:14 +0000 (18:38 +0000)]
Handle early inline for hot callsites that reside in the same basic block.
Summary: Callsites in the same basic block should share the same hotness. This patch checks for the hottest callsite in the same basic block, and use the hotness for all callsites in that basic block for early inline decisions. It also fixes the test to add "-S" so theat the "CHECK-NOT" is actually checking the content.
Reviewers: dnovillo
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D24734
llvm-svn: 281927
Zachary Turner [Mon, 19 Sep 2016 18:32:23 +0000 (18:32 +0000)]
Fix compilation of unit tests.
llvm-svn: 281926
Shoaib Meenai [Mon, 19 Sep 2016 18:29:07 +0000 (18:29 +0000)]
[libc++] Fix extern template visibility for Windows
On Windows, marking an `extern template class` declaration as exported
actually forces an instantiation, which is not the desired behavior.
Instead, the actual explicit instantiations need to be exported.
Differential Revision: https://reviews.llvm.org/D24679
llvm-svn: 281925
Samuel Antao [Mon, 19 Sep 2016 18:13:13 +0000 (18:13 +0000)]
Reorder initializers in CallStackFrame so that we don't get a warning.
llvm-svn: 281923
Zachary Turner [Mon, 19 Sep 2016 18:03:54 +0000 (18:03 +0000)]
Try to fix freebsd and android builds.
llvm-svn: 281922
Dan Albert [Mon, 19 Sep 2016 18:00:45 +0000 (18:00 +0000)]
Replace __ANDROID__ with __BIONIC__.
Summary:
None of these checks are specific to Android devices. If libc++ was
used with Bionic on a normal Linux system these checks would still be
needed.
Reviewers: mclow.lists, EricWF
Subscribers: compnerd, tberghammer, danalbert, srhines, cfe-commits
Differential Revision: https://reviews.llvm.org/D24690
llvm-svn: 281921
Eric Liu [Mon, 19 Sep 2016 17:58:59 +0000 (17:58 +0000)]
Trying to fix name conflict in change-namespace tool.
llvm-svn: 281920
Zachary Turner [Mon, 19 Sep 2016 17:54:06 +0000 (17:54 +0000)]
Fix more functions in Args to use StringRef.
This patch also marks the const char* versions as =delete to prevent
their use. This has the potential to cause build breakages on some
platforms which I can't compile. I have tested on Windows, Linux,
and OSX. Best practices for fixing broken callsites are outlined in
Args.h in a comment above the deleted function declarations.
Eventually we can remove these =delete declarations, but for now they
are important to make sure that all implicit conversions from
const char * are manually audited to make sure that they do not invoke a
conversion from nullptr.
llvm-svn: 281919
Eric Liu [Mon, 19 Sep 2016 17:40:32 +0000 (17:40 +0000)]
A clang tool for changing surrouding namespaces of class/function definitions.
Summary:
A tool for changing surrouding namespaces of class/function definitions while keeping
references to types in the changed namespace correctly qualified by prepending
namespace specifiers before them.
Example: test.cc
namespace na {
class X {};
namespace nb {
class Y { X x; };
} // namespace nb
} // namespace na
To move the definition of class Y from namespace "na::nb" to "x::y", run:
clang-change-namespace --old_namespace "na::nb" \
--new_namespace "x::y" --file_pattern "test.cc" test.cc --
Output:
namespace na {
class X {};
} // namespace na
namespace x {
namespace y {
class Y { na::X x; };
} // namespace y
} // namespace x
Reviewers: alexfh, omtcyfz, hokein
Subscribers: mgorny, klimek, djasper, beanz, alexshap, Eugene.Zelenko, cfe-commits
Differential Revision: https://reviews.llvm.org/D24183
llvm-svn: 281918
Davide Italiano [Mon, 19 Sep 2016 17:38:39 +0000 (17:38 +0000)]
[Writer] Rename variables to reflect reality. NFCI.
The InputSection variables in the Writer were named `C`. This
was because when the ELF linker was ported (from COFF)
the name `Chunks` for input sections was retained.
Luckily we switched to a more ELF-compliant jargon, but these
variables weren't reanamed accordingly during the transition.
llvm-svn: 281917
Quentin Colombet [Mon, 19 Sep 2016 17:33:55 +0000 (17:33 +0000)]
[RegisterBankInfo] Avoid heap allocation in most cases.
The OperandsMapper class is used heavy in RegBankSelect and each
instantiation triggered a heap allocation for the array of operands.
Instead, use a SmallVector with a big enough size such that most of the
cases do not have to use dynamically allocated memory.
This improves the compile time of the RegBankSelect pass.
llvm-svn: 281916
Yaxun Liu [Mon, 19 Sep 2016 17:11:22 +0000 (17:11 +0000)]
[OpenCL] Allow half type kernel argument when cl_khr_fp16 is enabled
llvm-svn: 281915
Matthias Braun [Mon, 19 Sep 2016 16:49:45 +0000 (16:49 +0000)]
LiveRangeCalc: Fix reporting of invalid vreg usage in liveness calculation
Machine programs need a definition of each vreg before reaching a use
(the definition may come from an IMPLICIT_DEF instruction). This class
of errors is not detected by the MachineVerifier because of efficiency
concerns. LiveRangeCalc used to report these problems, make it do that
again (followup to r279625).
Also use report_fatal_error() instead of llvm_unreachable() as the error
reporting is only present in asserts build anyway.
llvm-svn: 281914
Todd Fiala [Mon, 19 Sep 2016 16:42:41 +0000 (16:42 +0000)]
Xcode: support gtests that use the Inputs dir
This change adds support for the gtests that require input data
in the Inputs files. This is done through a new Xcode script
phase that runs the scripts/Xcode/prepare-gtest-run-dir.sh script.
That script simply copies the contents of all unittests/**/Inputs
dirs into ${TARGET_BUILD_DIR}/Inputs before running the test.
This change also renames the Xcode 'gtest-for-debugging' to
'gtest-build', and makes the gtest "build and run" target
depend on gtest-build. This reduces replication within the
targets. gtest .c/.cpp files now should only be added to
the gtest-build target.
llvm-svn: 281913
Dehao Chen [Mon, 19 Sep 2016 16:33:41 +0000 (16:33 +0000)]
Only set branch weight during sample pgo annotation when max_weight of the branch is non-zero. Otherwise use default static profile to set branch probability.
Summary: It does not make sense to set equal weights for all unkown branches as we have static branch prediction available.
Reviewers: dnovillo
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D24732
llvm-svn: 281912
Dehao Chen [Mon, 19 Sep 2016 16:06:37 +0000 (16:06 +0000)]
Use call target count to derive the call instruction weight
Summary: The call target count profile is directly derived from LBR branch->target data. This is more reliable than instruction frequency profiles that could be moved across basic block boundaries. This patches uses call target count profile to annotate call instructions.
Reviewers: davidxl, dnovillo
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D24410
llvm-svn: 281911
Dehao Chen [Mon, 19 Sep 2016 16:02:52 +0000 (16:02 +0000)]
Remove InstructionCombining and its related pass from sample pgo passes as we can handle "invoke" correctly.
Summary: We previously relies on InstructionCombining pass to remove invoke instructions. Now that we can inline invoke instructions correctly, we do not need these passes any more.
Reviewers: dnovillo
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D24730
llvm-svn: 281910
Etienne Bergeron [Mon, 19 Sep 2016 15:59:01 +0000 (15:59 +0000)]
[compiler-rt] Add support for the dynamic shadow allocation
Summary:
This patch is adding the needed code to compiler-rt to support
dynamic shadow.
This is to support this patch:
https://reviews.llvm.org/D23354
It's adding support for using a shadow placed at a dynamic address determined
at runtime.
The dynamic shadow is required to work on windows 64-bits.
Reviewers: rnk, kcc, vitalybuka
Subscribers: kubabrecka, dberris, llvm-commits, chrisha
Differential Revision: https://reviews.llvm.org/D23363
llvm-svn: 281909
Etienne Bergeron [Mon, 19 Sep 2016 15:58:38 +0000 (15:58 +0000)]
[asan] Support dynamic shadow address instrumentation
Summary:
This patch is adding the support for a shadow memory with
dynamically allocated address range.
The compiler-rt needs to export a symbol containing the shadow
memory range.
This is required to support ASAN on windows 64-bits.
Reviewers: kcc, rnk, vitalybuka
Subscribers: kubabrecka, dberris, llvm-commits, chrisha
Differential Revision: https://reviews.llvm.org/D23354
llvm-svn: 281908
Alexander Shaposhnikov [Mon, 19 Sep 2016 15:57:29 +0000 (15:57 +0000)]
Remove excessive padding from the struct CallStackFrame
The struct CallStackFrame is in lib/AST/ExprConstant.cpp
inside anonymous namespace.
This diff reorders the fields and removes excessive padding.
Test plan: make -j8 check-clang
Differential revision: https://reviews.llvm.org/D23901
llvm-svn: 281907
Zachary Turner [Mon, 19 Sep 2016 15:34:51 +0000 (15:34 +0000)]
[Support] Add StringRef::withNullAsEmpty()
When porting large bodies of code from using const char*
to StringRef, it is helpful to be able to treat nullptr
as an empty string, since that it is often what it is used
to indicate in C-style code.
Differential Revision: https://reviews.llvm.org/D24697
llvm-svn: 281906
Nico Weber [Mon, 19 Sep 2016 15:22:04 +0000 (15:22 +0000)]
Revert r281841, it does not work on Windows (PR30443).
llvm-svn: 281905
Yaxun Liu [Mon, 19 Sep 2016 14:54:41 +0000 (14:54 +0000)]
[OpenCL] Diagnose assignment to dereference of half type pointer
Differential Revision: https://reviews.llvm.org/D24626
llvm-svn: 281904
Valery Pykhtin [Mon, 19 Sep 2016 14:39:49 +0000 (14:39 +0000)]
[AMDGPU] Refactor VOPC instruction TD definitions
Differential Revision: https://reviews.llvm.org/D24546
llvm-svn: 281903
Kostya Serebryany [Mon, 19 Sep 2016 14:18:16 +0000 (14:18 +0000)]
[sanitizer] rename __sanitizer_symbolize_data to __sanitizer_symbolize_global (to avoid conflict with another definition)
llvm-svn: 281902
Rafael Espindola [Mon, 19 Sep 2016 13:33:38 +0000 (13:33 +0000)]
Remove unnecessary const_canst. NFC.
llvm-svn: 281901
George Rimar [Mon, 19 Sep 2016 13:27:31 +0000 (13:27 +0000)]
[ELF] - LinkerScript: Add workaround for gcc 6.2.0 failure w/auto
Will Dietz found and reported that lld does not compile with gcc 6.2.0,
more details https://llvm.org/bugs/show_bug.cgi?id=30438
And confirmed this change fixes the issue.
llvm-svn: 281900
Neil Hickey [Mon, 19 Sep 2016 11:42:14 +0000 (11:42 +0000)]
Reverting r281714 due to causing an assert when calling builtins that expect a double, from CL
llvm-svn: 281899
Diana Picus [Mon, 19 Sep 2016 11:10:18 +0000 (11:10 +0000)]
[AArch64] Fix encoding for lsl #12 in add/sub immediates
Whenever an add/sub immediate needs a fixup, we set that immediate field to zero,
which is correct, but we also set the shift bits to zero, which is not true for
instructions that use lsl #12. This patch makes sure that if lsl #12 was used,
it will appear in the encoding of the instruction.
Differential Revision: https://reviews.llvm.org/D23930
llvm-svn: 281898
Tobias Grosser [Mon, 19 Sep 2016 10:55:31 +0000 (10:55 +0000)]
Fix spelling in CMakeLists
llvm-svn: 281897
Sam Kolton [Mon, 19 Sep 2016 10:20:55 +0000 (10:20 +0000)]
[AMDGPU] Fix s_branch with -1 offset
Summary:
In case s_branch instruction target is itself backend should emit offset -1 but instead it emit 0.
'''
label:
s_branch label // should emit [0xff,0xff,0x82,0xbf]
'''
Tom, Matt: why are we adjusting fixup values in applyFixup() method instead of processFixup()? processFixup() is calling adjustFixupValue() but does nothing with its result.
Reviewers: vpykhtin, artem.tamazov, tstellarAMD
Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl
Differential Revision: https://reviews.llvm.org/D24671
llvm-svn: 281896
Keith Walker [Mon, 19 Sep 2016 09:49:30 +0000 (09:49 +0000)]
Add @llvm.dbg.value entries for the phi node created by -mem2reg
When phi nodes are created in the -mem2reg phase, the @llvm.dbg.declare
entries are converted to @llvm.dbg.value entries at the place where the
store instructions existed. However no entry is created to describe
the resulting value of the phi node.
The effect of this is especially noticeable in for loops which have a
constant for the intial value; the loop control variable's location
would be described as the intial constant value in the loop body once
the -mem2reg optimization phase was run.
This change adds the creation of the @llvm.dbg.value entries to describe
variables whose location is the result of a phi node created in -mem2reg.
Also when the phi node is finally lowered to a machine instruction it
is important that the lowered "load" instruction is placed before the
associated DEBUG_VALUE entry describing the value loaded.
Differential Revision: https://reviews.llvm.org/D23715
llvm-svn: 281895
Oliver Stannard [Mon, 19 Sep 2016 09:21:45 +0000 (09:21 +0000)]
[Thumb] Set correct initial mapping symbol for big-endian thumb
The initial mapping symbol state is set from the triple, but we only checked
for the little-endian thumb triple, so could end up with an ARM mapping symbol
for big-endian thumb.
Differential Revision: https://reviews.llvm.org/D24553
llvm-svn: 281894
Tim Northover [Mon, 19 Sep 2016 09:11:09 +0000 (09:11 +0000)]
ARM: check alignment before transforming ldr -> ldm (or similar).
ldm and stm instructions always require 4-byte alignment on the pointer, but we
weren't checking this before trying to reduce code-size by replacing a
post-indexed load/store with them. Unfortunately, we were also dropping this
incormation in DAG ISel too, but that's easy enough to fix.
llvm-svn: 281893
Elena Demikhovsky [Mon, 19 Sep 2016 08:58:43 +0000 (08:58 +0000)]
[X86 Codegen Test] Divided masked_memop into several files. NFC.
The masked_memop.ll became huge. I extracted AVX-512 specific tests into separate files.
llvm-svn: 281892
Eric Liu [Mon, 19 Sep 2016 08:40:42 +0000 (08:40 +0000)]
Recommit r281457 "Supports adding insertion around non-insertion replacements".
Summary:
Diff to r281457:
- added a test case `CalculateRangesOfInsertionAroundReplacement`.
Reviewers: djasper
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D24606
llvm-svn: 281891
James Molloy [Mon, 19 Sep 2016 08:23:08 +0000 (08:23 +0000)]
[SimplifyCFG] Update (AND) IR flags when CSE'ing instructions
We were updating metadata but not IR flags. Because we pick an arbitrary instruction to be the CSE candidate, it comes down to luck (50% or less chance) if this results in broken codegen or not, which is why PR30373 which is actually not the fault of the commit it was bisected down to.
Fixes PR30373.
llvm-svn: 281889
Martin Probst [Mon, 19 Sep 2016 07:02:34 +0000 (07:02 +0000)]
clang-format: [JS] Fix line breaks before comments when sorting imports.
Summary:
Previously, clang-format would always insert an additional line break after the
import block if the main body started with a comment, due to loosing track of
the first non-import line.
Reviewers: djasper
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D24708
llvm-svn: 281888
Michal Gorny [Mon, 19 Sep 2016 06:55:56 +0000 (06:55 +0000)]
Fix respecting LIBOMP_LLVM_LIT_EXECUTABLE as full path
Fix lit search to correctly respect LIBOMP_LLVM_LIT_EXECUTABLE as full
program path.
The variable passed to find_program() is created by CMake as a cache
variable, and therefore can be directly overriden by the user. Since
this was the design of LIBOMP_LLVM_LIT_EXECUTABLE (as can be deduced
from the error messages) and there is no other use of LIT_EXECUTABLE,
remove the redundant variable and pass LIBOMP_LLVM_LIT_EXECUTABLE
directly to find_program().
Furthermore, the previous code did not work since the HINTS argument
specifies more search directories rather than expected full path.
Quoting the CMake documentation:
> 3. Search the paths specified by the HINTS option. These should be
> paths computed by system introspection, such as a hint provided by
> the location of another item already found. Hard-coded guesses should
> be specified with the PATHS option.
Differential Revision: https://reviews.llvm.org/D24710
llvm-svn: 281887
Kostya Serebryany [Mon, 19 Sep 2016 05:10:32 +0000 (05:10 +0000)]
[sanitizer] add __sanitizer_symbolize_data (can only print the names of the globals for now)
llvm-svn: 281886
Craig Topper [Mon, 19 Sep 2016 02:53:43 +0000 (02:53 +0000)]
[X86,AVX-512] Use INSERT_SUBREG instead of SUBREG_TO_REG when the input is not the output of an instruction.
SUBREG_TO_REG is supposed to indicate that the super register has been zeroed, but we can't prove that if we don't know where it came from.
llvm-svn: 281885
Craig Topper [Mon, 19 Sep 2016 02:53:37 +0000 (02:53 +0000)]
[AVX-512] Add support for lowering fp_to_f16 and f16_to_fp when VLX is supported regardless of whether F16C is also supported.
Still need to add support for lowering using AVX512F when neither VLX or F16C is supported.
llvm-svn: 281884
Vedant Kumar [Mon, 19 Sep 2016 02:15:59 +0000 (02:15 +0000)]
[llvm-cov] Emit a link to some documentation
llvm-svn: 281883
Vedant Kumar [Mon, 19 Sep 2016 01:46:01 +0000 (01:46 +0000)]
[llvm-cov] Delete the NonCodeLines field, it was always dead
llvm-svn: 281882
Vedant Kumar [Mon, 19 Sep 2016 01:42:38 +0000 (01:42 +0000)]
[docs] Touch up the code coverage doc
llvm-svn: 281881
Devin Coughlin [Mon, 19 Sep 2016 01:36:40 +0000 (01:36 +0000)]
[analyzer] SATestBuild.py: Treat '#' as comment in projectMap.csv
Treat lines in projectMap.csv that start with '#' as comments. This enables a
workflow where projects can be temporarily disabled with a comment describing
when they should be turned back on.
Differential Revision: https://reviews.llvm.org/D24709
llvm-svn: 281880
Dean Michael Berris [Mon, 19 Sep 2016 00:59:19 +0000 (00:59 +0000)]
[XRay] ARM 32-bit no-Thumb support in Clang
Just a test for now, adapted from x86_64 tests of XRay.
This is one of 3 commits to different repositories of XRay ARM port. The other 2 are:
https://reviews.llvm.org/D23931 (LLVM)
https://reviews.llvm.org/D23933 (compiler-rt)
Differential Revision: https://reviews.llvm.org/D23932
llvm-svn: 281879
Dean Michael Berris [Mon, 19 Sep 2016 00:54:35 +0000 (00:54 +0000)]
[XRay] ARM 32-bit no-Thumb support in LLVM
This is a port of XRay to ARM 32-bit, without Thumb support yet. The XRay instrumentation support is moving up to AsmPrinter.
This is one of 3 commits to different repositories of XRay ARM port. The other 2 are:
https://reviews.llvm.org/D23932 (Clang test)
https://reviews.llvm.org/D23933 (compiler-rt)
Differential Revision: https://reviews.llvm.org/D23931
llvm-svn: 281878
Vedant Kumar [Mon, 19 Sep 2016 00:38:29 +0000 (00:38 +0000)]
[llvm-cov] Teach the coverage exporter about instantiation coverage
While we're at it, re-use the logic from CoverageReport to compute
summaries.
llvm-svn: 281877
Vedant Kumar [Mon, 19 Sep 2016 00:38:25 +0000 (00:38 +0000)]
[llvm-cov] Make a helper method static for re-use (NFC)
llvm-svn: 281876
Vedant Kumar [Mon, 19 Sep 2016 00:38:23 +0000 (00:38 +0000)]
[llvm-cov] Track function and instantiation coverage separately
These are distinct statistics which are useful to look at separately.
Example: say you have a template function "foo" with 5 instantiations
and only 3 of them are covered. Then this contributes (1/1) to the total
function coverage and (3/5) to the total instantiation coverage. I.e,
the old "Function Coverage" column has been renamed to "Instantiation
Coverage", and the new "Function Coverage" aggregates information from
the various instantiations of a function.
One benefit of making this switch is that the Line and Region coverage
columns will start making sense. Let's continue the example and assume
that the 5 instantiations of "foo" cover {2, 4, 6, 8, 10} out of 10
lines respectively. The new line coverage for "foo" is (10/10), not
(30/50). The old scenario got confusing because we'd report that there
were more lines in a file than what was actually possible.
llvm-svn: 281875
Vedant Kumar [Mon, 19 Sep 2016 00:38:18 +0000 (00:38 +0000)]
[llvm-cov] Don't recompute the 'Covered' field from *CoverageInfo (NFC)
llvm-svn: 281874
Vedant Kumar [Mon, 19 Sep 2016 00:38:16 +0000 (00:38 +0000)]
[llvm-cov] Make 'adjustColumnWidths' do less work
This drops some redundant calls to get{UniqueSourceFiles,
CoveredFunctions}. We can figure out the right column widths without
re-doing this expensive work.
This isn't NFC, but I don't want to check in another binary *.covmapping
file with long filenames in it. I tested this locally on a project with
some long filenames (FileCheck).
llvm-svn: 281873
Vedant Kumar [Mon, 19 Sep 2016 00:38:14 +0000 (00:38 +0000)]
[llvm-cov] Drop another redundant 'No.' suffix
llvm-svn: 281872
Vedant Kumar [Mon, 19 Sep 2016 00:38:11 +0000 (00:38 +0000)]
[utils] Delete the 'check-coverage-regressions' script
In practice, it's way too noisy.
It's also a maintenance burden, since we apparently can't add tests for
it without breaking some Windows setups (see: D22692).
llvm-svn: 281871
Dehao Chen [Sun, 18 Sep 2016 23:11:37 +0000 (23:11 +0000)]
Handle Invoke during sample profiler annotation: make it inlinable.
Summary: Previously we reline on inst-combine to remove inlinable invoke instructions. This causes trouble because a few extra optimizations are schedule early that could introduce too much CFG change (e.g. simplifycfg removes too much control flow). This patch handles invoke instruction in-place during sample profile annotation, so that we do not rely on instcombine to remove those invoke instructions.
Reviewers: davidxl, dnovillo
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D24409
llvm-svn: 281870
Xinliang David Li [Sun, 18 Sep 2016 22:10:19 +0000 (22:10 +0000)]
Extend title underline
llvm-svn: 281869
Craig Topper [Sun, 18 Sep 2016 21:49:32 +0000 (21:49 +0000)]
[AVX-512] Don't lower CVTPD2PS intrinsics to ISD::FP_ROUND with an X86 rounding mode encoding in the second operand. This immediate should only be 0 or 1 and indicates if the truncation loses precision.
Also enhance an assert in SelectionDAG::getNode to flag this sort of problem in the future.
llvm-svn: 281868
Craig Topper [Sun, 18 Sep 2016 21:49:28 +0000 (21:49 +0000)]
[AVX-512] Stop lowering avx512_mask_sqrt intrinsics to ISD:FSQRT with a second operand containing an X86 specific rounding mode encoding that doesn't belong.
llvm-svn: 281867
Kostya Serebryany [Sun, 18 Sep 2016 21:47:08 +0000 (21:47 +0000)]
[libFuzzer] add -print_coverage=1 flag to print coverage directly from libFuzzer
llvm-svn: 281866
Simon Pilgrim [Sun, 18 Sep 2016 21:08:35 +0000 (21:08 +0000)]
Fix covered-switch-default warning
llvm-svn: 281865
Simon Pilgrim [Sun, 18 Sep 2016 21:01:20 +0000 (21:01 +0000)]
[CostModel][X86] Added scalar float op costs
llvm-svn: 281864
Simon Pilgrim [Sun, 18 Sep 2016 20:25:41 +0000 (20:25 +0000)]
Rename tests
llvm-svn: 281863
Craig Topper [Sun, 18 Sep 2016 18:59:38 +0000 (18:59 +0000)]
[X86] Fix typo in comment. NFC
llvm-svn: 281862
Craig Topper [Sun, 18 Sep 2016 18:59:36 +0000 (18:59 +0000)]
[AVX-512] Add memory load patterns for the legacy SSE scalar fp to integer conversion intrinsics to be consistent across all intruction sets.
llvm-svn: 281861
Craig Topper [Sun, 18 Sep 2016 18:59:33 +0000 (18:59 +0000)]
[AVX-512] Remove COPY_TO_REGCLASS from a few patterns that already had the correct register class.
llvm-svn: 281860
Xinliang David Li [Sun, 18 Sep 2016 18:52:08 +0000 (18:52 +0000)]
Fix built bot failure
llvm-svn: 281859
Xinliang David Li [Sun, 18 Sep 2016 18:34:07 +0000 (18:34 +0000)]
[Profile] Implement select instruction instrumentation in IR PGO
Differential Revision: http://reviews.llvm.org/D23727
llvm-svn: 281858
Martin Probst [Sun, 18 Sep 2016 17:33:51 +0000 (17:33 +0000)]
clang-format: [JS] Do not wrap taze annotation comments.
Summary:
`// taze: ... from ...` comments are used help tools where a
specific global symbol comes from.
Before:
// taze: many, different, symbols from
// 'some_long_location_here'
After:
// taze: many, different, symbols from 'some_long_location_here'
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D24477
llvm-svn: 281857
Martin Probst [Sun, 18 Sep 2016 17:21:52 +0000 (17:21 +0000)]
clang-format: [JS] ASI insertion after boolean literals.
Summary:
Before when a semicolon was missing after a boolean literal:
a = true
return 1;
clang-format would parse this as one line and format as:
a = true return 1;
It turns out that C++ does not consider `true` and `false` to be literals, we
have to check for that explicitly.
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D24574
llvm-svn: 281856
Saleem Abdulrasool [Sun, 18 Sep 2016 16:12:14 +0000 (16:12 +0000)]
CodeGen: mark ObjC cstring literals as unnamed_addr
These are all emitted into a section with a cstring_literal attribute. The
attribute permits the linker to coalesce the string contents. The address of
the strings are not important.
llvm-svn: 281855
Saleem Abdulrasool [Sun, 18 Sep 2016 16:12:04 +0000 (16:12 +0000)]
CodeGen: mark ObjC cstring literals as constant
These strings are constants, mark them as such. This doesn't matter too much in
practice on MachO since the constants are placed into a special section and not
referred to directly.
llvm-svn: 281854
Elena Demikhovsky [Sun, 18 Sep 2016 13:56:08 +0000 (13:56 +0000)]
[Loop Vectorizer] Consecutive memory access - fixed and simplified
Amended consecutive memory access detection in Loop Vectorizer.
Load/Store were not handled properly without preceding GEP instruction.
Differential Revision: https://reviews.llvm.org/D20789
llvm-svn: 281853
Simon Pilgrim [Sun, 18 Sep 2016 12:45:23 +0000 (12:45 +0000)]
[X86][SSE] Improve recognition of uitofp conversions that can be performed as sitofp
With D24253 we can now use SelectionDAG::SignBitIsZero with vector operations.
This patch uses SelectionDAG::SignBitIsZero to recognise that a zero sign bit means that we can use a sitofp instead of a uitofp (which is not directly support on pre-AVX512 hardware).
While AVX512 does provide support for uitofp, the conversion to sitofp should not cause any regressions.
Differential Revision: https://reviews.llvm.org/D24343
llvm-svn: 281852
Elena Demikhovsky [Sun, 18 Sep 2016 09:22:54 +0000 (09:22 +0000)]
[Loop vectorizer] Simplified GEP cloning. NFC.
Simplified GEP cloning in vectorizeMemoryInstruction().
Added an assertion that checks consecutive GEP, which should have only one loop-variant operand.
Differential Revision: https://reviews.llvm.org/D24557
llvm-svn: 281851
Tobias Grosser [Sun, 18 Sep 2016 08:57:38 +0000 (08:57 +0000)]
GPGPU: add missing REQUIRES line to test case
llvm-svn: 281850
Tobias Grosser [Sun, 18 Sep 2016 08:31:09 +0000 (08:31 +0000)]
GPGPU: Do not run mostly sequential kernels in GPU
In case sequential kernels are found deeper in the loop tree than any parallel
kernel, the overall scop is probably mostly sequential. Hence, run it on the
CPU.
llvm-svn: 281849
Tobias Grosser [Sun, 18 Sep 2016 06:50:35 +0000 (06:50 +0000)]
GPGPU: Dynamically ensure 'sufficient compute'
Offloading to a GPU is only beneficial if there is a sufficient amount of
compute that can be accelerated. Many kernels just have a very small number
of dynamic compute, which means GPU acceleration is not beneficial. We
compute at run-time an approximation of how many dynamic instructions will be
executed and fall back to CPU code in case this number is not sufficiently
large. To keep the run-time checking code simple, we over-approximate the
number of instructions executed in each statement by computing the volume of
the rectangular hull of its iteration space.
llvm-svn: 281848
Tobias Grosser [Sun, 18 Sep 2016 06:50:28 +0000 (06:50 +0000)]
GPGPU: Make test cases independent of register numbering [NFC]
llvm-svn: 281847
Wei Mi [Sun, 18 Sep 2016 06:10:32 +0000 (06:10 +0000)]
Change the order of the splitted store from high - low to low - high.
It is a trivial change which could make the testcase easier to be reused
for the store splitting in CodeGenPrepare.
llvm-svn: 281846
Kostya Serebryany [Sun, 18 Sep 2016 04:52:23 +0000 (04:52 +0000)]
[libFuzzer] use 'if guard' instead of 'if guard >= 0' with trace-pc; change the guard type to intptr_t; use separate array for 8-bit counters
llvm-svn: 281845
Davide Italiano [Sun, 18 Sep 2016 04:39:15 +0000 (04:39 +0000)]
[llvm-objump] Simplify the code. NFCI.
llvm-svn: 281844
Davide Italiano [Sat, 17 Sep 2016 22:32:42 +0000 (22:32 +0000)]
[lib/LTO] Try harder to reduce code duplication. NFCI.
llvm-svn: 281843
Simon Pilgrim [Sat, 17 Sep 2016 22:02:23 +0000 (22:02 +0000)]
[X86][SSE] Added vector udiv combine tests
llvm-svn: 281842
Simon Pilgrim [Sat, 17 Sep 2016 21:31:34 +0000 (21:31 +0000)]
[X86][SSE] Added vector fcopysign combine tests
Also demonstrating the poor lowering of fcopysign...
llvm-svn: 281841
Teresa Johnson [Sat, 17 Sep 2016 20:40:16 +0000 (20:40 +0000)]
[ThinLTO] Ensure anonymous globals renamed even at -O0
Summary:
This fixes an issue when files are compiled with -flto=thin
at default -O0. We need to rename anonymous globals before attempting
to write the module summary because all values need names for
the summary. This was happening at -O1 and above, but not before
the early exit when constructing the pipeline for -O0.
Also add an internal -prepare-for-thinlto option to enable this
to be tested via opt.
Fixes PR30419.
Reviewers: mehdi_amini
Subscribers: probinson, llvm-commits, mehdi_amini
Differential Revision: https://reviews.llvm.org/D24701
llvm-svn: 281840
Simon Pilgrim [Sat, 17 Sep 2016 20:06:16 +0000 (20:06 +0000)]
[X86][SSE] Added vector mul combine tests
llvm-svn: 281839