Daniel Berlin [Mon, 10 Apr 2017 18:46:00 +0000 (18:46 +0000)]
MemorySSA: Make lifetime starts defs for mustaliased pointers
Summary:
While we don't want them aliasing with other pointers, there seems to
be no point in not having them clobber must-aliased'd pointers.
If some day, we split the aliasing and ordering chains, we'd make this
not aliasing but an ordering barrier (IE it doesn't affect it's
memory, but we can't hoist it above it).
Reviewers: hfinkel, george.burgess.iv
Subscribers: Prazek, llvm-commits
Differential Revision: https://reviews.llvm.org/D31865
llvm-svn: 299865
Matthew Simpson [Mon, 10 Apr 2017 18:34:37 +0000 (18:34 +0000)]
[ARM/AArch64] Ensure valid vector element types for interleaved accesses
This patch refactors and strengthens the type checks performed for interleaved
accesses. The primary functional change is to ensure that the interleaved
accesses have valid element types. The added test cases previously failed
because the element type is f128.
Differential Revision: https://reviews.llvm.org/D31817
llvm-svn: 299864
Craig Topper [Mon, 10 Apr 2017 18:09:25 +0000 (18:09 +0000)]
[InstCombine] Use commutable matchers and m_OneUse in visitSub to shorten code. Add missing test cases.
In one case I removed commute handling for a multiply with a constant since we'll eventually get the constant on the right hand side.
llvm-svn: 299863
Vitaly Buka [Mon, 10 Apr 2017 17:59:07 +0000 (17:59 +0000)]
[msan] Make test to fall-back to IPv6 if IPv4 is not available.
Reviewers: eugenis
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31896
llvm-svn: 299862
Matt Arsenault [Mon, 10 Apr 2017 17:58:06 +0000 (17:58 +0000)]
AMDGPU: Fix crash when disassembling VOP3 mac
The unused dummy src2_modifiers is missing, so it crashes
when trying to print it.
I tried to fully remove src2_modifiers, but there are some
irritations in the places where it is converted to mad since
it starts to require modifying use lists while iterating over
them.
llvm-svn: 299861
Vitaly Buka [Mon, 10 Apr 2017 17:58:03 +0000 (17:58 +0000)]
[msan] Replace AF_INET with AF_UNIX to avoid IPv4 vs IPv6 issues.
Summary: This reverts commit
79cf16bf224d6ac9fb9e0356c5947ebc4fd6ff92.
Reviewers: eugenis
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31895
llvm-svn: 299860
Vitaly Buka [Mon, 10 Apr 2017 17:56:37 +0000 (17:56 +0000)]
[msan] Wrap sockaddr_in and socket for future IPv6 support.
Reviewers: eugenis
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31893
llvm-svn: 299859
Vitaly Buka [Mon, 10 Apr 2017 17:22:06 +0000 (17:22 +0000)]
[msan] Reorder unittests for future parametrization.
Reviewers: eugenis
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31892
llvm-svn: 299858
Zachary Turner [Mon, 10 Apr 2017 17:18:54 +0000 (17:18 +0000)]
[Support] Add support for finding unset bits in a BitVector.
BitVector had methods for searching for the first and next
set bits, but it did not have analagous methods for finding
the first and next unset bits. This is useful when your ones
and zeros are grouped together and you want to iterate over
ranges of ones and zeros.
Differential Revision: https://reviews.llvm.org/D31802
llvm-svn: 299857
Zachary Turner [Mon, 10 Apr 2017 17:17:11 +0000 (17:17 +0000)]
Fix line endings.
llvm-svn: 299856
Zachary Turner [Mon, 10 Apr 2017 17:15:11 +0000 (17:15 +0000)]
Remove eol-style:native from BitVector.h
llvm-svn: 299855
Reid Kleckner [Mon, 10 Apr 2017 17:03:44 +0000 (17:03 +0000)]
[clangd] Relax absolute path checking assertion
clangd can process absolute paths from systems that don't use the native
path style, so this assertion needs to check both Windows and Posix path
styles.
Fixes PR32596
llvm-svn: 299854
Craig Topper [Mon, 10 Apr 2017 16:59:40 +0000 (16:59 +0000)]
[InstCombine] Use m_c_Add to shorten some code. Add testcases for this fold since they were missing. NFC
llvm-svn: 299853
Simon Pilgrim [Mon, 10 Apr 2017 16:58:07 +0000 (16:58 +0000)]
[X86][MMX] Add fast-isel support for MMX non-temporal writes
Differential Revision: https://reviews.llvm.org/D31754
llvm-svn: 299852
Sanjay Patel [Mon, 10 Apr 2017 16:55:57 +0000 (16:55 +0000)]
[InstCombine] fix matching of or-of-icmps constants (PR32524)
Also, make the same change in and-of-icmps and remove a hack for detecting that case.
Finally, add some FIXME comments because the code duplication here is awful.
This should fix the remaining IR problem noted in:
https://bugs.llvm.org/show_bug.cgi?id=32524
llvm-svn: 299851
Reid Kleckner [Mon, 10 Apr 2017 16:55:48 +0000 (16:55 +0000)]
Revert "XFAIL clangd tests on Windows"
This reverts r299849, apparently these tests only fail on my machine.
llvm-svn: 299850
Reid Kleckner [Mon, 10 Apr 2017 16:50:55 +0000 (16:50 +0000)]
XFAIL clangd tests on Windows
They all assert. Filed as PR32596.
llvm-svn: 299849
Adrian McCarthy [Mon, 10 Apr 2017 16:43:09 +0000 (16:43 +0000)]
Improves pretty printing of variable types in llvm-pdbdump
* Adds support for pointers to arrays, which was missing
* Adds some tests
* Improves consistency of const and volatile qualifiers
* Eliminates non-composable special case code for arrays and function by using
a more general recursive approach
* Has a hack for getting the calling convention into the right spot for
pointer-to-functions
Given the rapid changes happenning in llvm-pdbdump, this may be difficult to
merge.
Differential Revision: https://reviews.llvm.org/D31832
llvm-svn: 299848
Craig Topper [Mon, 10 Apr 2017 16:40:00 +0000 (16:40 +0000)]
[InstCombine] Support folding of add instructions with vector constants into select operations
We currently only fold scalar add of constants into selects. This improves this to support vectors too.
Differential Revision: https://reviews.llvm.org/D31683
llvm-svn: 299847
Sanjay Patel [Mon, 10 Apr 2017 16:28:08 +0000 (16:28 +0000)]
[InstCombine] add test for PR32524; NFC
llvm-svn: 299846
Shoaib Meenai [Mon, 10 Apr 2017 15:41:15 +0000 (15:41 +0000)]
[lldb] Fix ninja URL
The old URL is a 404 now. Pointed out by Smirftsch1 on IRC.
llvm-svn: 299845
Krasimir Georgiev [Mon, 10 Apr 2017 14:06:54 +0000 (14:06 +0000)]
[clangd] Fix nondeterminism in clangd test
llvm-svn: 299844
Krasimir Georgiev [Mon, 10 Apr 2017 13:31:39 +0000 (13:31 +0000)]
[clangd] Remove ASTUnits for closed documents and cache CompilationDatabase per directory.
Contributed by ilya-biryukov!
Differential Revision: https://reviews.llvm.org/D31746
llvm-svn: 299843
Diana Picus [Mon, 10 Apr 2017 09:27:39 +0000 (09:27 +0000)]
[ARM] GlobalISel: Support G_FPOW for float and double
Legalize to a libcall.
llvm-svn: 299841
Craig Topper [Mon, 10 Apr 2017 07:13:40 +0000 (07:13 +0000)]
[InstCombine] Use commutable and/or/xor matchers to simplify some code
Summary:
This is my first time using the commutable matchers so wanted to make sure I was doing it right.
Are there any other matcher tricks to further shrink this? Can we commute the whole match so we don't have to LHS and RHS separately?
Reviewers: davide, spatel
Reviewed By: davide
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31680
llvm-svn: 299840
Craig Topper [Mon, 10 Apr 2017 07:06:44 +0000 (07:06 +0000)]
[SelectionDAG] TargetLowering::SimplifyDemandedBits how to properly calculate KnownZero bits for ISD::SETCC and ISD::AssertZExt
Summary:
For SETCC we aren't calculating the KnownZero bits at all. I've copied the code from computeKnownZero over for this.
For AssertZExt we were only setting KnownZero for bits that were demanded. But the upper bits are zero whether they were demanded or not.
I'm interested in fixing this because my belief is the first part of the ISD::AND handling code in SimplifyDemandedBits largely exists because of these two bugs. In that code we go to computeKnownBits for the LHS and optimize a RHS constant. Because computeKnownBits handles SETCC and AssertZExt correctly we get better information sometimes than when we call SimplifyDemandedBits on the LHS later. With these two issues fixed in SimplifyDemandedBits I was able to remove that computeKnownBits call and still pass all X86 tests. I'll submit that change in a separate patch.
Reviewers: RKSimon, spatel
Reviewed By: RKSimon
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31715
llvm-svn: 299839
Craig Topper [Mon, 10 Apr 2017 07:00:10 +0000 (07:00 +0000)]
[InstCombine] Make sure we preserve fast math flags when folding fp instructions into phi nodes
Summary: I noticed in the select folding code that we copied fast math flags, but did not do the same for the similar handling in phi nodes. This patch fixes that to do the same thing as select
Reviewers: spatel, davide, majnemer, hfinkel
Reviewed By: davide
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31690
llvm-svn: 299838
Craig Topper [Mon, 10 Apr 2017 06:53:28 +0000 (06:53 +0000)]
[InstCombine] use m_c_And and m_c_Xor to handle commuted versions of a transform.
llvm-svn: 299837
Craig Topper [Mon, 10 Apr 2017 06:53:25 +0000 (06:53 +0000)]
[InstCombine] Add test cases demonstrating missing handling for the commuted version of a transform. NFC.
llvm-svn: 299836
Craig Topper [Mon, 10 Apr 2017 06:53:23 +0000 (06:53 +0000)]
[InstCombine] Remove unnecessary dyn_cast to BinaryOperator around some matcher checks in visitXor.
The matchers themselves should be enough.
llvm-svn: 299835
Craig Topper [Mon, 10 Apr 2017 06:53:21 +0000 (06:53 +0000)]
[InstCombine] Make the (A|B)^B -> A & ~B transform code consistent with the very similar (A&B)^B -> ~A & B code. This should be NFC except for the addition of hasOneUse check.
I think this code is still overly complicated and should use matchers, but first I wanted to make it consistent.
llvm-svn: 299834
Craig Topper [Mon, 10 Apr 2017 06:53:19 +0000 (06:53 +0000)]
[InstCombine] Use m_OneUse to shorten some code. NFC
llvm-svn: 299833
Zachary Turner [Mon, 10 Apr 2017 06:30:28 +0000 (06:30 +0000)]
Remove unused method.
This is causing build breaks, but it's unused anyway, so delete
it.
llvm-svn: 299832
Zachary Turner [Mon, 10 Apr 2017 06:14:09 +0000 (06:14 +0000)]
General usability improvements to generic PDB library.
1. Added some asserts to make sure concrete symbol types don't
get constructed with RawSymbols that have an incompatible
SymTag enum value.
2. Added new forwarding macros that auto-define an Id/Sym method
pair whenever there is a method that returns a SymIndexId.
Previously we would just provide one method that returned only
the SymIndexId and it was up to the caller to use the Session
object to get a pointer to the symbol. Now we automatically
get both the method that returns the Id, as well as a method
that returns the pointer directly with just one macro.
3. Added some methods for dumping straight to stdout that can
be used from inside the debugger for diagnostics during a
debug session.
4. Added a clone() method and a cast<T>() method to PDBSymbol
that can shorten some usage patterns.
llvm-svn: 299831
Xin Tong [Mon, 10 Apr 2017 00:33:25 +0000 (00:33 +0000)]
[SCCP] Resolve indirect branch target when possible.
Summary:
Resolve indirect branch target when possible.
This potentially eliminates more basicblocks and result in better evaluation for phi and other things.
Reviewers: davide, efriedma, sanjoy
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D30322
llvm-svn: 299830
Sanjay Patel [Sun, 9 Apr 2017 21:51:34 +0000 (21:51 +0000)]
[InstCombine] remove dead cases from icmp pair switches; NFCI
"PredicatesFoldable" returns false for signed/unsigned mismatched pairs,
so these cases should never exist. We'll default to 'unreachable' on those
predicate combos instead.
Most of what's left in these switches belongs in InstSimplify (and may
already be there), so there's probably more that can be done to reduce
this code.
llvm-svn: 299829
Sanjay Patel [Sun, 9 Apr 2017 21:45:52 +0000 (21:45 +0000)]
[InstCombine] remove duplicate test; NFC
I moved this test to 'not.ll' in r299824 but accidentally added a copy here.
llvm-svn: 299828
Davide Italiano [Sun, 9 Apr 2017 20:47:14 +0000 (20:47 +0000)]
[Mem2Reg] Remove AliasSetTracker updating logic from the pass.
No caller has been passing it for a long time.
llvm-svn: 299827
Sanjay Patel [Sun, 9 Apr 2017 16:16:32 +0000 (16:16 +0000)]
[SimplifyCFG] auto-generate better checks; NFC
llvm-svn: 299825
Sanjay Patel [Sun, 9 Apr 2017 15:44:59 +0000 (15:44 +0000)]
[InstCombine] auto-generate better checks; NFC
Also, move a test next to its sibling to eliminate a file with just one test.
llvm-svn: 299824
Hal Finkel [Sun, 9 Apr 2017 12:57:50 +0000 (12:57 +0000)]
[MemorySSA] Fix use of pointsToConstantMemory in isUseTriviallyOptimizableToLiveOnEntry
In isUseTriviallyOptimizableToLiveOnEntry, pointsToConstantMemory needs to be
called on the load's pointer operand, not on the result of the load (which
might not even be a pointer).
llvm-svn: 299823
Craig Topper [Sun, 9 Apr 2017 06:12:41 +0000 (06:12 +0000)]
[InstCombine] Extend some OR combines to support vectors.
This adds support for these combines for vectors
(X^C)|Y -> (X|Y)^C iff Y&C == 0
Y|(X^C) -> (X|Y)^C iff Y&C == 0
llvm-svn: 299822
Craig Topper [Sun, 9 Apr 2017 06:12:39 +0000 (06:12 +0000)]
[InstCombine] Extend a canonicalization check to apply to vector constants too.
llvm-svn: 299821
Craig Topper [Sun, 9 Apr 2017 06:12:36 +0000 (06:12 +0000)]
[InstCombine] Add test cases to show missing support for vectors in an OR combine. Also add the commuted versions. NFC
llvm-svn: 299820
Craig Topper [Sun, 9 Apr 2017 06:12:34 +0000 (06:12 +0000)]
[InstCombine] Use the SubOne helper function to shorten some code. NFC
llvm-svn: 299819
Craig Topper [Sun, 9 Apr 2017 06:12:31 +0000 (06:12 +0000)]
[InstCombine] rename variable for easier reading; NFC
We usually give constants a 'C' somewhere in the name...
llvm-svn: 299818
Peter Collingbourne [Sat, 8 Apr 2017 23:35:49 +0000 (23:35 +0000)]
MC: Remove unused virtual function MCObjectWriter::isWeak. NFC.
llvm-svn: 299817
Matt Arsenault [Sat, 8 Apr 2017 21:28:38 +0000 (21:28 +0000)]
AMDGPU: Actually write nops for writeNopData
Before this was just writing 0s, which ends up looking like a
v_cndmask_b32 v0, s0, v0, vcc. Write out an encoded s_nop instead.
llvm-svn: 299816
Coby Tayree [Sat, 8 Apr 2017 20:29:03 +0000 (20:29 +0000)]
[AsmParser]Emit an error if a macro has two (or more) parameters sharing the same name
Introducing a new error to macro parameters' parsing:
currently, llvm-mc won't complain if a macro have two (or more) named params with the same name.
this behavior is false, as there's no merit in having some params sharing a name.
now, instead of tolerate such a phenomena - emit an appropriate error.
Differential Revision: https://reviews.llvm.org/D31674
llvm-svn: 299815
Mehdi Amini [Sat, 8 Apr 2017 19:20:30 +0000 (19:20 +0000)]
Reorganize libLTO C API header lto.h (NFC)
This just makes it easier to follow the Doxygen blocks
llvm-svn: 299814
Michal Gorny [Sat, 8 Apr 2017 14:38:06 +0000 (14:38 +0000)]
[cmake] Support Gentoo install for z3
Add the 'z3' subdirectory to the list of possible path suffixes for
libz3 header search. The z3 headers are installed in /usr/include/z3
on Gentoo.
Differential Revision: https://reviews.llvm.org/D31756
llvm-svn: 299813
George Rimar [Sat, 8 Apr 2017 06:14:14 +0000 (06:14 +0000)]
[ELF] - Stop producing broken output for R_386_GOT32[X] relocations.
Previously we silently produced broken output for R_386_GOT32X/R_386_GOT32
relocations if they were used to compute the address of the symbol’s global
offset table entry without base register when position-independent code is disabled.
Situation happened because of recent ABI changes. Released ABI mentions that
R_386_GOT32X can be calculated in a two different ways (so we did not follow ABI here
before this patch), but draft ABI also mentions R_386_GOT32 relocation here.
We should use the same calculations for both relocations.
Problem is that we always calculated them as G + A - GOT (offset from end of GOT),
but for case when PIC is disabled, according to i386 ABI calculation should be G + A,
what should produce just an address in GOT finally.
ABI: https://github.com/hjl-tools/x86-psABI/wiki/intel386-psABI-draft.pdf (p36, p60).
llvm-svn: 299812
Craig Topper [Sat, 8 Apr 2017 05:47:09 +0000 (05:47 +0000)]
[IR] Inline Type::getScalarType() by using isVectorTy() and getVectorElementType() that were already available inline.
Seems to have very little compiled code size impact. But might give a tiny performance boost.
llvm-svn: 299811
Balaram Makam [Sat, 8 Apr 2017 03:30:15 +0000 (03:30 +0000)]
[AArch64] Refine Falkor Machine Model - Part 3
This concludes the refinements to Falkor Machine Model.
It includes SchedPredicates for immediate zero and LSL Fast.
Forwarding logic is also modeled for vector multiply and
accumulate only.
llvm-svn: 299810
Gor Nishanov [Sat, 8 Apr 2017 00:49:46 +0000 (00:49 +0000)]
[coroutines] Make CoroSplit pass deterministic
coro-split-after-phi.ll test was flaky due to non-determinism in
the coroutine frame construction that was sorting the spill
vector using a pointer to a def as a part of the key.
The sorting was intended to make sure that spills for the same def
are kept together, however, we populate the vector by processing
defs in order, so the spill entires will end up together anyways.
This change removes spill sorting and restores the determinism
in the test.
llvm-svn: 299809
Gor Nishanov [Sat, 8 Apr 2017 00:16:58 +0000 (00:16 +0000)]
gitignore: Ignore .vs folder (VS2017 config files)
llvm-svn: 299808
Jason Molenda [Fri, 7 Apr 2017 23:20:22 +0000 (23:20 +0000)]
Mark this test as XFAIL on all platforms, it's happening everywhere.
llvm.org/pr32553 and <rdar://problem/
30646077> are tracking this.
llvm-svn: 299807
Evgeniy Stepanov [Fri, 7 Apr 2017 23:00:38 +0000 (23:00 +0000)]
[cfi] Emit __cfi_check stub in the frontend.
Previously __cfi_check was created in LTO optimization pipeline, which
means LLD has no way of knowing about the existence of this symbol
without rescanning the LTO output object. As a result, LLD fails to
export __cfi_check, even when given --export-dynamic-symbol flag.
llvm-svn: 299806
Evgeniy Stepanov [Fri, 7 Apr 2017 23:00:20 +0000 (23:00 +0000)]
[cfi] Take over existing __cfi_check in CrossDSOCFI.
https://reviews.llvm.org/D31796 will emit a dummy __cfi_check in the
frontend.
llvm-svn: 299805
Evgeniy Stepanov [Fri, 7 Apr 2017 22:52:08 +0000 (22:52 +0000)]
[cfi] Accept weak definition of __cfi_check.
https://reviews.llvm.org/D31796 results in LLD emitting __cfi_check
as a weak symbol, while Gold keeps it strong. Accept both.
llvm-svn: 299804
Eli Friedman [Fri, 7 Apr 2017 22:01:23 +0000 (22:01 +0000)]
[ARM] Prefer BIC over BFC in ARM mode.
BIC is generally faster, and it can put the output in a different
register from the input.
We already do this in Thumb2 mode; not sure why the equivalent fix
never got applied to ARM mode.
Differential Revision: https://reviews.llvm.org/D31797
llvm-svn: 299803
Aditya Nandakumar [Fri, 7 Apr 2017 21:49:30 +0000 (21:49 +0000)]
[GlobalISel]: Fix bug where we can report GISelFailure on erased instructions
The original instruction might get legalized and erased and expanded
into intermediate instructions and the intermediate instructions might
fail legalization. This end up in reporting GISelFailure on the erased
instruction.
Instead report GISelFailure on the intermediate instruction which failed
legalization.
Reviewed by: ab
llvm-svn: 299802
Craig Topper [Fri, 7 Apr 2017 21:36:32 +0000 (21:36 +0000)]
[ConstantFolding] Use Intrinsic::not_intrinsic instead of 0 for readability. NFCI
llvm-svn: 299801
Saleem Abdulrasool [Fri, 7 Apr 2017 20:47:06 +0000 (20:47 +0000)]
Toolchains: remove crtbegin on xwindows
crtbegin is not really a proper windows support thing. This was
duplicated when the toolchain was initially built. If the injection of
crtbegin is needed, it can be done via the `/include` directive.
Furthermore, since `-fPIC` doesnt make sense on PE/COFF, crtbegin and
crtbeginS dont really need to be different.
llvm-svn: 299800
Petr Hosek [Fri, 7 Apr 2017 20:41:58 +0000 (20:41 +0000)]
[AArch64] Allow global register asm("x18") or asm("w18") under -ffixed-x18
When using -ffixed-x18, the x18 (or w18) register can safely be used
with the "global register variable" GCC extension, but the backend
fails to recognize it.
Patch by Roland McGrath.
Differential Revision: https://reviews.llvm.org/D31793
llvm-svn: 299799
Petr Hosek [Fri, 7 Apr 2017 20:24:22 +0000 (20:24 +0000)]
Revert "[CMake][libunwind] Use -nodefaultlibs for CMake checks"
This reverts commit r299796.
llvm-svn: 299798
Petr Hosek [Fri, 7 Apr 2017 20:10:41 +0000 (20:10 +0000)]
[CMake][libcxxabi] Use -nodefaultlibs for CMake checks
Since libc++abi is built with -nodefaultlibs, we should be using this
option even for CMake checks to avoid any inconsistency and also to
avoid dependency on a working C++ standard library just for the setting
up the build itself. The implementation is largely similar to the one
used by libc++.
Differential Revision: https://reviews.llvm.org/D31639
llvm-svn: 299797
Petr Hosek [Fri, 7 Apr 2017 20:10:29 +0000 (20:10 +0000)]
[CMake][libunwind] Use -nodefaultlibs for CMake checks
Since libunwind is built with -nodefaultlibs, we should be using this
option even for CMake checks to avoid any inconsistency and also to
avoid dependency on a working C++ standard library just for the setting
up the build itself. The implementation is largely similar to the one
used by libc++.
Differential Revision: https://reviews.llvm.org/D31640
llvm-svn: 299796
Reid Kleckner [Fri, 7 Apr 2017 19:58:33 +0000 (19:58 +0000)]
Remove .rdata section size checks from pdb.test, they are not the same on Windows and Unix
llvm-svn: 299795
Rafael Espindola [Fri, 7 Apr 2017 18:55:03 +0000 (18:55 +0000)]
Use a temp file to avoid Process Substitution.
Thanks to Reid Kleckner for the suggestion.
llvm-svn: 299794
Reid Kleckner [Fri, 7 Apr 2017 18:38:38 +0000 (18:38 +0000)]
[PDB] Re-add RAW FileCheck testing to pdb.test
Update the expected output to match the current llvm-pdbdump raw output.
llvm-svn: 299793
Daniel Berlin [Fri, 7 Apr 2017 18:38:09 +0000 (18:38 +0000)]
NewGVN: Make CongruenceClass a real class in preparation for splitting
NewGVN into analysis and eliminator.
llvm-svn: 299792
Reid Kleckner [Fri, 7 Apr 2017 18:02:53 +0000 (18:02 +0000)]
De-flake a test that is failing due to coroutine spill insertion non-determinism
llvm-svn: 299791
Reid Kleckner [Fri, 7 Apr 2017 17:40:25 +0000 (17:40 +0000)]
[builtins] Remove stray quotes to fix check-builtins on non-Windows :(
llvm-svn: 299790
Davide Italiano [Fri, 7 Apr 2017 17:34:37 +0000 (17:34 +0000)]
[Dominators] Simplify a member function. NFCI.
llvm-svn: 299789
Simon Dardis [Fri, 7 Apr 2017 17:25:05 +0000 (17:25 +0000)]
Revert "[SelectionDAG] Enable target specific vector scalarization of calls and returns"
This reverts commit r299766. This change appears to have broken the MIPS
buildbots. Reverting while I investigate.
Revert "[mips] Remove usage of debug only variable (NFC)"
This reverts commit r299769. Follow up commit.
llvm-svn: 299788
Reid Kleckner [Fri, 7 Apr 2017 17:18:43 +0000 (17:18 +0000)]
[builtins] Make some ISA macro checks work with MSVC
llvm-svn: 299786
Hans Wennborg [Fri, 7 Apr 2017 17:01:56 +0000 (17:01 +0000)]
Attempt to fix ms-intrinsics.c test
llvm-svn: 299785
Reid Kleckner [Fri, 7 Apr 2017 16:54:32 +0000 (16:54 +0000)]
[builtins] Fix MSVC build
Avoid __attribute__((constructor)) in cpu_model.c.
Use more C99 _Complex emulation in divtc3.c. Joerg Sonnenberger added
this builtin just after the last round of C99 _Complex emulation landed
in r249514 (Oct 2015).
llvm-svn: 299784
Kamil Rytarowski [Fri, 7 Apr 2017 16:45:36 +0000 (16:45 +0000)]
Correct environ parsing on NetBSD
Summary:
This replaces old code in Host::GetEnvironment for NetBSD
with the version from Linux. This makes parsing environment
variables correctly. It also fixes programs that depend on the
variables like curses(3) applications.
Long term this function should be moved to Process Plugin,
as currently env variables are not available with remote
debugging.
Other BSDs might want to catch up after this change.
Tested with NetBSD top(1).
Sponsored by <The NetBSD Foundation>
Reviewers: emaste, labath, joerg, kettenis
Reviewed By: emaste
Subscribers: #lldb
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D31784
llvm-svn: 299783
Hans Wennborg [Fri, 7 Apr 2017 16:41:47 +0000 (16:41 +0000)]
Implement _interlockedbittestandset as a builtin
It's used by MS headers in VS 2017 without including intrin.h, so we
can't implement it in the header anymore.
Differential Revision: https://reviews.llvm.org/D31736
llvm-svn: 299782
Ed Maste [Fri, 7 Apr 2017 16:40:25 +0000 (16:40 +0000)]
Correct environ parsing on FreeBSD
Sync Host:GetEnvironment with Linux and Kamil Rytarowski's forthcoming
NetBSD change in review D31784.
llvm-svn: 299781
Reid Kleckner [Fri, 7 Apr 2017 16:35:09 +0000 (16:35 +0000)]
[builtins] Get the builtins tests passing on Windows
Many things were broken:
- We stopped building most builtins on Windows in r261432 for reasons
that are not at all clear to me. This essentially reverts that patch.
- Fix %librt to expand to clang_rt.builtins-$arch.lib on Windows instead
of libclang_rt.builtins-$arch.a.
- Fix memory protection tests (trampoline, enable executable, clear
cache) on Windows. One issue was that the MSVC incremental linker
generates ILT thunks for functions with external linkage, so memcpying
the functions into the executable stack buffer wasn't working. You
can't memcpy an RIP-relative jump without fixing up the offset.
- Disable tests that rely on C99 complex library functions when using
the MSVC CRT, which isn't compatible with clang's C99 _Complex.
In theory, these could all be separate patches, but it would not green
the tests, so let's try for it all at once. Hopefully this fixes the
clang-x64-ninja-win7 bot.
llvm-svn: 299780
Stanislav Mekhanoshin [Fri, 7 Apr 2017 16:26:28 +0000 (16:26 +0000)]
[AMDGPU] Unroll more to eliminate phis and conditions
Increase threshold to unroll a loop which contains an "if" statement
whose condition defined by a PHI belonging to the loop. This may help
to eliminate if region and potentially even PHI itself, saving on
both divergence and registers used for the PHI.
Add a small bonus for each of such "if" statements.
Differential Revision: https://reviews.llvm.org/D31693
llvm-svn: 299779
Rafael Espindola [Fri, 7 Apr 2017 16:10:46 +0000 (16:10 +0000)]
Simplify this further.
Thanks to Rui for noticing it.
llvm-svn: 299777
Dehao Chen [Fri, 7 Apr 2017 15:41:52 +0000 (15:41 +0000)]
Use PMADDWD to expand reduction in a loop
Summary:
PMADDWD can help improve 8/16 bit integer mutliply-add operation performance for cases like:
for (int i = 0; i < count; i++)
a += x[i] * y[i];
Reviewers: wmi, davidxl, hfinkel, RKSimon, zvi, mkuper
Reviewed By: mkuper
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31679
llvm-svn: 299776
Reid Kleckner [Fri, 7 Apr 2017 15:28:32 +0000 (15:28 +0000)]
[lit] Try using process pools by default again
Both pickling errors encountered on clang bots and Darwin compiler-rt
should now be fixed.
This has no impact on testing time on Linux, and on Windows goes from
88s to 63s for 'check'. The tests pass on Mac, but I haven't compared
execution time.
llvm-svn: 299775
Saleem Abdulrasool [Fri, 7 Apr 2017 15:13:47 +0000 (15:13 +0000)]
Sema: prevent __declspec(naked) use on x64
MSDN (https://msdn.microsoft.com/en-us/library/h5w10wxs.aspx) indicates
that `__declspec(naked)` is only permitted on x86 and ARM targets.
Testing with cl does confirm this behaviour. Provide a warning for use
of `__declspec(naked)` on x64.
llvm-svn: 299774
Simon Atanasyan [Fri, 7 Apr 2017 15:05:44 +0000 (15:05 +0000)]
[ELF] Do not pass GOT section as an argument to handleARMTlsRelocation and handleMipsTlsRelocation functions. NFC
Both functions always use the same GOT sections In<ELFT>::Got and
In<ELFT>::MipsGot respectively, so we do not need to pass them as an
argument.
llvm-svn: 299773
Igor Breger [Fri, 7 Apr 2017 14:41:59 +0000 (14:41 +0000)]
[GlobalISel] implement narrowing for G_CONSTANT.
Summary: [GlobalISel] implement narrowing for G_CONSTANT.
Reviewers: bogner, zvi, t.p.northover
Reviewed By: t.p.northover
Subscribers: llvm-commits, dberris, rovka, kristof.beyls
Differential Revision: https://reviews.llvm.org/D31744
llvm-svn: 299772
Gor Nishanov [Fri, 7 Apr 2017 14:16:49 +0000 (14:16 +0000)]
[coroutines] Insert spills of PHI instructions correctly
Summary:
Fix a bug where we were inserting a spill in between the PHIs in the beginning of the block.
Consider this fragment:
```
begin:
%phi1 = phi i32 [ 0, %entry ], [ 2, %alt ]
%phi2 = phi i32 [ 1, %entry ], [ 3, %alt ]
%sp1 = call i8 @llvm.coro.suspend(token none, i1 false)
switch i8 %sp1, label %suspend [i8 0, label %resume
i8 1, label %cleanup]
resume:
call i32 @print(i32 %phi1)
```
Unless we are spilling the argument or result of the invoke, we were always inserting the spill immediately following the instruction.
The fix adds a check that if the spilled instruction is a PHI Node, select an appropriate insert point with `getFirstInsertionPt()` that
skips all the PHI Nodes and EH pads.
Reviewers: majnemer, rnk
Reviewed By: rnk
Subscribers: qcolombet, EricWF, llvm-commits
Differential Revision: https://reviews.llvm.org/D31799
llvm-svn: 299771
Matthew Simpson [Fri, 7 Apr 2017 14:15:34 +0000 (14:15 +0000)]
Reapply r298620: [LV] Vectorize GEPs
This patch reapplies r298620. The original patch was reverted because of two
issues. First, the patch exposed a bug in InstCombine that caused the Chromium
builds to fail (PR32414). This issue was fixed in r299017. Second, the patch
introduced a bug in the vectorizer's scalars analysis that caused test suite
builds to fail on SystemZ. The scalars analysis was too aggressive and marked a
memory instruction scalar, even though it was going to be vectorized. This
issue has been fixed in the current patch and several new test cases for the
scalars analysis have been added.
llvm-svn: 299770
Simon Dardis [Fri, 7 Apr 2017 13:49:12 +0000 (13:49 +0000)]
[mips] Remove usage of debug only variable (NFC)
Fix the lld-x86_64-darwin13 buildbot by removing the declaration of a
debug only variable and instead moving the value into the debug statement.
llvm-svn: 299769
Petar Jovanovic [Fri, 7 Apr 2017 13:31:36 +0000 (13:31 +0000)]
[mips][msa] Fix generation of bm(n)zi and bins[lr]i instructions
We have two cases here, the first one being the following instruction
selection from the builtin function:
bm(n)zi builtin -> vselect node -> bins[lr]i machine instruction
In case of bm(n)zi having an immediate which has either its high or low bits
set, a bins[lr] instruction can be selected through the selectVSplatMask[LR]
function. The function counts the number of bits set, and that value is
being passed to the bins[lr]i instruction as its immediate, which in turn
copies immediate modulo the size of the element in bits plus 1 as per specs,
where we get the off-by-one-error.
The other case is:
bins[lr]i -> vselect node -> bsel.v
In this case, a bsel.v instruction gets selected with a mask having one bit
less set than required.
Patch by Stefan Maksimovic.
Differential Revision: https://reviews.llvm.org/D30579
llvm-svn: 299768
Dmitry Preobrazhensky [Fri, 7 Apr 2017 13:07:13 +0000 (13:07 +0000)]
[AMDGPU][MC] Fix for Bug 28211 + LIT tests
- corrected DS_GWS_* opcodes (see VI_Shader_Programming#16.pdf for detailed description)
- address operand is not used
- several opcodes have data operand
- all opcodes have offset modifier
- DS_AND_SRC2_B32: corrected typo in mnemo
- DS_WRAP_RTN_F32 replaced with DS_WRAP_RTN_B32
- added CI/VI opcodes:
- DS_CONDXCHG32_RTN_B64
- DS_GWS_SEMA_RELEASE_ALL
- added VI opcodes:
- DS_CONSUME
- DS_APPEND
- DS_ORDERED_COUNT
Differential Revision: https://reviews.llvm.org/D31707
llvm-svn: 299767
Simon Dardis [Fri, 7 Apr 2017 13:03:52 +0000 (13:03 +0000)]
[SelectionDAG] Enable target specific vector scalarization of calls and returns
By target hookifying getRegisterType, getNumRegisters, getVectorBreakdown,
backends can request that LLVM to scalarize vector types for calls
and returns.
The MIPS vector ABI requires that vector arguments and returns are passed in
integer registers. With SelectionDAG's new hooks, the MIPS backend can now
handle LLVM-IR with vector types in calls and returns. E.g.
'call @foo(<4 x i32> %4)'.
Previously these cases would be scalarized for the MIPS O32/N32/N64 ABI for
calls and returns if vector types were not legal. If vector types were legal,
a single 128bit vector argument would be assigned to a single 32 bit / 64 bit
integer register.
By teaching the MIPS backend to inspect the original types, it can now
implement the MIPS vector ABI which requires a particular method of
scalarizing vectors.
Previously, the MIPS backend relied on clang to scalarize types such as "call
@foo(<4 x float> %a) into "call @foo(i32 inreg %1, i32 inreg %2, i32 inreg %3,
i32 inreg %4)".
This patch enables the MIPS backend to take either form for vector types.
Reviewers: zoran.jovanovic, jaydeep, vkalintiris, slthakur
Differential Revision: https://reviews.llvm.org/D27845
llvm-svn: 299766
Philip Pfaffe [Fri, 7 Apr 2017 12:55:26 +0000 (12:55 +0000)]
Fix missing .git/indexloadPolly in ensure-correct-tile-sizes testcase
llvm-svn: 299765
Haojian Wu [Fri, 7 Apr 2017 12:37:32 +0000 (12:37 +0000)]
Fix compiler warnings: "ISO c99 requires rest arguments to be used" on
the test file.
llvm-svn: 299764
Jonas Paulsson [Fri, 7 Apr 2017 12:35:11 +0000 (12:35 +0000)]
[SystemZ] Check for presence of vector support in SystemZISelLowering
A test case was found with llvm-stress that caused DAGCombiner to crash
when compiling for an older subtarget without vector support.
SystemZTargetLowering::combineTruncateExtract() should do nothing for older
subtargets.
This check was placed in canTreatAsByteVector(), which also helps in a few
other places.
Review: Ulrich Weigand
llvm-svn: 299763
Jonas Paulsson [Fri, 7 Apr 2017 12:11:41 +0000 (12:11 +0000)]
[SystemZ] Remove confusing comment in combineEXTRACT_VECTOR_ELT()
It isn't just one-element vectors that can appear here.
llvm-svn: 299762