Peter Collingbourne [Thu, 4 May 2017 18:03:25 +0000 (18:03 +0000)]
Re-apply r302108, "IR: Use pointers instead of GUIDs to represent edges in the module summary. NFCI."
with a fix for the clang backend.
llvm-svn: 302176
Michael Zolotukhin [Thu, 4 May 2017 17:42:34 +0000 (17:42 +0000)]
Fix a typo.
llvm-svn: 302175
Sanjay Patel [Thu, 4 May 2017 17:36:53 +0000 (17:36 +0000)]
[InstSimplify] add tests for or-of-casted-icmps; NFC
llvm-svn: 302174
Davide Italiano [Thu, 4 May 2017 17:26:15 +0000 (17:26 +0000)]
[NewGVN] Remove unneeded newline and format assertions. NFCI.
llvm-svn: 302173
Mehdi Amini [Thu, 4 May 2017 17:08:54 +0000 (17:08 +0000)]
Add markup for libc++ dylib availability
Libc++ is used as a system library on macOS and iOS (amongst others). In order
for users to be able to compile a binary that is intended to be deployed to an
older version of the platform, clang provides the
availability attribute <https://clang.llvm.org/docs/AttributeReference.html#availability>_
that can be placed on declarations to describe the lifecycle of a symbol in the
library.
See docs/DesignDocs/AvailabilityMarkup.rst for more information.
Differential Revision: https://reviews.llvm.org/D31739
llvm-svn: 302172
Craig Topper [Thu, 4 May 2017 17:00:41 +0000 (17:00 +0000)]
[APInt] Reduce number of allocations involved in multiplying. Reduce worst case multiply size
Currently multiply is implemented in operator*=. Operator* makes a copy and uses operator*= to modify the copy.
Operator*= itself allocates a temporary buffer to hold the multiply result as it computes it. Then copies it to the buffer in *this.
Operator*= attempts to bound the size of the result based on the number of active bits in its inputs. It also has a couple special cases to handle 0 inputs without any memory allocations or multiply operations. The best case is that it calculates a single word regardless of input bit width. The worst case is that it calculates the a 2x input width result and drop the upper bits.
Since operator* uses operator*= it incurs two allocations, one for a copy of *this and one for the temporary allocation. Neither of these allocations are kept after the method operation is done.
The main usage in the backend appears to be ConstantRange::multiply which uses operator* rather than operator*=.
This patch moves the multiply operation to operator* and implements operator*= using it. This avoids the copy in operator*. operator* now allocates a result buffer sized the same width as its inputs no matter what. This buffer will be used as the buffer for the returned APInt. Finally, we reuse tcMultiply to implement the multiply operation. This function is capable of not calculating additional upper words that will be discarded.
This change does lose the special optimizations for the inputs using less words than their size implies. But it also removed the getActiveBits calls from all multiplies. If we think those optimizations are important we could look at providing additional bounds to tcMultiply to limit the computations.
Differential Revision: https://reviews.llvm.org/D32830
llvm-svn: 302171
Easwaran Raman [Thu, 4 May 2017 16:58:45 +0000 (16:58 +0000)]
[PM] Add ProfileSummaryAnalysis as a required pass in the new pipeline.
Differential revision: https://reviews.llvm.org/D32768
llvm-svn: 302170
Brian Gesiak [Thu, 4 May 2017 16:50:37 +0000 (16:50 +0000)]
[Lexicon] Add BDCE
Summary: Add an entry to the Lexicon for "BDCE."
Reviewers: jmolloy, hfinkel
Reviewed By: jmolloy
Differential Revision: https://reviews.llvm.org/D31861
llvm-svn: 302169
Marshall Clow [Thu, 4 May 2017 16:36:39 +0000 (16:36 +0000)]
Use lgamma_r instead of lgamma in binomial_distribution, because freakin' POSIX took a perfectly fine call and made it not thread safe.
llvm-svn: 302168
Adrian Prantl [Thu, 4 May 2017 16:26:07 +0000 (16:26 +0000)]
Add accidentally deleted testcase back.
llvm-svn: 302167
Adrian Prantl [Thu, 4 May 2017 16:24:31 +0000 (16:24 +0000)]
Cleanup tests to not share a DISubprogram between multiple Functions.
rdar://problem/
31926379
llvm-svn: 302166
Renato Golin [Thu, 4 May 2017 16:21:30 +0000 (16:21 +0000)]
[test-release] Status update *before* long gzip
llvm-svn: 302165
Alexander Kornienko [Thu, 4 May 2017 16:06:08 +0000 (16:06 +0000)]
[clang-tidy] fix readability-implicit-bool-cast false positive with xor
llvm-svn: 302164
Michael Kruse [Thu, 4 May 2017 15:55:54 +0000 (15:55 +0000)]
[ScopBuilder] Add missing semicolon after LLVM_FALLTHROUGH.
It was forgotten in r302157.
llvm-svn: 302163
Casey Carter [Thu, 4 May 2017 15:54:09 +0000 (15:54 +0000)]
[test] Name the local variable in the C1XX implementation of DoNotOptmize
Differential Revision: https://reviews.llvm.org/D32510
llvm-svn: 302162
Alexander Kornienko [Thu, 4 May 2017 15:34:31 +0000 (15:34 +0000)]
[clang-tidy] fix readability-implicit-bool-cast false alarm on |=, &=
llvm-svn: 302161
Alexander Kornienko [Thu, 4 May 2017 15:34:23 +0000 (15:34 +0000)]
[clang-tidy] Code cleanup, (almost) NFC (*).
(*) Printed types of member pointers don't use elaborated type specifiers
(`int struct S::*` -> `int S::*`).
llvm-svn: 302160
Alexander Kornienko [Thu, 4 May 2017 15:34:06 +0000 (15:34 +0000)]
[Tooling] add a createReplacement overload for StringRef
llvm-svn: 302159
Casey Carter [Thu, 4 May 2017 15:32:54 +0000 (15:32 +0000)]
[test] variant: enable constexpr construction tests on MSVC STL
* Add a new macro _MSVC_STL_VER to detect when the MSVC STL is being tested
* Workaround C1XX __is_trivially_copyable bug
llvm-svn: 302158
Michael Kruse [Thu, 4 May 2017 15:22:57 +0000 (15:22 +0000)]
Introduce VirtualUse. NFC.
If a ScopStmt references a (scalar) value, there are multiple
possibilities where this value can come. The decision about what kind of
use it is must be handled consistently at different places, which can be
error-prone. VirtualUse is meant to centralize the handling of the
different types of value uses.
This patch makes ScopBuilder and CodeGeneration use VirtualUse. This
already helps to show inconsistencies with the value handling. In order
to keep this patch NFC, exceptions to the general rules are added.
These might be fixed later if they turn to problems. Overall, this
should result in fewer post-codegen IR-verification errors, but instead
assertion failures in `getNewValue` that are closer to the actual error.
Differential Revision: https://reviews.llvm.org/D32667
llvm-svn: 302157
Martin Probst [Thu, 4 May 2017 15:04:04 +0000 (15:04 +0000)]
clang-format: [JS] exponentiation operator
Summary: While its precedence should be higher than multiplicative, LLVM does not have a level for that, so for the time being just treat it as multiplicative.
Reviewers: djasper
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D32864
llvm-svn: 302156
Rafael Espindola [Thu, 4 May 2017 14:54:48 +0000 (14:54 +0000)]
Reduce code duplication. NFC.
llvm-svn: 302155
Daniel Sanders [Thu, 4 May 2017 14:24:50 +0000 (14:24 +0000)]
[globalisel][tablegen] Add several GINodeEquiv's for operators that do not require additional support.
Summary:
As of this patch, 350 out of 3938 rules are currently imported.
Depends on D32229
Reviewers: qcolombet, kristof.beyls, rovka, t.p.northover, ab, aditya_nandakumar
Reviewed By: ab
Subscribers: dberris, llvm-commits, igorb
Differential Revision: https://reviews.llvm.org/D32275
llvm-svn: 302154
Chad Rosier [Thu, 4 May 2017 14:14:44 +0000 (14:14 +0000)]
[DAGCombine] Transform (fadd A, (fmul B, -2.0)) -> (fsub A, (fadd B, B)).
Differential Revision: http://reviews.llvm.org/D32596
llvm-svn: 302153
Peter Wu [Thu, 4 May 2017 14:03:57 +0000 (14:03 +0000)]
[ASAN] Add interceptor for __longjmp_chk
Summary:
glibc on Linux calls __longjmp_chk instead of longjmp (or _longjmp) when
_FORTIFY_SOURCE is defined. Ensure that an ASAN-instrumented program
intercepts this function when a system library calls it, otherwise the
stack might remain poisoned and result in CHECK failures and false
positives.
Fixes https://github.com/google/sanitizers/issues/721
Reviewed By: eugenis
Differential Revision: https://reviews.llvm.org/D32408
llvm-svn: 302152
Alex Lorenz [Thu, 4 May 2017 13:56:51 +0000 (13:56 +0000)]
DiagnosticsEngine should clear DelayedDiagID before reporting the
delayed diagnostic
This fix avoids an infinite recursion that was uncovered in one of our internal
tests by r301992. The testcase is the most reduced version of that
auto-generated test.
This is an improved version of the reverted commit r302037. The previous fix
actually managed to expose another subtle bug whereby `fatal_too_many_errors`
error was reported twice, with the second report setting the
`FatalErrorOccurred` flag. That prevented the notes that followed the diagnostic
the caused `fatal_too_many_errors` to be emitted. This commit ensures that notes
that follow `fatal_too_many_errors` but that belong to the diagnostic that
caused `fatal_too_many_errors` won't be emitted by setting the
`FatalErrorOccurred` when emitting `fatal_too_many_errors`.
rdar://
31962618
llvm-svn: 302151
Simon Pilgrim [Thu, 4 May 2017 13:42:57 +0000 (13:42 +0000)]
[X86][AVX512] Fix VPABSD file checks
Fix capitalization and string matching
llvm-svn: 302150
Simon Pilgrim [Thu, 4 May 2017 13:35:40 +0000 (13:35 +0000)]
[X86][SSE] Add i686 triple tests for partial vector and re-association
llvm-svn: 302149
Krzysztof Parzyszek [Thu, 4 May 2017 13:35:17 +0000 (13:35 +0000)]
Refactoring with range-based for, NFC
Patch by Wei-Ren Chen.
Differential Revision: https://reviews.llvm.org/D32682
llvm-svn: 302148
Simon Dardis [Thu, 4 May 2017 13:34:17 +0000 (13:34 +0000)]
[compiler-rt][mips] Add support for quad precision builtins for mips64
Match the builtins that GCC provides for IEEE754 quad precision
on MIPS64. Also, enable building them with clang as PR20098 is resolved.
Disable tests for xf and xc modes as MIPS doesn't support that mode in
hardware or software.
Reviewers: slthakur
Differential Revision: https://reviews.llvm.org/D32794
llvm-svn: 302147
Jonas Paulsson [Thu, 4 May 2017 13:33:30 +0000 (13:33 +0000)]
[SystemZ] Make copyPhysReg() add impl-use operands of super reg.
When a 128 bit COPY is lowered into two instructions, an impl-use operand of
the super-reg should be added to each new instruction in case one of the
sub-regs is undefined.
Review: Ulrich Weigand
llvm-svn: 302146
Simon Pilgrim [Thu, 4 May 2017 13:08:09 +0000 (13:08 +0000)]
[X86][SSE] Add i686 triple tests for PBLENDW commutation
llvm-svn: 302145
Simon Pilgrim [Thu, 4 May 2017 13:00:30 +0000 (13:00 +0000)]
[X86][AVX1] Regenerate checks and add i686 triple tests for folded logical ops
llvm-svn: 302144
Sylvestre Ledru [Thu, 4 May 2017 12:46:38 +0000 (12:46 +0000)]
Add support of the next Ubuntu (Ubuntu 17.10 - Artful Aardvark)
llvm-svn: 302143
Michael Kruse [Thu, 4 May 2017 12:21:25 +0000 (12:21 +0000)]
[CMake] Remove POLLY_TEST_DIRECTORIES.
The test subdirectory POLLY_TEST_DIRECTORIES was heavily outdated and
only used in out-of-LLVM-tree builds
(to generate polly-test-${subdir} targets).
llvm-svn: 302142
Eric Liu [Thu, 4 May 2017 12:05:40 +0000 (12:05 +0000)]
Revert "IR: Use pointers instead of GUIDs to represent edges in the module summary. NFCI."
This reverts commit r302108.
llvm-svn: 302141
Eric Liu [Thu, 4 May 2017 11:49:39 +0000 (11:49 +0000)]
Revert "IR: Use pointers instead of GUIDs to represent edges in the module summary. NFCI."
This reverts commit r302108. This causes crash in clang bootstrap with LTO.
Contacted the auther in the original commit.
llvm-svn: 302140
Nitesh Jain [Thu, 4 May 2017 11:34:42 +0000 (11:34 +0000)]
[LLDB][MIPS] Fix TestStepOverBreakpoint.py failure.
Reviewers: jingham, labath
Subscribers: jaydeep, bhushan, lldb-commits, slthakur
Differential Revision: https://reviews.llvm.org/D32168
llvm-svn: 302139
Simon Dardis [Thu, 4 May 2017 11:03:50 +0000 (11:03 +0000)]
[mips][XRay] Use the base version of emitXRayTable
Follow up rL290858 by removing the MIPS specific version of XRayTable
emission in favour of the basic version.
This resolves a buildbot failure where the ELF sections were malformed
causing the linker to reject the object files with xray related sections.
Reviewers: dberris, slthakur
Differential Revision: https://reviews.llvm.org/D32808
llvm-svn: 302138
Martin Storsjo [Thu, 4 May 2017 10:54:35 +0000 (10:54 +0000)]
[ArgPromotion] Fix a truncated variable
This fixes a regression since SVN rev 273808 (which was supposed to
not change functionality).
The regression caused miscompilations (noted in the wild when targeting
AArch64) on platforms with 32 bit long.
Differential Revision: https://reviews.llvm.org/D32850
llvm-svn: 302137
Alex Lorenz [Thu, 4 May 2017 10:42:06 +0000 (10:42 +0000)]
[Index] The relation between the declarations in template
specializations that 'override' declarations in the base template should use
the 'specializationOf' relation instead of 'specializationOf | overrideOf'.
The indexer relations are meant to be orthogonal, so 'specializationOf' is
better than the combined relation.
llvm-svn: 302136
Michael Zuckerman [Thu, 4 May 2017 10:37:00 +0000 (10:37 +0000)]
[LLVM][inline-asm][Altmacor] Altmacro string delimiter '<..>'
In this patch, I introduce a new altmacro string delimiter.
This review is the second review in a series of four reviews.
(one for each altmacro feature: LOCAL, string delimiter, string '!' escape sign and absolute expression as a string '%' ).
In the alternate macro mode, you can delimit strings with matching angle brackets <..>
when using it as a part of calling macro arguments.
As described in the https://sourceware.org/binutils/docs-2.27/as/Altmacro.html
"<string>
You can delimit strings with matching angle brackets."
assumptions:
1. If an argument begins with '<' and ends with '>'. The argument is considered as a string.
2. Except adding new string mark '<..>', a regular macro behavior is expected.
3. The altmacro cannot affect the regular less/greater behavior.
4. If a comma is present inside an angle brackets it considered as a character and not as a separator.
Differential Revision: https://reviews.llvm.org/D32701
llvm-svn: 302135
Tobias Grosser [Thu, 4 May 2017 10:16:20 +0000 (10:16 +0000)]
[ScopDetection] Check for already known required-invariant loads [NFC]
For certain test cases we spent over 50% of the scop detection time in
checking if a load is likely invariant. We can avoid most of these checks by
testing early on if a load is expected to be invariant. Doing this reduces
scop-detection time on a large benchmark from 52 seconds to just 25 seconds.
No functional change is expected.
llvm-svn: 302134
Pavel Labath [Thu, 4 May 2017 10:11:33 +0000 (10:11 +0000)]
MainLoop: Add unit tests
Summary:
This adds a couple of unit tests to the MainLoop class. To get the
kqueue based version of the signal handling passing, I needed to
modify the implementation a bit to make the queue object persistent.
Otherwise, only the signals which are send during the Run call would get
processed, which did not match the ppoll behaviour.
I also took the opportunity to remove the ForEach template functions and
replace them with something more reasonable.
Reviewers: beanz, eugene
Subscribers: lldb-commits, mgorny
Differential Revision: https://reviews.llvm.org/D32753
llvm-svn: 302133
Tobias Grosser [Thu, 4 May 2017 08:56:54 +0000 (08:56 +0000)]
Adjust test case to not trigger the SCEV optimization committed in r302096
This makes sure we still test the case that a PHI-NODE cannot be analyzed by
scalar evolution and consequently must be code generated explicitly. As
Michael's optimization triggers only on a very specific "add %iv, %step"
pattern, just changing 'add' to 'mul' adds back test coverage.
llvm-svn: 302132
Sam Parker [Thu, 4 May 2017 08:37:59 +0000 (08:37 +0000)]
[ARM] ACLE Chapter 9 intrinsics
Implemented the remaining integer data processing intrinsics from
the ARM ACLE v2.1 spec, such as parallel arithemtic and DSP style
multiplications.
Differential Revision: https://reviews.llvm.org/D32282
llvm-svn: 302131
Eric Fiselier [Thu, 4 May 2017 08:32:33 +0000 (08:32 +0000)]
Dummy commit to trigger CMake reconfiguration and unbreak Sphinx build
llvm-svn: 302130
Eric Fiselier [Thu, 4 May 2017 07:45:09 +0000 (07:45 +0000)]
Fix incorrect usage of __libcpp_mutex_trylock. Patch from Andrey Khalyavin
llvm-svn: 302129
Eric Fiselier [Thu, 4 May 2017 07:40:23 +0000 (07:40 +0000)]
Update Appveyor bot link to point to new llvm-mirror Appveyor account
llvm-svn: 302128
Igor Breger [Thu, 4 May 2017 07:34:58 +0000 (07:34 +0000)]
[X86][AVX-512] Allow EVEX encoded instruction selection when available for mul v8i32.
Differential Revision: https://reviews.llvm.org/D32679
llvm-svn: 302127
Sam Parker [Thu, 4 May 2017 07:31:28 +0000 (07:31 +0000)]
[ARM] ACLE Chapter 9 intrinsics
Added the integer data processing intrinsics from ACLE v2.1 Chapter 9
but I have missed out the saturation_occurred intrinsics for now. For
the instructions that read and write the GE bits, a chain is included
and the only instruction that reads these flags (sel) is only
selectable via the implemented intrinsic.
Differential Revision: https://reviews.llvm.org/D32281
llvm-svn: 302126
Xiuli Pan [Thu, 4 May 2017 07:31:20 +0000 (07:31 +0000)]
[OpenCL] Add intel_reqd_sub_group_size attribute support
Summary:
Add intel_reqd_sub_group_size attribute support as intel extension cl_intel_required_subgroup_size from
https://www.khronos.org/registry/OpenCL/extensions/intel/cl_intel_required_subgroup_size.txt
Reviewers: Anastasia, bader, hfinkel, pxli168
Reviewed By: Anastasia, bader, pxli168
Subscribers: cfe-commits, yaxunl
Differential Revision: https://reviews.llvm.org/D30805
llvm-svn: 302125
Oren Ben Simhon [Thu, 4 May 2017 07:22:49 +0000 (07:22 +0000)]
[X86] Disabling PLT in Regcall CC Functions
According to psABI, PLT stub clobbers XMM8-XMM15.
In Regcall calling convention those registers are used for passing parameters.
Thus we need to prevent lazy binding in Regcall.
Differential Revision: https://reviews.llvm.org/D32430
llvm-svn: 302124
Igor Breger [Thu, 4 May 2017 06:53:31 +0000 (06:53 +0000)]
[AVX-512VL] Autogenerate checks. Add --show-mc-encoding to check instruction predicate.
llvm-svn: 302123
Eric Fiselier [Thu, 4 May 2017 06:28:34 +0000 (06:28 +0000)]
test commit
llvm-svn: 302122
Dean Michael Berris [Thu, 4 May 2017 06:27:51 +0000 (06:27 +0000)]
[XRay][compiler-rt][NFC] Update comments to doxygen format; group functions better.
llvm-svn: 302121
Eric Fiselier [Thu, 4 May 2017 06:27:06 +0000 (06:27 +0000)]
test commit
llvm-svn: 302120
Igor Breger [Thu, 4 May 2017 06:24:52 +0000 (06:24 +0000)]
[AVX] Fix vpcmpeqq predicate.
Summary:
Fix vpcmpeqq predicate. AVX512 version of vpcmpeqq is not equivalent to AVX one.
Split from https://reviews.llvm.org/D32679
Reviewers: craig.topper, zvi, aymanmus
Reviewed By: craig.topper
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32786
llvm-svn: 302119
Jonas Hahnfeld [Thu, 4 May 2017 06:04:49 +0000 (06:04 +0000)]
[libcxxabi][CMake] Set library dir when built under runtimes/
This will put libraries into the build root's lib/ directory by default.
Differential Revision: https://reviews.llvm.org/D32735
llvm-svn: 302118
Jonas Hahnfeld [Thu, 4 May 2017 06:02:50 +0000 (06:02 +0000)]
[libcxx][CMake] Set library dir when built under runtimes/
This will put libraries into the build root's lib/ directory by default.
Differential Revision: https://reviews.llvm.org/D32736
llvm-svn: 302117
Eric Fiselier [Thu, 4 May 2017 05:58:59 +0000 (05:58 +0000)]
update buildbot doc to link to the new Appveyor builders
llvm-svn: 302116
Eric Fiselier [Thu, 4 May 2017 05:32:54 +0000 (05:32 +0000)]
Attempt to enable the LIT progress bar on Appveyor
llvm-svn: 302115
Jonas Paulsson [Thu, 4 May 2017 05:31:56 +0000 (05:31 +0000)]
Use right function in LoopVectorize.
- unsigned AS = getMemInstAlignment(I);
+ unsigned AS = getMemInstAddressSpace(I);
Review: Hal Finkel
llvm-svn: 302114
Eric Fiselier [Thu, 4 May 2017 05:16:48 +0000 (05:16 +0000)]
Setup Appveyor bot for MSVC 2017 and MSVC 2015
llvm-svn: 302113
Dean Michael Berris [Thu, 4 May 2017 04:59:20 +0000 (04:59 +0000)]
[XRay][compiler-rt] Support patching/unpatching specific functions
Summary:
This change allows us to patch/unpatch specific functions using the
function ID. This is useful in cases where implementations might want to
do coverage-style, or more fine-grained control of which functions to
patch or un-patch at runtime.
Depends on D32693.
Reviewers: dblaikie, echristo, kpw
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32695
llvm-svn: 302112
Dean Michael Berris [Thu, 4 May 2017 04:55:46 +0000 (04:55 +0000)]
[XRay] Use wordsize-dependent alignment for index
This makes it simpler for the runtime to consistently handle the entries
in the function sled index in both 32 and 64 bit platforms where the
XRay runtime works.
Follow-up on D32693.
llvm-svn: 302111
Craig Topper [Thu, 4 May 2017 04:33:27 +0000 (04:33 +0000)]
[SelectionDAG] Improve known bits support for CTPOP.
This is based on the same concept from ValueTracking's version of computeKnownBits.
llvm-svn: 302110
Dean Michael Berris [Thu, 4 May 2017 03:37:57 +0000 (03:37 +0000)]
[XRay] Create an Index of sleds per function
Summary:
This change adds a new section to the xray-instrumented binary that
stores an index into ranges of the instrumentation map, where sleds
associated with the same function can be accessed as an array. At
runtime, we can get access to this index by function ID offset allowing
for selective patching and unpatching by function ID.
Each entry in this new section (xray_fn_idx) will include two pointers
indicating the start and one past the end of the sleds associated with
the same function. These entries will be 16 bytes long on x86 and
aarch64. On arm, we align to 16 bytes anyway so the runtime has to take
that into consideration.
__{start,stop}_xray_fn_idx will be the symbols that the runtime will
look for when we implement the selective patching/unpatching by function
id APIs. Because XRay synthesizes the function id's in a monotonically
increasing manner at runtime now, implementations (and users) can use
this table to look up the sleds associated with a specific function.
This is useful in implementations that want to do things like:
- Implement coverage mode for functions by patching everything
pre-main, then as functions are encountered, the installed handler
can unpatch the function that's been encountered after recording
that it's been called.
- Do "learning mode", so that the implementation can figure out some
statistical information about function calls by function id for a
time being, and then determine which functions are worth
uninstrumenting at runtime.
- Do "selective instrumentation" where an implementation can
specifically instrument only certain function id's at runtime
(either based on some external data, or through some other
heuristics) instead of patching all the instrumented functions at
runtime.
Reviewers: dblaikie, echristo, chandlerc, javed.absar
Subscribers: pelikan, aemerson, kpw, llvm-commits, rengolin
Differential Revision: https://reviews.llvm.org/D32693
llvm-svn: 302109
Peter Collingbourne [Thu, 4 May 2017 03:36:16 +0000 (03:36 +0000)]
IR: Use pointers instead of GUIDs to represent edges in the module summary. NFCI.
When profiling a no-op incremental link of Chromium I found that the functions
computeImportForFunction and computeDeadSymbols were consuming roughly 10% of
the profile. The goal of this change is to improve the performance of those
functions by changing the map lookups that they were previously doing into
pointer dereferences.
This is achieved by changing the ValueInfo data structure to be a pointer to
an element of the global value map owned by ModuleSummaryIndex, and changing
reference lists in the GlobalValueSummary to hold ValueInfos instead of GUIDs.
This means that a ValueInfo will take a client directly to the summary list
for a given GUID.
Differential Revision: https://reviews.llvm.org/D32471
llvm-svn: 302108
Rafael Espindola [Thu, 4 May 2017 03:00:27 +0000 (03:00 +0000)]
Fix accounting of tbss.
We were correctly computing the size contribution of a .tbss input
section (it is none), but we were incorrectly considering the
alignment of the output section: it was advancing Dot instead of
ThreadBssOffset.
As far as I can tell this was always wrong in our linkerscript
implementation, but that became more visible now that the code is
shared with the non linker script case.
llvm-svn: 302107
NAKAMURA Takumi [Thu, 4 May 2017 02:01:18 +0000 (02:01 +0000)]
llvm/IR/Function.h: Prune an obsolete @param in r302060. [-Wdocumentation]
llvm-svn: 302106
Stephan T. Lavavej [Thu, 4 May 2017 01:43:58 +0000 (01:43 +0000)]
[libcxx] [test] Strip trailing whitespace. NFC.
llvm-svn: 302105
Stephan T. Lavavej [Thu, 4 May 2017 01:35:11 +0000 (01:35 +0000)]
[libcxx] [test] In msvc_stdlib_force_include.hpp, use _HAS_CXX17 to set TEST_STD_VER.
_HAS_CXX17 indicates whether MSVC's STL is in C++17 mode.
In MSVC there's a distinction between CRT headers like stdlib.h and STL headers
like cstdlib. Only the STL headers drag in yvals.h, our internal STL-wide header
that defines internal macros like _HAS_CXX17.
_HAS_CXX17 is an MSVC STL library macro, unconditionally defined. We centralize
everything on this, because we have to ask different questions to determine
whether C1XX, EDG, or Clang is in 14 or 17 mode, and we additionally permit
users to override the detection in one way (it's okay to ask for 17 from the
compiler, but only 14 from the libs, at least for the moment; only noexcept
in the type system will give us a headache).
As this header is for testing MSVC's STL, we can assume _HAS_CXX17 is defined.
Fixes D32726.
llvm-svn: 302104
Dean Michael Berris [Thu, 4 May 2017 01:24:26 +0000 (01:24 +0000)]
[XRay] Detect loops in functions being lowered
Summary:
This is an implementation of the loop detection logic that XRay needs to
determine whether a function might take time at runtime. Without this
heuristic, XRay will tend to not instrument short functions that have
loops that might have runtime dependent on inputs or external values.
While this implementation doesn't do any further analysis than just
figuring out whether there is a loop in the MachineFunction being
code-gen'ed, we're paving the way for being able to perform more
sophisticated analysis of the function in the future (for example to
determine whether the trip count for the loop might be constant, and
make a decision on that instead). This enables us to cover more
functions with the default heuristics, and potentially identify ones
that have variable runtime latency just by looking for the presence of
loops.
Reviewers: chandlerc, rnk, pelikan
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32274
llvm-svn: 302103
Eric Fiselier [Thu, 4 May 2017 01:17:22 +0000 (01:17 +0000)]
Attempt to escape paths correctly
llvm-svn: 302102
Eric Fiselier [Thu, 4 May 2017 01:17:21 +0000 (01:17 +0000)]
Attempt to setup MSVC 2017
llvm-svn: 302101
Eric Fiselier [Thu, 4 May 2017 01:06:56 +0000 (01:06 +0000)]
Use nullptr instead of the literal 0
llvm-svn: 302100
Eric Fiselier [Thu, 4 May 2017 01:06:54 +0000 (01:06 +0000)]
Fix macro redefinition warnings for _LIBCPP_NO_RTTI
llvm-svn: 302099
Richard Smith [Thu, 4 May 2017 00:29:54 +0000 (00:29 +0000)]
Add #pragma clang module begin/end pragmas and generate them when preprocessing a module.
These pragmas are intended to simulate the effect of entering or leaving a file
with an associated module. This is not completely implemented yet: declarations
between the pragmas will not be attributed to the correct module, but macro
visibility is already functional.
Modules named by #pragma clang module begin must already be known to clang (in
some module map that's either loaded or on the search path).
llvm-svn: 302098
Eric Fiselier [Thu, 4 May 2017 00:16:35 +0000 (00:16 +0000)]
Test commit for Appveyor - Remove incorrect caching logic
llvm-svn: 302097
Michael Zolotukhin [Wed, 3 May 2017 23:53:38 +0000 (23:53 +0000)]
[SCEV] createAddRecFromPHI: Optimize for the most common case.
Summary:
The existing implementation creates a symbolic SCEV expression every
time we analyze a phi node and then has to remove it, when the analysis
is finished. This is very expensive, and in most of the cases it's also
unnecessary. According to the data I collected, ~60-70% of analyzed phi
nodes (measured on SPEC) have the following form:
PN = phi(Start, OP(Self, Constant))
Handling such cases separately significantly speeds this up.
Reviewers: sanjoy, pete
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32663
llvm-svn: 302096
Duncan P. N. Exon Smith [Wed, 3 May 2017 23:33:54 +0000 (23:33 +0000)]
CMake: Only add test/ subdirectory when it exists
r296685 started adding the test/ subdirectory even when
LIBCXX_INCLUDE_TESTS=OFF. This is great for testing libcxx standalone,
but it also breaks the build when the test/ subdirectory is removed
(and our submission system strips all test/ directories).
This patch updates the logic to check for test/ before adding it.
rdar://problem/
31931366
llvm-svn: 302095
Matthias Braun [Wed, 3 May 2017 23:32:51 +0000 (23:32 +0000)]
strlen-1.ll: Fix test
Change test for `strlen(x) == 0 --> *x == 0` to actually test the
pattern.
llvm-svn: 302094
Craig Topper [Wed, 3 May 2017 23:22:46 +0000 (23:22 +0000)]
[InstCombine][KnownBits] Use KnownBits better to detect nsw adds
Change checkRippleForAdd from a heuristic to a full check -
if it is provable that the add does not overflow return true, otherwise false.
Patch by Yoav Ben-Shalom
Differential Revision: https://reviews.llvm.org/D32686
llvm-svn: 302093
Reid Kleckner [Wed, 3 May 2017 23:13:42 +0000 (23:13 +0000)]
Mark functions as not having CFI once we finalize an x86 stack frame
We'll set it back to true in emitPrologue if it gets called. It doesn't
get called for naked functions.
Fixes PR32912
llvm-svn: 302092
Craig Topper [Wed, 3 May 2017 23:12:29 +0000 (23:12 +0000)]
[KnownBits] Add methods for determining if KnownBits is a constant value
This patch adds isConstant and getConstant for determining if KnownBits represents a constant value and to retrieve the value. Use them to simplify code.
Differential Revision: https://reviews.llvm.org/D32785
llvm-svn: 302091
Rui Ueyama [Wed, 3 May 2017 23:10:33 +0000 (23:10 +0000)]
Remove a comment that is no longer true.
llvm-svn: 302090
Craig Topper [Wed, 3 May 2017 22:25:19 +0000 (22:25 +0000)]
[ValueTracking] Remove handling for BitWidth being 0 in ComputeSignBit and isKnownNonZero.
I don't believe its possible to have non-zero values here since DataLayout became required. The APInt constructor inside of the KnownBits object will assert if this ever happens.
llvm-svn: 302089
Craig Topper [Wed, 3 May 2017 22:07:25 +0000 (22:07 +0000)]
[KnownBits] Add zext, sext, and trunc methods to KnownBits
This patch adds zext, sext, and trunc methods to KnownBits and uses them where possible.
Differential Revision: https://reviews.llvm.org/D32784
llvm-svn: 302088
Sanjay Patel [Wed, 3 May 2017 21:55:34 +0000 (21:55 +0000)]
[TargetLowering] use isSubsetOf in SimplifyDemandedBits; NFCI
This is the DAG equivalent of https://reviews.llvm.org/D32255 ,
which will hopefully be committed again. The functionality
(preferring a 'not' op) is already here in the DAG, so this is
just intended to be a clean-up and performance improvement.
llvm-svn: 302087
Paul Robinson [Wed, 3 May 2017 21:53:21 +0000 (21:53 +0000)]
clang-format and restyle DWARFFormValue before working on it. NFC
llvm-svn: 302086
Saleem Abdulrasool [Wed, 3 May 2017 21:39:01 +0000 (21:39 +0000)]
DebugInfo: elide type index entries for synthetic types
Compiler emitted synthetic types may not have an associated DIFile
(translation unit). In such a case, when generating CodeView debug type
information, we would attempt to compute an absolute filepath which
would result in a segfault due to a NULL DIFile*. If there is no source
file associated with the type, elide the type index entry for the type
and record the type information. This actually results in higher
fidelity debug information than clang/C2 as of this writing.
Resolves PR32668!
llvm-svn: 302085
Eric Fiselier [Wed, 3 May 2017 21:14:26 +0000 (21:14 +0000)]
Attempt to fix appveyor build
llvm-svn: 302084
Rui Ueyama [Wed, 3 May 2017 21:03:08 +0000 (21:03 +0000)]
Accept archive files with no symbol table instad of warning on them.
It seems virtually everyone who tries to do LTO build with Clang and
LLD was hit by a mistake to forget using llvm-ar command to create
archive files. I wasn't an exception. Since this is an annoying common
issue, it is probably better to handle that gracefully rather than
reporting an error and tell the user to redo build with different
configuration.
Differential Revision: https://reviews.llvm.org/D32721
llvm-svn: 302083
Eric Fiselier [Wed, 3 May 2017 21:02:19 +0000 (21:02 +0000)]
Qualify calls to __invoke, __apply_fuctor, and __mu
llvm-svn: 302082
Ahmed Bougacha [Wed, 3 May 2017 20:51:34 +0000 (20:51 +0000)]
[AArch64] Fix variable name ambiguity in r302078.
ArchKind is passed to the function, but it's also a type.
llvm-svn: 302081
Xin Tong [Wed, 3 May 2017 20:37:07 +0000 (20:37 +0000)]
[TailCallElim] Remove an unused argument. NFCI
llvm-svn: 302080
Ahmed Bougacha [Wed, 3 May 2017 20:34:32 +0000 (20:34 +0000)]
[Driver] Update AArch64 testcase to match llvm r302078.
llvm-svn: 302079
Ahmed Bougacha [Wed, 3 May 2017 20:33:58 +0000 (20:33 +0000)]
[AArch64] Make the TargetParser add CPU exts provided by the arch.
Otherwise, each CPU has to manually specify the extensions it supports,
even though they have to be a superset of the base arch extensions.
And when there's redundant data there's stale data, so most of the CPUs
lie about the features they support (almost none lists AEK_FP).
Instead, do the saner thing: add the optional extensions on top of the
base extensions provided by the architecture.
The ARM TargetParser has the same behavior.
Differential Revision: https://reviews.llvm.org/D32780
llvm-svn: 302078
Ahmed Bougacha [Wed, 3 May 2017 20:33:52 +0000 (20:33 +0000)]
[AArch64] armv8-A doesn't have CRC.
That's only a required extension as of v8.1a.
Remove it from the "generic" CPU as well: it should only support the
base ISA (and binutils agrees).
Also unify the MC tests into crc.s and arm64-crc32.s
llvm-svn: 302077