Quentin Colombet [Sat, 14 Oct 2017 00:43:48 +0000 (00:43 +0000)]
[AArch64][RegisterBankInfo] Use the statically computed mappings for COPY
We use to resort on the generic implementation to get the mappings for
COPYs. The generic implementation resorts on table lookup and
dynamically allocated objects to get the valid mappings.
Given we already know how to map G_BITCAST and have the static mappings
for them, use that code path for COPY as well. This is much more
efficient.
Improve the compile time of RegBankSelect by up to 20%.
Note: When we eventually generate all the mappings via TableGen, we
wouldn't have to do that dance to shave compile time. The intent of this
change was to make sure that moving to static structure really pays off.
NFC.
llvm-svn: 315781
Daniel Sanders [Sat, 14 Oct 2017 00:31:58 +0000 (00:31 +0000)]
[globalisel][tablegen] Simplify named operand/operator lookups and fix a wrong-code bug this revealed.
Summary:
Operand variable lookups are now performed by the RuleMatcher rather than
searching the whole matcher hierarchy for a match. This revealed a wrong-code
bug that currently affects ARM and X86 where patterns that use a variable more
than once in the match pattern will be imported but won't check that the
operands are identical. This can cause the tablegen-erated matcher to
accept matches that should be rejected.
Depends on D36569
Reviewers: ab, t.p.northover, qcolombet, rovka, aditya_nandakumar
Subscribers: aemerson, igorb, llvm-commits, kristof.beyls
Differential Revision: https://reviews.llvm.org/D36618
llvm-svn: 315780
Jordan Rose [Sat, 14 Oct 2017 00:26:48 +0000 (00:26 +0000)]
lit.py: Fix new test harder for systems that don't use / as os.path.sep
I didn't think about '%{inputs}' having the same problem. This one
should be a fully Windows path name.
llvm-svn: 315779
Kostya Serebryany [Sat, 14 Oct 2017 00:07:11 +0000 (00:07 +0000)]
[libFuzzer] print a better warning if we hit the ld bug
llvm-svn: 315778
Evgeniy Stepanov [Fri, 13 Oct 2017 23:57:08 +0000 (23:57 +0000)]
[asan] Deflake one test by running it 3 times.
The test seems to trigger an android platform bug under load.
llvm-svn: 315777
George Karpenkov [Fri, 13 Oct 2017 23:50:53 +0000 (23:50 +0000)]
Allow building libFuzzer tests in two-stage compiler-rt build.
llvm-svn: 315776
Evgeniy Stepanov [Fri, 13 Oct 2017 23:33:12 +0000 (23:33 +0000)]
[cfi] Use %ld_flags_rpath_* substitutions in tests (NFC)
llvm-svn: 315775
Alex Lorenz [Fri, 13 Oct 2017 22:47:44 +0000 (22:47 +0000)]
Revert r315738
The ParsedSourceRange class does not work correctly on Windows with the ':'
drive separators
llvm-svn: 315774
Jordan Rose [Fri, 13 Oct 2017 22:46:40 +0000 (22:46 +0000)]
lit.py: Fix new test for systems that don't use / as os.path.sep
llvm-svn: 315773
Benjamin Kramer [Fri, 13 Oct 2017 22:14:34 +0000 (22:14 +0000)]
[Sema] Avoid iterator invalidation when code completing.
It's possible for the code completion consumer to add new decls to the
current scope while lookup happens on it. Avoid this by making a copy
first.
Sadly I wasn't able to get a self-contained test case for this as it
requires code completion + precompiled preamble + the stars aligning to
deserialize at exactly the right time.
llvm-svn: 315772
George Karpenkov [Fri, 13 Oct 2017 22:03:09 +0000 (22:03 +0000)]
Allow building libFuzzer in two-stage compiler-rt build
When LLVM_BUILD_EXTERNAL_COMPILER_RT option is set to true,
all of projects in compiler-rt are built with a freshly-built compiler using
a recursive CMake invocation.
(e.g. that's how compiler-rt is used in Swift)
Just now I have noticed that libFuzzer binaries were missing in such a case,
and ninja fuzzer returned "no such target", while ninja asan worked just fine.
To my surprise, the list of allowed targets was actually hardcoded in Clang!
While the current setup is clearly suboptimal, for the lack of a better fix
I'm just adding `fuzzer` to a list of `compiler-rt` targets.
Differential Revision: https://reviews.llvm.org/D38904
llvm-svn: 315771
Alex Shlyapnikov [Fri, 13 Oct 2017 21:57:43 +0000 (21:57 +0000)]
[Sanitizers] Always build libFuzzer with frame pointers.
Lacking frame pointers, sanitized fuzzers collect bogus stack
traces and the set of stack traces grows indefinitely, leading to OOMs.
llvm-svn: 315770
Krzysztof Parzyszek [Fri, 13 Oct 2017 21:57:11 +0000 (21:57 +0000)]
Revert r315763: "[Hexagon] Rangify some loops, NFC"
Broke some builds (using libstdc++).
llvm-svn: 315769
Craig Topper [Fri, 13 Oct 2017 21:56:48 +0000 (21:56 +0000)]
[X86] Use X86ISD::VBROADCAST in place of v2f64 X86ISD::MOVDDUP when AVX2 is available
This is particularly important for AVX512VL where we are better able to recognize the VBROADCAST loads to fold with other operations.
For AVX512VL we now use X86ISD::VBROADCAST for all of the patterns and remove the 128-bit X86ISD::VMOVDDUP.
We may be able to use this for AVX1 as well which would allow us to remove more isel patterns.
I also had to add X86ISD::VBROADCAST as a node to call combineShuffle for so that we treat it similar to X86ISD::MOVDDUP.
Differential Revision: https://reviews.llvm.org/D38836
llvm-svn: 315768
Craig Topper [Fri, 13 Oct 2017 21:56:45 +0000 (21:56 +0000)]
[X86] Use fsub in the movddup scheduling tests to prevent a future patch from folding movddup as a broadcast load.
llvm-svn: 315767
Rafael Espindola [Fri, 13 Oct 2017 21:52:33 +0000 (21:52 +0000)]
Give shared symbols priority over lazy ones.
This matches the behavior of gold and bfd. It also matches lld's own
behavior when the shared symbol is seen first
llvm-svn: 315766
Daniel Sanders [Fri, 13 Oct 2017 21:51:20 +0000 (21:51 +0000)]
[globalisel][tablegen] Fix a use-after free bug that manifests on non-macOS machines.
llvm-svn: 315765
Rafael Espindola [Fri, 13 Oct 2017 21:44:10 +0000 (21:44 +0000)]
Initialize CopyRelSec.
It could be used uninitialized since r310079.
llvm-svn: 315764
Krzysztof Parzyszek [Fri, 13 Oct 2017 21:43:00 +0000 (21:43 +0000)]
[Hexagon] Rangify some loops, NFC
llvm-svn: 315763
Sanjay Patel [Fri, 13 Oct 2017 21:28:50 +0000 (21:28 +0000)]
[InstCombine] use m_Neg() to reduce code; NFCI
llvm-svn: 315762
Daniel Sanders [Fri, 13 Oct 2017 21:28:03 +0000 (21:28 +0000)]
[globalisel][tablegen] Add support for fpimm and import of APInt/APFloat based ImmLeaf.
Summary:
There's only a tablegen testcase for IntImmLeaf and not a CodeGen one
because the relevant rules are rejected for other reasons at the moment.
On AArch64, it's because there's an SDNodeXForm attached to the operand.
On X86, it's because the rule either emits multiple instructions or has
another predicate using PatFrag which cannot easily be supported at the
same time.
Reviewers: ab, t.p.northover, qcolombet, rovka, aditya_nandakumar
Reviewed By: qcolombet
Subscribers: aemerson, javed.absar, igorb, llvm-commits, kristof.beyls
Differential Revision: https://reviews.llvm.org/D36569
llvm-svn: 315761
Eugene Zelenko [Fri, 13 Oct 2017 21:17:07 +0000 (21:17 +0000)]
[Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 315760
Quentin Colombet [Fri, 13 Oct 2017 21:16:15 +0000 (21:16 +0000)]
[RegisterBankInfo] Cache the getMinimalPhysRegClass information
TargetRegisterInfo::getMinimalPhysRegClass is actually pretty expensive
because it has to iterate over all the register classes.
Cache this information as we need and get it so that we limit its usage.
Right now, we heavily rely on it, because this is how we get the mapping
for vregs defined by copies from physreg (i.e., the one that are ABI
related).
Improve compile time by up to 10% for that pass.
NFC
llvm-svn: 315759
Quentin Colombet [Fri, 13 Oct 2017 21:16:14 +0000 (21:16 +0000)]
[Legalizer] Use SmallSetVector instead of SetVector.
NFC
llvm-svn: 315758
Quentin Colombet [Fri, 13 Oct 2017 21:16:13 +0000 (21:16 +0000)]
[LegalizerInfo] Don't evaluate end boundary every time through the loop
Match the LLVM coding standard for loop conditions.
NFC.
llvm-svn: 315757
Quentin Colombet [Fri, 13 Oct 2017 21:16:05 +0000 (21:16 +0000)]
[Legalizer] Only allocate the SetVectors once per function.
Prior to this patch we used to create SetVectors in temporaries that
were created and destroyed for each instruction. Now, instead we create
and destroyed them only once, but clear the content for each
instruction.
This speeds up the pass by ~25%.
NFC.
llvm-svn: 315756
Alex Lorenz [Fri, 13 Oct 2017 21:15:25 +0000 (21:15 +0000)]
Fix -Woverloaded-virtual warning in clang-refactor
llvm-svn: 315755
Matt Arsenault [Fri, 13 Oct 2017 21:10:22 +0000 (21:10 +0000)]
AMDGPU: Implement hasBitPreservingFPLogic
llvm-svn: 315754
Peter Collingbourne [Fri, 13 Oct 2017 21:02:16 +0000 (21:02 +0000)]
LowerTypeTests: Give imported symbols a type with size 0 so that they are not assumed not to alias.
It is possible for both a base and a derived class to be satisfied
with a unique vtable. If a program contains casts of the same pointer
to both of those types, the CFI checks will be lowered to this
(with ThinLTO):
if (p != &__typeid_base_global_addr)
trap();
if (p != &__typeid_derived_global_addr)
trap();
The optimizer may then use the first condition combined
with the assumption that __typeid_base_global_addr and
__typeid_derived_global_addr may not alias to optimize away the second
comparison, resulting in an unconditional trap.
This patch fixes the bug by giving imported globals the type [0 x i8]*,
which prevents the optimizer from assuming that they do not alias.
Differential Revision: https://reviews.llvm.org/D38873
llvm-svn: 315753
Sanjay Patel [Fri, 13 Oct 2017 20:56:35 +0000 (20:56 +0000)]
[Reassociate] auto-generate better checks; NFC
These would fail if the created variable names changed.
llvm-svn: 315752
Kostya Kortchinsky [Fri, 13 Oct 2017 20:55:31 +0000 (20:55 +0000)]
[scudo] Allow for non-Android Shared TSD platforms, part 2
Summary:
Follow up to D38826.
We introduce `pthread_{get,set}specific` versions of `{get,set}CurrentTSD` to
allow for non Android platforms to use the Shared TSD model.
We now allow `SCUDO_TSD_EXCLUSIVE` to be defined at compile time.
A couple of things:
- I know that `#if SANITIZER_ANDROID` is not ideal within a function, but in
the end I feel it looks more compact and clean than going the .inc route; I
am open to an alternative if anyone has one;
- `SCUDO_TSD_EXCLUSIVE=1` requires ELF TLS support (and not emutls as this uses
malloc). I haven't found anything to enforce that, so it's currently not
checked.
Reviewers: alekseyshl
Reviewed By: alekseyshl
Subscribers: srhines, llvm-commits
Differential Revision: https://reviews.llvm.org/D38854
llvm-svn: 315751
Artem Dergachev [Fri, 13 Oct 2017 20:54:56 +0000 (20:54 +0000)]
[analyzer] pr28449: Fix support for various array initializers.
In some cases the analyzer didn't expect an array-type variable to be
initialized with anything other than a string literal. The patch essentially
removes the assertion, and ensures relatively sane behavior.
There is a bigger problem with these initializers. Currently our memory model
(RegionStore) is being ordered to initialize the array with a region that
is assumed to be storing the initializer rvalue, and it guesses to copy
the contents of that region to the array variable. However, it would make
more sense for RegionStore to receive the correct initializer in the first
place. This problem isn't addressed with this patch.
rdar://problem/
27248428
Differential Revision: https://reviews.llvm.org/D23963
llvm-svn: 315750
Benjamin Kramer [Fri, 13 Oct 2017 20:46:14 +0000 (20:46 +0000)]
[Hexagon] Avoid unused variable warnings in release builds.
No functionality change intended.
llvm-svn: 315749
Matt Arsenault [Fri, 13 Oct 2017 20:45:49 +0000 (20:45 +0000)]
AMDGPU: Look for src mods before fp_extend
When selecting modifiers for mad_mix instructions,
look at fneg/fabs that occur before the conversion.
llvm-svn: 315748
Daniel Sanders [Fri, 13 Oct 2017 20:42:18 +0000 (20:42 +0000)]
[aarch64] Support APInt and APFloat in ImmLeaf subclasses and make AArch64 use them.
Summary:
The purpose of this patch is to expose more information about ImmLeaf-like
PatLeaf's so that GlobalISel can learn to import them. Previously, ImmLeaf
could only be used to test int64_t's produced by sign-extending an APInt.
Other tests on immediates had to use the generic PatLeaf and extract the
constant using C++.
With this patch, tablegen will know how to generate predicates for APInt,
and APFloat. This will allow it to 'do the right thing' for both SelectionDAG
and GlobalISel which require different methods of extracting the immediate
from the IR.
This is NFC for SelectionDAG since the new code is equivalent to the
previous code. It's also NFC for FastISel because FastIselShouldIgnore is 1
for the ImmLeaf subclasses. Enabling FastIselShouldIgnore == 0 for these new
subclasses will require a significant re-factor of FastISel.
For GlobalISel, it's currently NFC because the relevant code to import the
affected rules is not yet present. This will be added in a later patch.
Depends on D36086
Reviewers: ab, t.p.northover, qcolombet, rovka, aditya_nandakumar
Reviewed By: qcolombet
Subscribers: bjope, aemerson, rengolin, javed.absar, igorb, llvm-commits, kristof.beyls
Differential Revision: https://reviews.llvm.org/D36534
llvm-svn: 315747
Benjamin Kramer [Fri, 13 Oct 2017 20:37:52 +0000 (20:37 +0000)]
[SmallPtrSet] Add iterator epoch tracking.
This will detect invalid iterators when ABI breaking checks are enabled.
llvm-svn: 315746
Sanjay Patel [Fri, 13 Oct 2017 20:29:11 +0000 (20:29 +0000)]
[InstCombine] move code to remove repeated constant check; NFCI
Also, consolidate tests for this fold in one place.
llvm-svn: 315745
Matt Arsenault [Fri, 13 Oct 2017 20:18:59 +0000 (20:18 +0000)]
AMDGPU: Implement isFPExtFoldable
This helps match v_mad_mix* in some cases.
llvm-svn: 315744
Sanjay Patel [Fri, 13 Oct 2017 20:12:21 +0000 (20:12 +0000)]
[InstCombine] recycle adds for better efficiency
Also, clean up unnecessary matcher capture variable initializations.
llvm-svn: 315743
Artem Dergachev [Fri, 13 Oct 2017 20:11:00 +0000 (20:11 +0000)]
[analyzer] CStringChecker: pr34460: Avoid a crash when a cast is not modeled.
The checker used to crash when a mempcpy's length argument is symbolic. In this
case the cast from 'void *' to 'char *' failed because the respective
ElementRegion that represents cast is hard to add on top of the existing
ElementRegion that represents the offset to the last copied byte, while
preseving a sane memory region structure.
Additionally, a few test cases are added (to casts.c) which demonstrate problems
caused by existing sloppy work we do with multi-layer ElementRegions. If said
cast would be modeled properly in the future, these tests would need to be
taken into account.
Differential Revision: https://reviews.llvm.org/D38797
llvm-svn: 315742
Saleem Abdulrasool [Fri, 13 Oct 2017 20:07:30 +0000 (20:07 +0000)]
Basic: adjust attributes on `nan` LIBBUILTINs
The `nan` family of functions will inspect the contents of the parameter
that they are passed. As a result, the function cannot be annotated as
`const`. The documentation of the `const` attribute explicitly states
this:
Note that a function that has pointer arguments and examines the data
pointed to must not be declared const.
Adjust the annotations on this family of functions.
llvm-svn: 315741
Matt Arsenault [Fri, 13 Oct 2017 19:55:45 +0000 (19:55 +0000)]
DAG: Add opcode and source type to isFPExtFree
This is only currently used for mad/fma transforms.
This is the only case where it should be used for AMDGPU,
so add an opcode to be sure.
llvm-svn: 315740
Ivan A. Kosarev [Fri, 13 Oct 2017 19:55:01 +0000 (19:55 +0000)]
Revert "[CodeGen] EmitPointerWithAlignment() to generate TBAA info along with LValue base info", r315731.
With this change we fail on the clang-x86_64-linux-selfhost-modules builder.
Differential Revision: https://reviews.llvm.org/D38796
llvm-svn: 315739
Alex Lorenz [Fri, 13 Oct 2017 19:42:05 +0000 (19:42 +0000)]
[clang-refactor] Apply source replacements
This commit actually brings clang-refactor to a usable state as it can now
apply the refactoring changes to source files.
The -selection option is now also fully supported.
Differential Revision: https://reviews.llvm.org/D38402
llvm-svn: 315738
Petr Hosek [Fri, 13 Oct 2017 19:30:00 +0000 (19:30 +0000)]
[ELF] Recognize additional relocation types
These are generated by the linker itself and it shouldn't treat
them as unrecognized. This was introduced in r315552 and is triggering
an error when building UBSan shared library for i386.
Differential Revision: https://reviews.llvm.org/D38899
llvm-svn: 315737
Artem Dergachev [Fri, 13 Oct 2017 19:10:42 +0000 (19:10 +0000)]
[analyzer] RetainCount: Ignore annotations on user-made CFRetain wrappers.
It is not uncommon for the users to make their own wrappers around
CoreFoundation's CFRetain and CFRelease functions that are defensive
against null references. In such cases CFRetain is often incorrectly
marked as CF_RETURNS_RETAINED. Ignore said annotation and treat such
wrappers similarly to the regular CFRetain.
rdar://problem/
31699502
Differential Revision: https://reviews.llvm.org/D38877
llvm-svn: 315736
Krzysztof Parzyszek [Fri, 13 Oct 2017 19:02:59 +0000 (19:02 +0000)]
[Hexagon] Minimize number of repeated constant extenders
Each constant extender requires an extra instruction, which adds to the
code size and also reduces the number of available slots in an instruction
packet. In most cases, the value of a repeated constant extender could be
loaded into a register, and the instructions using the extender could be
replaced with their counterparts that use that register instead.
This patch adds a pass that tries to reduce the number of constant
extenders, including extenders which differ only in an immediate offset
known at compile time, e.g. @global and @global+12.
llvm-svn: 315735
Rafael Espindola [Fri, 13 Oct 2017 19:02:08 +0000 (19:02 +0000)]
Simplify. NFC.
llvm-svn: 315734
Daniel Sanders [Fri, 13 Oct 2017 19:00:01 +0000 (19:00 +0000)]
Revert r315148 [TableGen] Avoid unnecessary std::string creations
I'm about to commit a patch that makes them necessary for getPredCode() and
it would be strange for getPredCode() and getImmCode() to require different
usage.
llvm-svn: 315733
Rafael Espindola [Fri, 13 Oct 2017 18:57:30 +0000 (18:57 +0000)]
Fix build.
llvm-svn: 315732
Ivan A. Kosarev [Fri, 13 Oct 2017 18:40:18 +0000 (18:40 +0000)]
[CodeGen] EmitPointerWithAlignment() to generate TBAA info along with LValue base info
Differential Revision: https://reviews.llvm.org/D38796
llvm-svn: 315731
Alex Shlyapnikov [Fri, 13 Oct 2017 18:38:10 +0000 (18:38 +0000)]
[Sanitizers] Add more details to ASan allocator stats report.
Summary: .
Reviewers: cryptoad
Subscribers: kubamracek, llvm-commits
Differential Revision: https://reviews.llvm.org/D38834
llvm-svn: 315730
Craig Topper [Fri, 13 Oct 2017 18:38:10 +0000 (18:38 +0000)]
[X86] Remove 'knm' defines from predefined-arch-macros.c test.
Direction seems to be that we dont' want to keep adding these, but I forgot to remove it from the test before I committed r315723.
llvm-svn: 315729
Sanjay Patel [Fri, 13 Oct 2017 18:32:53 +0000 (18:32 +0000)]
[InstCombine] use local var to reduce code duplication; NFCI
llvm-svn: 315728
Rafael Espindola [Fri, 13 Oct 2017 18:32:16 +0000 (18:32 +0000)]
Handle shared symbols in --gc-sections.
We don't want to gc a section if it is used via __start_*, but we were
doing that if the same symbol was visible in a shared library.
llvm-svn: 315727
Sanjay Patel [Fri, 13 Oct 2017 18:25:23 +0000 (18:25 +0000)]
[LLVMCore] fix description for OverflowingBinaryOperator; NFC
llvm-svn: 315726
Bob Haarman [Fri, 13 Oct 2017 18:22:55 +0000 (18:22 +0000)]
[lld] Move Threads to Common
Summary:
This will allow using the functionality from other linkers. It is also
a prerequisite for sharing the error logging code.
Reviewers: ruiu
Reviewed By: ruiu
Subscribers: emaste, mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D38822
llvm-svn: 315725
Rafael Espindola [Fri, 13 Oct 2017 18:18:36 +0000 (18:18 +0000)]
Simplify. NFC.
llvm-svn: 315724
Craig Topper [Fri, 13 Oct 2017 18:14:24 +0000 (18:14 +0000)]
[X86] Add skeleton support for knm cpu
This adds support Knights Mill CPU. Preprocessor defines match gcc's implementation.
Differential Revision: https://reviews.llvm.org/D38813
llvm-svn: 315723
Craig Topper [Fri, 13 Oct 2017 18:10:17 +0000 (18:10 +0000)]
[X86] Add initial skeleton support for knm cpu
This adds Intel's Knights Mill CPU to valid CPU names for the backend. For now its an alias of "knl", but ultimately we need to support AVX5124FMAPS and AVX5124VNNIW instruction sets for it.
Differential Revision: https://reviews.llvm.org/D38811
llvm-svn: 315722
Rafael Espindola [Fri, 13 Oct 2017 18:07:11 +0000 (18:07 +0000)]
Handle shared and lazy symbol in the gnu hash construction.
We were not considering those symbols undefined and they could end up
in the end of the dynamic symbol table.
llvm-svn: 315721
Rafael Espindola [Fri, 13 Oct 2017 18:03:11 +0000 (18:03 +0000)]
Relax test.
These value are irrelevant for the test.
llvm-svn: 315720
Matthew Simpson [Fri, 13 Oct 2017 17:53:44 +0000 (17:53 +0000)]
[IPSCCP] Move common functions to ValueLatticeUtils (NFC)
This patch moves some common utility functions out of IPSCCP and makes them
available globally. The functions determine if interprocedural data-flow
analyses can propagate information through function returns, arguments, and
global variables.
Differential Revision: https://reviews.llvm.org/D37638
llvm-svn: 315719
Sanjay Patel [Fri, 13 Oct 2017 17:47:25 +0000 (17:47 +0000)]
[InstCombine] add hasOneUse check to add-zext-add fold to prevent increasing instructions
llvm-svn: 315718
Sanjay Patel [Fri, 13 Oct 2017 17:42:12 +0000 (17:42 +0000)]
[InstCombine] add tests for add (zext (add nuw X, C2)), C --> zext (add nuw X, C2 + C); NFC
llvm-svn: 315717
Matt Morehouse [Fri, 13 Oct 2017 17:35:37 +0000 (17:35 +0000)]
[llvm-demangle-fuzzer] Add a fuzz target for ItaniumDemangler.
Patch By: hctim
Reviewers: morehouse, bogner
Reviewed By: bogner
Subscribers: bogner, kcc, llvm-commits, mgorny
Differential Revision: https://reviews.llvm.org/D38855
llvm-svn: 315716
Ivan A. Kosarev [Fri, 13 Oct 2017 17:34:18 +0000 (17:34 +0000)]
[CodeGen] emitOMPArraySectionBase() to generate TBAA info along with LValue base info
Differential Revision: https://reviews.llvm.org/D38795
llvm-svn: 315715
Max Moroz [Fri, 13 Oct 2017 17:27:39 +0000 (17:27 +0000)]
[llvm-cov] Reland sources-specified.test with addition of "-path-equivalence".
Summary: This version of tests should be working properly.
Reviewers: vsk
Reviewed By: vsk
Differential Revision: https://reviews.llvm.org/D38889
llvm-svn: 315714
Sanjoy Das [Fri, 13 Oct 2017 17:13:44 +0000 (17:13 +0000)]
[SCEV] Maintain and use a loop->loop invalidation dependency
Summary:
This change uses the loop use list added in the previous change to remember the
loops that appear in the trip count expressions of other loops; and uses it in
forgetLoop. This lets us not scan every loop in the function on a forgetLoop
call.
With this change we no longer invalidate clear out backedge taken counts on
forgetValue. I think this is fine -- the contract is that SCEV users must call
forgetLoop(L) if their change to the IR could have changed the trip count of L;
solely calling forgetValue on a value feeding into the backedge condition of L
is not enough. Moreover, I don't think we can strengthen forgetValue to be
sufficient for invalidating trip counts without significantly re-architecting
SCEV. For instance, if we have the loop:
I = *Ptr;
E = I + 10;
do {
// ...
} while (++I != E);
then the backedge taken count of the loop is 9, and it has no reference to
either I or E, i.e. there is no way in SCEV today to re-discover the dependency
of the loop's trip count on E or I. So a SCEV client cannot change E to (say)
"I + 20", call forgetValue(E) and expect the loop's trip count to be updated.
Reviewers: atrick, sunfish, mkazantsev
Subscribers: mcrosier, llvm-commits
Differential Revision: https://reviews.llvm.org/D38435
llvm-svn: 315713
Bruno Cardoso Lopes [Fri, 13 Oct 2017 17:11:13 +0000 (17:11 +0000)]
Revert "[lit] Raise the logic for enabling clang & lld substitutions to llvm."
This reverts commit r315627, fixing bot failures:
http://green.lab.llvm.org/green/job/clang-stage1-configure-RA
LIT is failing to properly apply substitution to debuginfo-tests
after this change.
rdar://problem/
34979568
llvm-svn: 315712
Simon Pilgrim [Fri, 13 Oct 2017 17:09:20 +0000 (17:09 +0000)]
[X86] Test scalar integer absolutes on 32-bit targets with/without CMOV
llvm-svn: 315711
Reid Kleckner [Fri, 13 Oct 2017 17:00:49 +0000 (17:00 +0000)]
Not all buildbots seem to dump the nuw flag in SDAG
llvm-svn: 315710
Sanjay Patel [Fri, 13 Oct 2017 17:00:47 +0000 (17:00 +0000)]
[InstCombine] use AddOne helper to reduce code; NFC
llvm-svn: 315709
Ivan A. Kosarev [Fri, 13 Oct 2017 16:58:30 +0000 (16:58 +0000)]
[CodeGen] getNaturalTypeAlignment() to generate TBAA info along with LValue base info
This patch should not bring in any functional changes.
Differential Revision: https://reviews.llvm.org/D38794
llvm-svn: 315708
Reid Kleckner [Fri, 13 Oct 2017 16:55:14 +0000 (16:55 +0000)]
[SEH] Use the SEH personality on frontend-outlined funclets
This allows __try inside __finally to work.
Fixes PR34939
llvm-svn: 315707
Simon Pilgrim [Fri, 13 Oct 2017 16:53:07 +0000 (16:53 +0000)]
[X86] Updated scalar integer absolute tests to cover i8/i16/i32/i64
llvm-svn: 315706
Ivan A. Kosarev [Fri, 13 Oct 2017 16:50:50 +0000 (16:50 +0000)]
[CodeGen] EmitLoadOfReference() to generate TBAA info along with LValue base info
This patch should not bring in any functional changes.
Differential Revision: https://reviews.llvm.org/D38793
llvm-svn: 315705
Ivan A. Kosarev [Fri, 13 Oct 2017 16:47:22 +0000 (16:47 +0000)]
[CodeGen] EmitLoadOfPointer() to generate TBAA info along with LValue base info
This patch should not bring in any functional changes.
Differential Revision: https://reviews.llvm.org/D38791
llvm-svn: 315704
Sanjay Patel [Fri, 13 Oct 2017 16:43:58 +0000 (16:43 +0000)]
[InstCombine] rearrange code to remove repeated constant check; NFCI
llvm-svn: 315703
Ivan A. Kosarev [Fri, 13 Oct 2017 16:38:32 +0000 (16:38 +0000)]
[CodeGen] EmitCXXMemberDataPointerAddress() to generate TBAA info along with LValue base info
This patch should not bring in any functional changes.
Differential Revision: https://reviews.llvm.org/D38788
llvm-svn: 315702
Sanjay Patel [Fri, 13 Oct 2017 16:29:38 +0000 (16:29 +0000)]
[InstCombine] allow zext(bool) + C --> select bool, C+1, C for vector types
The backend should be prepared for this transform after:
https://reviews.llvm.org/rL311731
llvm-svn: 315701
Javed Absar [Fri, 13 Oct 2017 16:27:57 +0000 (16:27 +0000)]
[TableGen] : Simplify RegisterInfoEmitter
llvm-svn: 315700
Reid Kleckner [Fri, 13 Oct 2017 16:18:32 +0000 (16:18 +0000)]
Hide "#pragma optimize("", off)" from clang when it pretends to be MSVC 2017
These pragmas work around a bug in VC 1911 that isn't present in clang,
and clang warns about them.
llvm-svn: 315699
Reid Kleckner [Fri, 13 Oct 2017 16:13:23 +0000 (16:13 +0000)]
Update test to expect nuw flag in SDAG dump, fixes test after r315690
llvm-svn: 315698
Jordan Rose [Fri, 13 Oct 2017 16:12:23 +0000 (16:12 +0000)]
lit.py: Add new %{shared_output(LABEL)} substitution
This refers to a temporary path that can be shared across all tests,
identified by a particular label. This can be used for things like
caches.
At the moment, the character set for the LABEL is limited to C
identifier characters, plus '-', '+', '=', and '.'. This is the same
set of characters currently allowed in REQUIRES clause identifiers.
llvm-svn: 315697
Craig Topper [Fri, 13 Oct 2017 16:06:06 +0000 (16:06 +0000)]
[X86] Fix some inconsistent formatting in the processor feature lists.
llvm-svn: 315696
Craig Topper [Fri, 13 Oct 2017 16:04:08 +0000 (16:04 +0000)]
[X86] Add ProcIntelBDW to BroadwellProc class not BDWFeatures class.
This isn't a property we want inherited.
llvm-svn: 315695
Daniel Neilson [Fri, 13 Oct 2017 15:59:13 +0000 (15:59 +0000)]
[RS4GC] Look through vector bitcasts when looking for base pointer
Summary:
In RS4GC it is possible that a base pointer is contained in a vector that
has undergone a bitcast from one element-pointertype to another. We teach
RS4GC how to look through bitcasts of vector types when looking for a base
pointer.
Reviewers: anna
Reviewed By: anna
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D38849
llvm-svn: 315694
Max Moroz [Fri, 13 Oct 2017 15:58:58 +0000 (15:58 +0000)]
[llvm-cov] Temporary delete sources-specified.test, it is failing on some bots.
Summary: http://lab.llvm.org:8011/builders/clang-with-thin-lto-ubuntu/builds/5950/steps/test-stage1-compiler/logs/stdio
Reviewers: vsk, Dor1s
Reviewed By: Dor1s
Subscribers: mehdi_amini
Differential Revision: https://reviews.llvm.org/D38888
llvm-svn: 315693
Krzysztof Parzyszek [Fri, 13 Oct 2017 15:43:12 +0000 (15:43 +0000)]
[Hexagon] Add patterns for cmpb/cmph with immediate arguments
Patch by Sumanth Gundapaneni.
llvm-svn: 315692
Max Moroz [Fri, 13 Oct 2017 15:41:51 +0000 (15:41 +0000)]
[llvm-cov] Fix sources-specified.test so it ignores the order of files printed.
Summary: https://reviews.llvm.org/D38884#896964
Reviewers: vsk, Dor1s
Reviewed By: Dor1s
Differential Revision: https://reviews.llvm.org/D38887
llvm-svn: 315691
Matt Arsenault [Fri, 13 Oct 2017 15:41:40 +0000 (15:41 +0000)]
DAG: Add flags to dumps
llvm-svn: 315690
Haojian Wu [Fri, 13 Oct 2017 15:37:53 +0000 (15:37 +0000)]
Fix an unused-variable warning.
llvm-svn: 315689
Haojian Wu [Fri, 13 Oct 2017 15:34:03 +0000 (15:34 +0000)]
Remove an unused variable.
Fix -Wunused-but-set-variable warning.
llvm-svn: 315688
Max Moroz [Fri, 13 Oct 2017 15:30:24 +0000 (15:30 +0000)]
[llvm-cov] An attempt to fix sources_specified.test failing on some buildbots.
Summary: https://reviews.llvm.org/rL315685#115380
Reviewers: vsk, Dor1s
Reviewed By: Dor1s
Differential Revision: https://reviews.llvm.org/D38884
llvm-svn: 315687
Craig Topper [Fri, 13 Oct 2017 15:28:35 +0000 (15:28 +0000)]
[X86] Stop creating CMOV nodes with a second MVT::Glue result
Summary: We seem to inconsistently create CMOV nodes some with a Glue result and some without. But I can't find any cases that use the Glue result. So I've tried to remove all the place that did this.
Reviewers: RKSimon, spatel, zvi
Reviewed By: RKSimon
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D38664
llvm-svn: 315686
Max Moroz [Fri, 13 Oct 2017 14:44:51 +0000 (14:44 +0000)]
[llvm-cov] Generate "report" for given source paths if sources are specified.
Summary:
Documentation says that user can specify sources for both "show" and
"report" commands. "Show" command respects specified sources, but "report" does
not. It is useful to have both "show" and "report" generated for specified
sources. Also added tests to for both commands with sources specified.
Reviewers: vsk, kcc
Reviewed By: vsk
Differential Revision: https://reviews.llvm.org/D38860
llvm-svn: 315685
Jonas Devlieghere [Fri, 13 Oct 2017 14:41:23 +0000 (14:41 +0000)]
Re-land "[dsymutil] Timestmap verification for __swift_ast"
This patch adds timestamp verification for swiftmodule files. A new flag
is provided to allows us to disable this check in order to allow testing
of this feature.
Differential revision: https://reviews.llvm.org/D38686
llvm-svn: 315684
Anna Thomas [Fri, 13 Oct 2017 14:30:43 +0000 (14:30 +0000)]
[SCEV] Teach SCEV to find maxBECount when loop endbound is variant
Summary:
This patch teaches SCEV to calculate the maxBECount when the end bound
of the loop can vary. Note that we cannot calculate the exactBECount.
This will only be done when both conditions are satisfied:
1. the loop termination condition is strictly LT.
2. the IV is proven to not overflow.
This provides more information to users of SCEV and can be used to
improve identification of finite loops.
Reviewers: sanjoy, mkazantsev, silviu.baranga, atrick
Reviewed by: mkazantsev
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D38825
llvm-svn: 315683
Alexander Kornienko [Fri, 13 Oct 2017 14:11:14 +0000 (14:11 +0000)]
[clang-tidy] Add a regression test for google-readability-namespace-comments
Add a regression test for the google-readability-namespace-comments bug
introduced in r315057 (reverted in r315580).
llvm-svn: 315682