Eric Fiselier [Wed, 10 May 2017 08:04:50 +0000 (08:04 +0000)]
Attempt to speculatively unbreak Apple build bots
llvm-svn: 302627
Craig Topper [Wed, 10 May 2017 07:50:17 +0000 (07:50 +0000)]
[APInt] Fix indentation of tcDivide. Combine variable declaration and initialization.
llvm-svn: 302626
Craig Topper [Wed, 10 May 2017 07:50:15 +0000 (07:50 +0000)]
[APInt] Use getNumWords function in udiv/urem/udivrem instead of reimplementinging it.
llvm-svn: 302625
Eric Liu [Wed, 10 May 2017 07:48:45 +0000 (07:48 +0000)]
Add ASTMatchRefactorer and ReplaceNodeWithTemplate to RefactoringCallbacks
Summary: This is the first change as part of developing a clang-query based search and replace tool.
Reviewers: klimek, bkramer, ioeric, sbenza, jbangert
Reviewed By: ioeric, jbangert
Subscribers: sbenza, ioeric, cfe-commits
Patch by Julian Bangert!
Differential Revision: https://reviews.llvm.org/D29621
llvm-svn: 302624
Igor Breger [Wed, 10 May 2017 06:52:58 +0000 (06:52 +0000)]
[GlobalISel][X86] G_ZEXT i1 to i32/i64 support.
Summary: Support G_ZEXT i1 to i32/i64 instruction selection.
Reviewers: zvi, guyblank
Reviewed By: guyblank
Subscribers: rovka, llvm-commits, kristof.beyls
Differential Revision: https://reviews.llvm.org/D32965
llvm-svn: 302623
Mikael Holmen [Wed, 10 May 2017 06:33:43 +0000 (06:33 +0000)]
[UnreachableBlockElim] Check return value of constrainRegClass().
Summary:
MachineRegisterInfo::constrainRegClass() can fail if two register classes
don't have a common subclass or if the register class doesn't contain
enough registers. Check the return value before trying to remove Phi nodes,
and if we can't constrain, we output a COPY instead of simply replacing
registers.
Reviewers: kparzysz, david2050, wmi
Reviewed By: kparzysz
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32999
llvm-svn: 302622
Tobias Grosser [Wed, 10 May 2017 05:20:56 +0000 (05:20 +0000)]
Add noreturn attribute to avoid warnings about missing initialization
Before this change we saw warnings such as:
tools/GPURuntime/GPUJIT.c:1566:3:
warning: variable 'DevPtr' is used uninitialized whenever switch default is
taken [-Wsometimes-uninitialized]
default:
llvm-svn: 302621
Tobias Grosser [Wed, 10 May 2017 04:53:59 +0000 (04:53 +0000)]
Fix formatting in Polly
llvm-svn: 302620
Eric Fiselier [Wed, 10 May 2017 02:43:02 +0000 (02:43 +0000)]
Rename Appveyor install helper script.
I'm really lazy and the old name for the helper script
killed 2 letter tab completion for the include directory.
This patch renames it to avoid that problem and enable
lazyness.
llvm-svn: 302619
Chandler Carruth [Wed, 10 May 2017 02:39:35 +0000 (02:39 +0000)]
Update Polly for LLVM API change r302571 that removed varargs functions
with a nullptr sentinel in favor of nicely typed variadic templates.
llvm-svn: 302618
Eric Fiselier [Wed, 10 May 2017 02:36:48 +0000 (02:36 +0000)]
Support using MinGW POSIX threads on Windows
llvm-svn: 302617
Eric Fiselier [Wed, 10 May 2017 02:34:56 +0000 (02:34 +0000)]
attempt to fix appveyor syntax error
llvm-svn: 302616
Richard Smith [Wed, 10 May 2017 02:30:28 +0000 (02:30 +0000)]
When we see a '<' operator, check whether it's a probable typo for a template-id.
The heuristic that we use here is:
* the left-hand side must be a simple identifier or a class member access
* the right-hand side must be '<' followed by either a '>' or by a type-id that
cannot be an expression (in particular, not followed by '(' or '{')
* there is a '>' token matching the '<' token
The second condition guarantees the expression would otherwise be ill-formed.
If we're confident that the user intended the name before the '<' to be
interpreted as a template, diagnose the fact that we didn't interpret it
that way, rather than diagnosing that the template arguments are not valid
expressions.
llvm-svn: 302615
Eric Fiselier [Wed, 10 May 2017 02:30:16 +0000 (02:30 +0000)]
Add MinGW64 builder to Appveyor.
With the amount of work happening on Windows we should
have a MinGW bot to make sure we don't regress that functionality.
Currently it doesn't build :-(
llvm-svn: 302614
Zachary Turner [Wed, 10 May 2017 01:16:22 +0000 (01:16 +0000)]
[Core] Make parallel algorithms match C++ Parallelism TS.
Differential Revision: https://reviews.llvm.org/D33016
llvm-svn: 302613
Ahmed Bougacha [Wed, 10 May 2017 00:56:00 +0000 (00:56 +0000)]
[CodeGen] Don't require AA in TwoAddress at -O0.
This is a follow-up to r302611, which moved an -O0 computation of DT
from SDAGISel to TwoAddress.
Don't use it here either, and avoid computing it completely. The only
use was forwarding the analysis as an optional argument to utility
functions.
Differential Revision: https://reviews.llvm.org/D32766
llvm-svn: 302612
Ahmed Bougacha [Wed, 10 May 2017 00:39:30 +0000 (00:39 +0000)]
[CodeGen] Don't require AA in SDAGISel at -O0.
Before r247167, the pass manager builder controlled which AA
implementations were used, exporting them all in the AliasAnalysis
analysis group.
Now, AAResultsWrapperPass always uses BasicAA, but still uses other AA
implementations if made available in the pass pipeline.
But regardless, SDAGISel is required at O0, and really doesn't need to
be doing fancy optimizations based on useful AA results.
Don't require AA at CodeGenOpt::None, and only use it otherwise.
This does have a functional impact (and one testcase is pessimized
because we can't reuse a load). But I think that's desirable no matter
what.
Note that this alone doesn't result in less DT computations: TwoAddress
was previously able to reuse the DT we computed for SDAG. That will be
fixed separately.
Differential Revision: https://reviews.llvm.org/D32766
llvm-svn: 302611
Ahmed Bougacha [Wed, 10 May 2017 00:39:25 +0000 (00:39 +0000)]
[CodeGen] Compute DT/LI lazily in SafeStackLegacyPass. NFC.
We currently require SCEV, which requires DT/LI. Those are expensive to
compute, but the pass only runs for functions that have the safestack
attribute.
Compute DT/LI to build SCEV lazily, only when the pass is actually going
to transform the function.
Differential Revision: https://reviews.llvm.org/D31302
llvm-svn: 302610
Ahmed Bougacha [Wed, 10 May 2017 00:39:22 +0000 (00:39 +0000)]
[CodeGen] Split SafeStack into a LegacyPass and a utility. NFC.
This lets the pass focus on gathering the required analyzes, and the
utility class focus on the transformation.
Differential Revision: https://reviews.llvm.org/D31303
llvm-svn: 302609
Ahmed Bougacha [Wed, 10 May 2017 00:39:17 +0000 (00:39 +0000)]
[CodeGen] Add an -O0 backend pipeline test. NFC.
This should hopefully makes changes to the O0 pipeline obvious; it's
easy to require expensive passes, and this helps make informed
decisions.
Case in point: in the few weeks separating the time when I initially
wrote this patch to the time when I committed, the test regressed as
r302103 added another use of DT!
llvm-svn: 302608
Eric Fiselier [Wed, 10 May 2017 00:23:58 +0000 (00:23 +0000)]
Improve how LIT reports the added environment variables
llvm-svn: 302607
Sam Clegg [Wed, 10 May 2017 00:14:04 +0000 (00:14 +0000)]
[WebAssembly] Fix build error in wasm YAML code
This warning didn't show up on my local build
but is causing the bots to fail. Seems like a
bad idea to have types and variables with the
same name anyhow.
Differential Revision: https://reviews.llvm.org/D33022
llvm-svn: 302606
Sanjay Patel [Wed, 10 May 2017 00:07:16 +0000 (00:07 +0000)]
[InstCombine] add helper function for add X, C folds; NFCI
llvm-svn: 302605
Eric Fiselier [Wed, 10 May 2017 00:05:04 +0000 (00:05 +0000)]
Attempt to unbreak Libc++ test configuration
llvm-svn: 302604
Richard Smith [Wed, 10 May 2017 00:01:13 +0000 (00:01 +0000)]
When instantiating a friend function template, don't forget to inherit default template arguments from other declarations.
llvm-svn: 302603
Eric Fiselier [Tue, 9 May 2017 23:57:22 +0000 (23:57 +0000)]
Fix test runtime environment on Windows
llvm-svn: 302602
Sam Clegg [Tue, 9 May 2017 23:48:41 +0000 (23:48 +0000)]
[WebAssembly] Improve libObject support for wasm imports and exports
Previously we had only supported the importing and
exporting of functions and globals.
Also, add usefull overload of getWasmSymbol() and
getNumberOfSymbols() in support of lld port.
Differential Revision: https://reviews.llvm.org/D33011
llvm-svn: 302601
Eric Fiselier [Tue, 9 May 2017 23:47:20 +0000 (23:47 +0000)]
Fix misspelling of environment throughout libc++
llvm-svn: 302600
Sanjay Patel [Tue, 9 May 2017 23:40:13 +0000 (23:40 +0000)]
[InstCombine] add tests for andn; NFC
llvm-svn: 302599
Vedant Kumar [Tue, 9 May 2017 23:34:49 +0000 (23:34 +0000)]
[ubsan] Mark overflow checks with !nosanitize
Sanitizer instrumentation generally needs to be marked with !nosanitize,
but we're not doing this properly for ubsan's overflow checks.
r213291 has more information about why this is needed.
llvm-svn: 302598
Easwaran Raman [Tue, 9 May 2017 23:21:10 +0000 (23:21 +0000)]
[ProfileSummary] Make getProfileCount a non-static member function.
This change is required because the notion of count is different for
sample profiling and getProfileCount will need to determine the
underlying profile type.
Differential revision: https://reviews.llvm.org/D33012
llvm-svn: 302597
Richard Smith [Tue, 9 May 2017 23:02:10 +0000 (23:02 +0000)]
Don't mark a member as a member specialization until we know we're keeping the specialization.
This improves our behavior in a few ways:
* We now guarantee that if a member is marked as being a member
specialization, there will actually be a member specialization declaration
somewhere on its redeclaration chain. This fixes a crash in modules builds
where we would try to check that there was a visible declaration of the
member specialization and be surprised to not find any declaration of it at
all.
* We don't set the source location of the in-class declaration of the member
specialization to the out-of-line declaration's location until we have
actually finished merging them. This fixes some very silly looking
diagnostics, where we'd point a "previous declaration is here" note at the
same declaration we're complaining about. Ideally we wouldn't mess with the
prior declaration's location at all, but too much code assumes that the
first declaration of an entity is a reasonable thing to use as an indication
of where it was declared, and that's not really true for a member
specialization unless we fake it like this.
llvm-svn: 302596
Peter Collingbourne [Tue, 9 May 2017 22:43:31 +0000 (22:43 +0000)]
FunctionImport: Simplify function llvm::thinLTOInternalizeModule. NFCI.
llvm-svn: 302595
Evgeniy Stepanov [Tue, 9 May 2017 22:28:57 +0000 (22:28 +0000)]
Fix clang_cl argument in fsanitize.c driver test.
llvm-svn: 302594
Eric Fiselier [Tue, 9 May 2017 22:21:24 +0000 (22:21 +0000)]
[Sema] Implement Core 2094: Trivial copy/move constructor for class with volatile member
Summary: This patch implements http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#2094 which reverts Core 496.
Reviewers: rsmith
Reviewed By: rsmith
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D32984
llvm-svn: 302593
Eric Fiselier [Tue, 9 May 2017 22:17:23 +0000 (22:17 +0000)]
Update Clang C++ DR documentation for new issue list
llvm-svn: 302592
Evgeniy Stepanov [Tue, 9 May 2017 21:57:43 +0000 (21:57 +0000)]
[asan] A clang flag to enable ELF globals-gc.
This feature is subtly broken when the linker is gold 2.26 or
earlier. See the following bug for details:
https://sourceware.org/bugzilla/show_bug.cgi?id=19002
Since the decision needs to be made at compilation time, we can not
test the linker version. The flag is off by default on ELF targets,
and on otherwise.
llvm-svn: 302591
Evgeniy Stepanov [Tue, 9 May 2017 21:57:39 +0000 (21:57 +0000)]
Remove unnecessary calls to MakeArgString.
llvm-svn: 302590
Lang Hames [Tue, 9 May 2017 21:32:18 +0000 (21:32 +0000)]
[ExecutionEngine] Make RuntimeDyld::MemoryManager responsible for tracking EH
frames.
RuntimeDyld was previously responsible for tracking allocated EH frames, but it
makes more sense to have the RuntimeDyld::MemoryManager track them (since the
frames are allocated through the memory manager, and written to memory owned by
the memory manager). This patch moves the frame tracking into
RTDyldMemoryManager, and changes the deregisterFrames method on
RuntimeDyld::MemoryManager from:
void deregisterEHFrames(uint8_t *Addr, uint64_t LoadAddr, size_t Size);
to:
void deregisterEHFrames();
Separating this responsibility will allow ORC to continue to throw the
RuntimeDyld instances away post-link (saving a few dozen bytes per lazy
function) while properly deregistering frames when modules are unloaded.
This patch also updates ORC to call deregisterEHFrames when modules are
unloaded. This fixes a bug where an exception that tears down the JIT can then
unwind through dangling EH frames that have been deallocated but not
deregistered, resulting in UB.
For people using SectionMemoryManager this should be pretty much a no-op. For
people with custom allocators that override registerEHFrames/deregisterEHFrames,
you will now be responsible for tracking allocated EH frames.
Reviewed in https://reviews.llvm.org/D32829
llvm-svn: 302589
Serge Guelton [Tue, 9 May 2017 21:19:44 +0000 (21:19 +0000)]
Fix CGObjCGNU::init bug introduced by r302572
llvm-svn: 302588
Keno Fischer [Tue, 9 May 2017 21:07:20 +0000 (21:07 +0000)]
[GVN] Fix a crash on encountering non-integral pointers
Summary:
This fixes the immediate crash caused by introducing an incorrect inttoptr
before attempting the conversion. There may still be a legality
check missing somewhere earlier for non-integral pointers, but this change
seems necessary in any case.
Reviewers: sanjoy, dberlin
Reviewed By: dberlin
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32623
llvm-svn: 302587
Stanislav Mekhanoshin [Tue, 9 May 2017 20:50:04 +0000 (20:50 +0000)]
[AMDGPU] Fixed typo in GCNRegPressure, NFC
VGRP -> VGPR, SGRP -> SGPR
llvm-svn: 302586
Sanjay Patel [Tue, 9 May 2017 20:46:12 +0000 (20:46 +0000)]
[InstCombine] update test file to use FileCheck; NFC
llvm-svn: 302585
Lang Hames [Tue, 9 May 2017 20:37:01 +0000 (20:37 +0000)]
Import sys in repo.py.
The find function in repo.py calls sys.exit on error. Without this import that
call to exit will fail, masking the actual error message. This patch fixes that.
llvm-svn: 302584
Zvi Rackover [Tue, 9 May 2017 20:25:38 +0000 (20:25 +0000)]
DAGCombine: Combine shuffles of splat-shuffles
Summary: Reapply r299047, but this time handle correctly splat-masks with undef elements.
Reviewers: spatel, RKSimon, eli.friedman, andreadb
Reviewed By: spatel
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31961
llvm-svn: 302583
Matthew Simpson [Tue, 9 May 2017 20:18:12 +0000 (20:18 +0000)]
[AArch64] Consider widening instructions in cost calculations
The AArch64 instruction set has a few "widening" instructions (e.g., uaddl,
saddl, uaddw, etc.) that take one or more doubleword operands and produce
quadword results. The operands are automatically sign- or zero-extended as
appropriate. However, in LLVM IR, these extends are explicit. This patch
updates TTI to consider these widening instructions as single operations whose
cost is attached to the arithmetic instruction. It marks extends that are part
of a widening operation "free" and applies a sub-target specified overhead
(zero by default) to the arithmetic instructions.
Differential Revision: https://reviews.llvm.org/D32706
llvm-svn: 302582
Sanjay Patel [Tue, 9 May 2017 20:05:05 +0000 (20:05 +0000)]
[InstCombine] clean up matchDeMorgansLaws(); NFCI
The motivation for getting rid of dyn_castNotVal is to allow fixing:
https://bugs.llvm.org/show_bug.cgi?id=32706
So this was supposed to be functional-change-intended for the case
of inverting constants and applying DeMorgan. However, I can't find
any cases where that pattern will actually get to matchDeMorgansLaws()
because we have other folds in visitAnd/visitOr that do the same
thing. So this ends up just being a clean-up patch with slight efficiency
improvement, but no-functional-change-intended.
llvm-svn: 302581
Martin Probst [Tue, 9 May 2017 20:04:09 +0000 (20:04 +0000)]
clang-format: [JS] Don't indent JavaScript IIFEs.
Because IIFEs[1] are often used like an anonymous namespace around large
sections of JavaScript code, it's useful not to indent to them (which
effectively reduces the column limit by the indent amount needlessly).
It's also common for developers to wrap these around entire files or
libraries. When adopting clang-format, changing the indent entire file
can reduce the usefulness of the blame annotations.
Patch by danbeam, thanks!
Differential Revision: https://reviews.llvm.org/D32989
llvm-svn: 302580
Davide Italiano [Tue, 9 May 2017 20:02:48 +0000 (20:02 +0000)]
[NewGVN] Simplify a DEBUG() statement. NFCI.
llvm-svn: 302579
Reid Kleckner [Tue, 9 May 2017 19:59:29 +0000 (19:59 +0000)]
[codeview] Check for a DIExpression offset for local variables
Fixes inalloca parameters, which previously all pointed to the same
offset. Extend the test to use llvm-readobj so that we can test the
offset in a readable way.
llvm-svn: 302578
Adrian Prantl [Tue, 9 May 2017 19:47:41 +0000 (19:47 +0000)]
Update testcase for upstream LLVM changes (r302469).
llvm-svn: 302577
Adrian Prantl [Tue, 9 May 2017 19:47:37 +0000 (19:47 +0000)]
Make it illegal for two Functions to point to the same DISubprogram
As recently discussed on llvm-dev [1], this patch makes it illegal for
two Functions to point to the same DISubprogram and updates
FunctionCloner to also clone the debug info of a function to conform
to the new requirement. To simplify the implementation it also factors
out the creation of inlineAt locations from the Inliner into a
general-purpose utility in DILocation.
[1] http://lists.llvm.org/pipermail/llvm-dev/2017-May/112661.html
<rdar://problem/
31926379>
Differential Revision: https://reviews.llvm.org/D32975
This reapplies r302469 with a fix for a bot failure (reparentDebugInfo
now checks for the case the orig and new function are identical).
llvm-svn: 302576
Piotr Padlewski [Tue, 9 May 2017 19:39:44 +0000 (19:39 +0000)]
NFC: refactor replaceDominatedUsesWith
Summary:
Since I will post patch with some changes to
replaceDominatedUsesWith, it would be good to avoid
duplicating code again.
Reviewers: davide, dberlin
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32798
llvm-svn: 302575
Wolfgang Pieb [Tue, 9 May 2017 19:38:38 +0000 (19:38 +0000)]
[DWARF] Fix a parsing issue with type unit headers.
Reviewers: dblaikie
Differential Revision: https://reviews.llvm.org/D32987
llvm-svn: 302574
Eric Beckmann [Tue, 9 May 2017 19:35:45 +0000 (19:35 +0000)]
Fix the Endianness bug by adding the little endian UTF marker.
Summary: Quick fix
Reviewers: zturner, uweigand
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D33014
llvm-svn: 302573
Serge Guelton [Tue, 9 May 2017 19:31:30 +0000 (19:31 +0000)]
Suppress all uses of LLVM_END_WITH_NULL. NFC.
Use variadic templates instead of relying on <cstdarg> + sentinel.
This enforces better type checking and makes code more readable.
Differential revision: https://reviews.llvm.org/D32550
llvm-svn: 302572
Serge Guelton [Tue, 9 May 2017 19:31:13 +0000 (19:31 +0000)]
Suppress all uses of LLVM_END_WITH_NULL. NFC.
Use variadic templates instead of relying on <cstdarg> + sentinel.
This enforces better type checking and makes code more readable.
Differential Revision: https://reviews.llvm.org/D32541
llvm-svn: 302571
Simon Dardis [Tue, 9 May 2017 19:17:16 +0000 (19:17 +0000)]
[mips] XFAIL dfsan's custom.cc test on mips64.
Test was already marked as failing for mips64el. Now that it's being
tested on mips64, it has to be XFAILed there as well.
llvm-svn: 302570
Sam Clegg [Tue, 9 May 2017 18:44:23 +0000 (18:44 +0000)]
[WebAssembly] Fix failing wasm-toolchain test
This test was broken in r302558.
Differential Revision: https://reviews.llvm.org/D33015
llvm-svn: 302569
Jacques Pienaar [Tue, 9 May 2017 18:35:26 +0000 (18:35 +0000)]
[lanai] Add computeKnownBitsForTargetNode for Lanai.
Summary: computeKnownBitsForTargetNode was not defined for Lanai which resulted in additional AND's with 0x1 for the output of SETCC instructions.
Reviewers: eliben, majnemer
Reviewed By: majnemer
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D29605
llvm-svn: 302568
Simon Dardis [Tue, 9 May 2017 18:29:44 +0000 (18:29 +0000)]
[mips] Remove XFAIL from sanitizer_coverage_no_prune.cc
Test is XPASSing, so remove the XFAIL marker.
llvm-svn: 302567
Davide Italiano [Tue, 9 May 2017 18:29:37 +0000 (18:29 +0000)]
[NewGVN] Explain why sorting by pointer values doesn't introduce non-determinism.
Thanks to Eli for pointing out in a post-commit review comment.
llvm-svn: 302566
Ulrich Weigand [Tue, 9 May 2017 18:27:39 +0000 (18:27 +0000)]
[SystemZ] Support missing relocation types in RuntimeDyldELF
Handle some more relocation types in
RuntimeDyldELF::resolveSystemZRelocation
This fixes a number of failing LLDB test cases.
llvm-svn: 302565
Rui Ueyama [Tue, 9 May 2017 18:24:38 +0000 (18:24 +0000)]
Add memory ORIGIN and LENGTH expression support
Adds support for the ORIGIN and LENGTH linker script built in functions.
ORIGIN(memory) Return the origin of the memory region
LENGTH(memory) Return the length of the memory region
Redo of D29775 for refactored linker script parsing.
Patch by Robert Clarke
Differential Revision: https://reviews.llvm.org/D32934
llvm-svn: 302564
Ulrich Weigand [Tue, 9 May 2017 18:17:26 +0000 (18:17 +0000)]
[SystemZ] Remove XFAIL on sanitizer_coverage_no_prune.cc
This test case works fine on SystemZ as well.
llvm-svn: 302563
Ulrich Weigand [Tue, 9 May 2017 18:07:50 +0000 (18:07 +0000)]
[SystemZ] Fix failures after D32542
This commit made ubsan use the fast unwinder. On SystemZ this requires
test cases to be compiled with -mbackchain. That was already done for
asan, but not ubsan. Add the flag for ubsan as well.
llvm-svn: 302562
Simon Dardis [Tue, 9 May 2017 17:58:33 +0000 (17:58 +0000)]
[compiler-rt][mips] Fix a test for mips.
GCC 4.9.2 likes the specialize one of the memcpys in msan_interceptors.cc,
leading to test failure.
llvm-svn: 302561
Sam Clegg [Tue, 9 May 2017 17:51:38 +0000 (17:51 +0000)]
[WebAssembly] Fix validation of start function
The check for valid start function was inverted. Added a new
test in test/Object to check this case and fixed the existing
tests in for ObjectYAML.
Differential Revision: https://reviews.llvm.org/D32986
llvm-svn: 302560
Simon Pilgrim [Tue, 9 May 2017 17:50:16 +0000 (17:50 +0000)]
[X86][LWP] Remove MSVC LWP intrinsics stubs.
Now provided in lwpintrin.h
llvm-svn: 302559
Sam Clegg [Tue, 9 May 2017 17:47:50 +0000 (17:47 +0000)]
[WebAssembly] Fix location and -flavor when running lld
Add the toolchain installation directory to the program
path so that lld can be found.
Change -flavor to wasm. Although this new flavor hasn't
yet landed in upstream lld yet there are no point in
passing wasm objects the gnu flavor.
Differential Revision: https://reviews.llvm.org/D32976
llvm-svn: 302558
Simon Pilgrim [Tue, 9 May 2017 17:43:16 +0000 (17:43 +0000)]
[X86][LWP] Removing LWP todo comment. NFCI.
LWP / lwpintrin.h is now supported
llvm-svn: 302557
Adrian Prantl [Tue, 9 May 2017 17:27:03 +0000 (17:27 +0000)]
Build the Apple-style stage2 with modules
Green dragon had a green stage2 modules bot for a long time now[1] and
it is time to retire it and make a modules build the default for
Apple-style stage2 builds.
This patch turns on LLVM_ENABLE_MODULES.
[1] http://green.lab.llvm.org/green/job/clang-stage2-cmake-modulesRDA_build/
rdar://problem/
28672159
Differential Revision: https://reviews.llvm.org/D32603
llvm-svn: 302556
Petar Jovanovic [Tue, 9 May 2017 17:20:06 +0000 (17:20 +0000)]
Revert r302547 ([mips] Impose a threshold for coercion of aggregates)
Reverting
Modified MipsABIInfo::classifyArgumentType so that it now coerces
aggregate structures only if the size of said aggregate is less than 16/64
bytes, depending on the ABI.
as it broke clang-with-lto-ubuntu builder.
llvm-svn: 302555
Krzysztof Parzyszek [Tue, 9 May 2017 17:16:52 +0000 (17:16 +0000)]
[RegScavenger] Rangify a loop, NFC
llvm-svn: 302554
Puyan Lotfi [Tue, 9 May 2017 17:13:37 +0000 (17:13 +0000)]
Adding VSCode syntax colorizer to utils (generated from textmate colorizer).
--This line, and those below, will be igored--
A utils/vscode
A utils/vscode/README
A utils/vscode/tablegen
A utils/vscode/tablegen/.vscode
A utils/vscode/tablegen/.vscode/launch.json
A utils/vscode/tablegen/CHANGELOG.md
A utils/vscode/tablegen/README.md
A utils/vscode/tablegen/language-configuration.json
A utils/vscode/tablegen/package.json
A utils/vscode/tablegen/syntaxes
A utils/vscode/tablegen/syntaxes/TableGen.tmLanguage
A utils/vscode/tablegen/vsc-extension-quickstart.md
llvm-svn: 302553
Davide Italiano [Tue, 9 May 2017 16:58:28 +0000 (16:58 +0000)]
[NewGVN] Fix a consistent order for phi nodes operands.
The way we currently define congruency for two PHIExpression(s) is:
1) The operands to the phi functions are congruent
2) The PHIs are defined in the same BasicBlock.
NewGVN works under the assumption that phi operands are in predecessor
order, or at least in some consistent order. OTOH, is valid IR:
patatino:
%meh = phi i16 [ %0, %winky ], [ %conv1, %tinky ]
%banana = phi i16 [ %0, %tinky ], [ %conv1, %winky ]
br label %end
and the in-memory representations of the two SSA registers have an
inconsistent order. This violation of NewGVN assumptions results into
two PHIs found congruent when they're not. While we think it's useful
to have always a consistent order enforced, let's fix this in NewGVN
sorting uses in predecessor order before creating a PHI expression.
Differential Revision: https://reviews.llvm.org/D32990
llvm-svn: 302552
Craig Topper [Tue, 9 May 2017 16:47:33 +0000 (16:47 +0000)]
[APInt] Remove return value from tcFullMultiply.
The description says it returns the number of words needed to represent the results. But the way it was coded it always returns (lhsWords + rhsWords) or (lhsWords + rhsWords - 1). But the result could be even smaller than that and it wouldn't tell you.
No one uses the result today so rather than try to fix it, just remove it.
llvm-svn: 302551
Daniel Berlin [Tue, 9 May 2017 16:40:04 +0000 (16:40 +0000)]
NewGVN: Make all of symbolic evaluation logically const.
llvm-svn: 302550
Craig Topper [Tue, 9 May 2017 16:32:11 +0000 (16:32 +0000)]
[X86] Add more patterns for BZHI isel
This patch adds more patterns that a reasonable person might write that can be compiled to BZHI.
This adds support for
(~0U >> (32 - b)) & a;
and
a << (32 - b) >> (32 - b);
This was inspired by the code in APInt::clearUnusedBits.
This can pass an index of 32 to the bzhi instruction which a quick test of Haswell hardware shows will not mask any bits. Though the description text in the Intel manual says the "index is saturated to OperandSize-1". The pseudocode in the same manual indicates no bits will be zeroed for this case.
I think this is still missing cases where the subtract portion is an 8-bit operation.
Differential Revision: https://reviews.llvm.org/D32616
llvm-svn: 302549
Sanjay Patel [Tue, 9 May 2017 16:24:59 +0000 (16:24 +0000)]
[InstCombineCasts] Fix checks in sext->lshr->trunc pattern.
The comment says to avoid the case where zero bits are shifted into the truncated value,
but the code checks that the shift is smaller than the truncated value instead of the
number of bits added by the sign extension. Fixing this allows a shift by more than the
value size to be introduced, which is undefined behavior, so the shift is capped at the
value size minus one, which has the expected behavior of filling the value with the sign
bit.
Patch by Jacob Young!
Differential Revision: https://reviews.llvm.org/D32285
llvm-svn: 302548
Petar Jovanovic [Tue, 9 May 2017 16:24:03 +0000 (16:24 +0000)]
[mips] Impose a threshold for coercion of aggregates
Modified MipsABIInfo::classifyArgumentType so that it now coerces aggregate
structures only if the size of said aggregate is less than 16/64 bytes,
depending on the ABI.
Patch by Stefan Maksimovic.
Differential Revision: https://reviews.llvm.org/D32900
llvm-svn: 302547
Guy Blank [Tue, 9 May 2017 16:16:48 +0000 (16:16 +0000)]
VX512] Only look at lower bit in constant scalar masks
for scalar masked instructions only the lower bit of the mask is relevant. so for constant masks we should either do an unmasked operation or no operation, depending on the value of the lower bit.
This patch handles cases where the lower bit is '1'.
Differential Revision: https://reviews.llvm.org/D32805
llvm-svn: 302546
Alex Lorenz [Tue, 9 May 2017 16:05:04 +0000 (16:05 +0000)]
[CodeCompletion] Complete platform names in @available expressions
rdar://
32074504
llvm-svn: 302545
Reid Kleckner [Tue, 9 May 2017 16:02:20 +0000 (16:02 +0000)]
Re-land "Use the frame index side table for byval and inalloca arguments"
This re-lands r302483. It was not the cause of PR32977.
llvm-svn: 302544
Reid Kleckner [Tue, 9 May 2017 16:01:47 +0000 (16:01 +0000)]
Re-land "Don't add DBG_VALUE instructions for static allocas in dbg.declare"
This re-lands commit r302461. It was not the cause of PR32977.
llvm-svn: 302543
Hans Wennborg [Tue, 9 May 2017 15:55:39 +0000 (15:55 +0000)]
Revert r302476 "Update testcase for upstream LLVM changes."
That test update was for r302469, which was reverted in r302533 due to PR32977.
llvm-svn: 302542
Reid Kleckner [Tue, 9 May 2017 15:54:57 +0000 (15:54 +0000)]
Allow compiler-rt to find lld and libc++ parallel to LLVM, as in the monorepo
llvm-svn: 302541
Alex Lorenz [Tue, 9 May 2017 15:34:46 +0000 (15:34 +0000)]
Add support for pretty platform names to `@available`/
`__builtin_available`
This commit allows us to use the macOS/iOS/tvOS/watchOS platform names in
`@available`/`__builtin_available`.
rdar://
32067795
Differential Revision: https://reviews.llvm.org/D33000
llvm-svn: 302540
Tim Shen [Tue, 9 May 2017 15:27:17 +0000 (15:27 +0000)]
[Atomic] Remove IsStore/IsLoad in the interface, and pass the instruction instead. NFC.
Now both emitLeadingFence and emitTrailingFence take the instruction
itself, instead of taking IsLoad/IsStore pairs.
Instruction::mayReadFromMemory and Instrucion::mayWriteToMemory are used
for determining those two booleans.
The instruction argument is also useful for later D32763, in
emitTrailingFence. For emitLeadingFence, it seems to have cleaner
interface with the proposed change.
Differential Revision: https://reviews.llvm.org/D32762
llvm-svn: 302539
Kostya Kortchinsky [Tue, 9 May 2017 15:12:38 +0000 (15:12 +0000)]
[scudo] CRC32 optimizations
Summary:
This change optimizes several aspects of the checksum used for chunk headers.
First, there is no point in checking the weak symbol `computeHardwareCRC32`
everytime, it will either be there or not when we start, so check it once
during initialization and set the checksum type accordingly.
Then, the loading of `HashAlgorithm` for SSE versions (and ARM equivalent) was
not optimized out, while not necessary. So I reshuffled that part of the code,
which duplicates a tiny bit of code, but ends up in a much cleaner assembly
(and faster as we avoid an extraneous load and some calls).
The following code is the checksum at the end of `scudoMalloc` for x86_64 with
full SSE 4.2, before:
```
mov rax, 0FFFFFFFFFFFFFFh
shl r10, 38h
mov edi, dword ptr cs:_ZN7__scudoL6CookieE ; __scudo::Cookie
and r14, rax
lea rsi, [r13-10h]
movzx eax, cs:_ZN7__scudoL13HashAlgorithmE ; __scudo::HashAlgorithm
or r14, r10
mov rbx, r14
xor bx, bx
call _ZN7__scudo20computeHardwareCRC32Ejm ; __scudo::computeHardwareCRC32(uint,ulong)
mov rsi, rbx
mov edi, eax
call _ZN7__scudo20computeHardwareCRC32Ejm ; __scudo::computeHardwareCRC32(uint,ulong)
mov r14w, ax
mov rax, r13
mov [r13-10h], r14
```
After:
```
mov rax, cs:_ZN7__scudoL6CookieE ; __scudo::Cookie
lea rcx, [rbx-10h]
mov rdx, 0FFFFFFFFFFFFFFh
and r14, rdx
shl r9, 38h
or r14, r9
crc32 eax, rcx
mov rdx, r14
xor dx, dx
mov eax, eax
crc32 eax, rdx
mov r14w, ax
mov rax, rbx
mov [rbx-10h], r14
```
Reviewers: dvyukov, alekseyshl, kcc
Reviewed By: alekseyshl
Subscribers: aemerson, rengolin, llvm-commits
Differential Revision: https://reviews.llvm.org/D32971
llvm-svn: 302538
Aaron Ballman [Tue, 9 May 2017 15:12:03 +0000 (15:12 +0000)]
Amend r302535; ifndef and ifdef are different, as it turns out.
llvm-svn: 302537
Alexander Kornienko [Tue, 9 May 2017 15:10:26 +0000 (15:10 +0000)]
[clang-tidy] Allow disabling compatibility check for generated fixes.
llvm-svn: 302536
Aaron Ballman [Tue, 9 May 2017 14:59:48 +0000 (14:59 +0000)]
ARMRegisterBankInfo.h requires LLVM_BUILD_GLOBAL_ISEL to be defined. If it is not defined, then ARMGenRegisterBank.inc is not table generated and the inclusion of this header causes the build to fail.
llvm-svn: 302535
Alexander Kornienko [Tue, 9 May 2017 14:56:28 +0000 (14:56 +0000)]
Change EOL style to LF. NFC
llvm-svn: 302534
Hans Wennborg [Tue, 9 May 2017 14:44:15 +0000 (14:44 +0000)]
Revert r302469 "Make it illegal for two Functions to point to the same DISubprogram"
This caused PR32977.
Original commit message:
> Make it illegal for two Functions to point to the same DISubprogram
>
> As recently discussed on llvm-dev [1], this patch makes it illegal for
> two Functions to point to the same DISubprogram and updates
> FunctionCloner to also clone the debug info of a function to conform
> to the new requirement. To simplify the implementation it also factors
> out the creation of inlineAt locations from the Inliner into a
> general-purpose utility in DILocation.
>
> [1] http://lists.llvm.org/pipermail/llvm-dev/2017-May/112661.html
> <rdar://problem/
31926379>
>
> Differential Revision: https://reviews.llvm.org/D32975
llvm-svn: 302533
Anna Thomas [Tue, 9 May 2017 14:29:33 +0000 (14:29 +0000)]
[LV] Fix insertion point for shuffle vectors in first order recurrence
Summary:
In first order recurrence vectorization, when the previous value is a phi node, we need to
set the insertion point to the first non-phi node.
We can have the previous value being a phi node, due to the generation of new
IVs as part of trunc optimization [1].
[1] https://reviews.llvm.org/rL294967
Reviewers: mssimpso, mkuper
Subscribers: mzolotukhin, llvm-commits
Differential Revision: https://reviews.llvm.org/D32969
llvm-svn: 302532
Aaron Ballman [Tue, 9 May 2017 14:22:48 +0000 (14:22 +0000)]
Removing a file that is not necessary (and was causing link diagnostics with MSVC 2015); NFC.
llvm-svn: 302531
Francis Ricci [Tue, 9 May 2017 14:10:30 +0000 (14:10 +0000)]
Avoid unnecessary calls to vm_region_recurse
Summary: This should significantly improve darwin lsan performance in cases where root regions are not used.
Reviewers: alekseyshl, kubamracek
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32966
llvm-svn: 302530
Guy Blank [Tue, 9 May 2017 14:03:51 +0000 (14:03 +0000)]
[X86][AVX512] Refine some avx512er intrinsics tests. NFC.
The modified tests should test the masked intrinsics.
Currently the mask is constant, which with a future patch (https://reviews.llvm.org/D32805) will cause the intrinsics to be replaced with an unmasked version.
This patch changes the constant mask to be a variable one.
llvm-svn: 302529
Rafael Espindola [Tue, 9 May 2017 13:58:46 +0000 (13:58 +0000)]
Use a simpler heuristic for placing orphans.
This is a bit easier to read and a lot faster in some cases. A version
of many-sections.s with linker scripts goes from 0m41.232s to
0m19.575s.
llvm-svn: 302528