Sam Clegg [Fri, 23 Feb 2018 05:08:34 +0000 (05:08 +0000)]
[WebAssembly] Add first claass symbol table to wasm objects
This is combination of two patches by Nicholas Wilson:
1. https://reviews.llvm.org/D41954
2. https://reviews.llvm.org/D42495
Along with a few local modifications:
- One change I made was to add the UNDEFINED bit to the binary format
to avoid the extra byte used when writing data symbols. Although this
bit is redundant for other symbols types (i.e. undefined can be
implied if a function or global is a wasm import)
- I prefer to be explicit and consistent and not have derived flags.
- Some field renaming.
- Some reverting of unrelated minor changes.
- No test output differences.
Differential Revision: https://reviews.llvm.org/D43147
llvm-svn: 325860
Frederic Riss [Fri, 23 Feb 2018 05:03:10 +0000 (05:03 +0000)]
Fix TestUbsanBasic
Summary:
Potentially due to the recent testuite refactorings, this test now reports
a full absolute path but expect just the filename. For some reason this
test is skipped on GreenDragon so we've never seen the issue.
Reviewers: vsk
Subscribers: kubamracek, lldb-commits
Differential Revision: https://reviews.llvm.org/D43577
llvm-svn: 325859
Frederic Riss [Fri, 23 Feb 2018 05:03:09 +0000 (05:03 +0000)]
Fix TestMultithreaded when specifying an alternative debugserver.
Summary:
This test launches a helper that uses the debugserver. The environment
variable sepcifying the debug server wasn't passed to this helper, thus
it was using the default one.
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D43546
llvm-svn: 325858
Sam Clegg [Fri, 23 Feb 2018 04:59:57 +0000 (04:59 +0000)]
[WebAssembly] Move lambda declaration output of loop. NFC.
Differential Revision: https://reviews.llvm.org/D43534
llvm-svn: 325857
Ed Maste [Fri, 23 Feb 2018 02:50:07 +0000 (02:50 +0000)]
remove FreeBSD xfail from lit TestCallStdStringFunction
This test is consistently reporting unexpected pass for me, and the
expectedFailure decorator was removed from the legacy test in r310626.
Apply the same change to the lit version of this test.
Will investigate further if this fails once the new buildbot is running
tests.
llvm.org/pr17807
llvm-svn: 325856
Fangrui Song [Fri, 23 Feb 2018 02:05:48 +0000 (02:05 +0000)]
[ELF] Add comment for preemptible and fix typo. NFC
Subscribers: emaste, arichardson, llvm-commits
Differential Revision: https://reviews.llvm.org/D43642
llvm-svn: 325855
Richard Smith [Fri, 23 Feb 2018 02:03:26 +0000 (02:03 +0000)]
Add a test to ensure we don't permit mutable access on temporaries outside the evaluation in which they were created.
llvm-svn: 325854
Richard Smith [Fri, 23 Feb 2018 01:57:28 +0000 (01:57 +0000)]
Remove file missed by r325852 due to merge conflict.
llvm-svn: 325853
Richard Smith [Fri, 23 Feb 2018 01:43:46 +0000 (01:43 +0000)]
Revert r325128 ("[X86] Reduce Store Forward Block issues in HW").
This is causing miscompiles in some situations. See the llvm-commits thread for the commit for details.
llvm-svn: 325852
Davide Italiano [Fri, 23 Feb 2018 01:33:20 +0000 (01:33 +0000)]
[testsuite] Throw away test/debug_info/apple_types.
This test was only testing that clang produced the correct informations
for __apple accelerated tables. So, it's a clang test. Also, it
doesn't require any debugger intervention, the object file can
be analyzed statically with a dumper. Also, the input program
was highly verbose (unnecessarily).
r325850 commits a clang test instead, so it's time to retire this.
llvm-svn: 325851
Davide Italiano [Fri, 23 Feb 2018 01:25:03 +0000 (01:25 +0000)]
[Darwin] Add a test to check clang produces accelerator tables.
This test was previously in lldb, and was only checking that clang
was emitting the correct section. So, it belongs here and not
in the debugger.
llvm-svn: 325850
Rui Ueyama [Fri, 23 Feb 2018 01:16:57 +0000 (01:16 +0000)]
Make undefined symbol in DSO to pull out object files from archive files.
We have an internal program that does't link without this patch. I don't
know of any open-source program that needs this, but there might be.
Since this patch improves compatibility with GNU linkers with a few lines
of code, I think it's worth to be committed.
The problem is about undefined symbols in DSOs. Some programs depend on
the GNU linkers' behavior that they pull out object files from archive
files to resolve undefined symbols in DSOs. We already allow that kind of
"reverse" dependency (from DSOs to the main executable) for regular
symbols, in particular, for "__progname" symbol (which is usually in
crt0.o), but that doesn't work if the symbol is in an archive file.
This patch is to make it work.
Differential Revision: https://reviews.llvm.org/D43658
llvm-svn: 325849
Aditya Nandakumar [Fri, 23 Feb 2018 01:01:59 +0000 (01:01 +0000)]
[GISel]: Fix base case for m_any_of PatternMatcher.
The base case for any_of was incorrectly returning true. Also add test
case which uses m_any_of(preds...) where none of the predicates are
true.
llvm-svn: 325848
Vedant Kumar [Fri, 23 Feb 2018 00:29:40 +0000 (00:29 +0000)]
Delete some unused #includes of CleanUp.h, NFC
llvm-svn: 325847
Rafael Espindola [Fri, 23 Feb 2018 00:22:15 +0000 (00:22 +0000)]
Simplify setting dso_local. NFC.
The value of dso_local can be computed from just IR properties and
global information (object file type, command line options, etc).
With this patch we no longer pass in the Decl. It was almost unused
and making it fully unused guarantees that dso_local is consistent
with the rest of the IR.
llvm-svn: 325846
Craig Topper [Fri, 23 Feb 2018 00:21:39 +0000 (00:21 +0000)]
[X86] Turn setne X, signedmax into setgt signedmax, X in LowerVSETCC to avoid an invert
We won't be able to fold the constant pool load, but its still better than materialing ones and xoring for the invert if we used PCMPEQ.
This will fix another regression from D42948.
llvm-svn: 325845
Evandro Menezes [Fri, 23 Feb 2018 00:14:39 +0000 (00:14 +0000)]
[AArch64] Refactor macro fusion (NFC)
Move checks for each fusion case into separate functions for better
legibility and maintainability.
Differential revision: https://reviews.llvm.org/D43649
llvm-svn: 325844
Aaron Smith [Fri, 23 Feb 2018 00:02:27 +0000 (00:02 +0000)]
[PDB] Check the result of setLoadAddress()
Summary: Change setLoadAddress() to return true or false on failure.
Reviewers: zturner, llvm-commits
Reviewed By: zturner
Differential Revision: https://reviews.llvm.org/D43638
llvm-svn: 325843
Rafael Espindola [Thu, 22 Feb 2018 23:59:46 +0000 (23:59 +0000)]
Fix grammar. NFC.
Thank to Eric Christopher for noticing.
llvm-svn: 325842
Vedant Kumar [Thu, 22 Feb 2018 23:48:21 +0000 (23:48 +0000)]
[ObjC] Fix the NSConcreteData formatter and test it
The length field of an NSConcreteData lives one word past the start of
the object, not two.
llvm-svn: 325841
Craig Topper [Thu, 22 Feb 2018 23:46:28 +0000 (23:46 +0000)]
[X86] Turn setne X, signedmin into setgt X, signedmin in LowerVSETCC to avoid an invert
This will fix one of the regressions from D42948.
Differential Revision: https://reviews.llvm.org/D43531
llvm-svn: 325840
Evandro Menezes [Thu, 22 Feb 2018 23:32:06 +0000 (23:32 +0000)]
[AArch64] Improve macro fusion test case
Improve a vector in the test case for the fusion of address generation and
loads or stores. Otherwise, NFC.
llvm-svn: 325839
Adrian McCarthy [Thu, 22 Feb 2018 23:16:56 +0000 (23:16 +0000)]
Fix llvm-pdbutil to handle new built-in types
Summary:
The built-in PDB types enum has been extended to include char16_t and char32_t.
llvm-pdbutil was hitting an llvm_unreachable because it didn't know about these
new values. The new values are not yet in the DIA documentation, but are
listed in the cvconst.h header that comes as part of the DIA SDK.
Reviewers: asmith, zturner, rnk
Subscribers: stella.stamenova, llvm-commits, sanjoy
Differential Revision: https://reviews.llvm.org/D43646
llvm-svn: 325838
Eric Christopher [Thu, 22 Feb 2018 23:12:11 +0000 (23:12 +0000)]
Update comment for whether or not we can optimize an alias - we're
checking the alias and not the aliasee. If the alias can be interposed
then we shouldn't do anything.
llvm-svn: 325837
Adrian McCarthy [Thu, 22 Feb 2018 22:47:47 +0000 (22:47 +0000)]
Fix TestMoveNearest on Windows
The header file for the DLL tried to declare inline functions and a local
function as dllexport which broke the compile and link. Removing the bad
declarations solves the problem, and the test passes on Windows now.
Differential Revision: https://reviews.llvm.org/D43600
llvm-svn: 325836
Adrian McCarthy [Thu, 22 Feb 2018 22:47:14 +0000 (22:47 +0000)]
Fix TestSBData.py on Windows
Ensure that the test data is an array of bytes rather than a string that gets
encoded differently between Python 2 and Python 3.
Differential Revision: https://reviews.llvm.org/D43532
llvm-svn: 325835
Eugene Zelenko [Thu, 22 Feb 2018 22:35:17 +0000 (22:35 +0000)]
[Sema] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 325834
Benjamin Kramer [Thu, 22 Feb 2018 22:29:27 +0000 (22:29 +0000)]
Fix the build of the wasm backend.
toString conflicts with llvm::toString here. Yay for overly generic
function names.
llvm-svn: 325833
Sanjay Patel [Thu, 22 Feb 2018 21:46:13 +0000 (21:46 +0000)]
[InstrTypes] add frem and fneg with FMF creators
The more popular opcodes were added at r325730, but we
should have everything here for symmetry. I think both
of these can be used in InstCombine already, but I'll
make those changes as separate clean-ups for InstCombine.
llvm-svn: 325832
Paul Robinson [Thu, 22 Feb 2018 21:03:33 +0000 (21:03 +0000)]
[DWARFv5] Turn an assert into a diagnostic. Hand-coded assembler files
should not trigger assertions.
Differential Revision: https://reviews.llvm.org/D43152
llvm-svn: 325831
Teresa Johnson [Thu, 22 Feb 2018 20:57:05 +0000 (20:57 +0000)]
[ThinLTO/gold] Perform cache pruning when cache directory specified
Summary:
As pointed out in the review for D37993, for consistency with other
linkers, gold plugin should perform cache pruning whenever there is a
cache directory specified, which will use the default cache policy.
Reviewers: pcc
Subscribers: llvm-commits, inglorion
Differential Revision: https://reviews.llvm.org/D43389
llvm-svn: 325830
Craig Topper [Thu, 22 Feb 2018 20:51:26 +0000 (20:51 +0000)]
[TargetLowering] Rename isCondCodeLegal to isCondCodeLegalOrCustom. Add real isCondCodeLegal. Update callers to use one or the other.
isCondCodeLegal internally checked Legal or Custom which is misleading. Though no targets set any cond code action to Custom today.
So I've renamed isCondCodeLegal to isCondCodeLegalOrCustom and added a real isCondCodeLegal that only checks Legal.
I've changed legalization code to use isCondCodeLegalOrCustom and left things reachable via DAG combine as isCondCodeLegal. I've also changed some places that called getCondCodeAction and compared to Legal to just use isCondCodeLegal.
I'm looking at trying to keep SETCC all the way to isel for the AVX512 integer comparisons and I suspect I'll need to make some condition codes Custom to stop DAG combine from changing things post LegalizeOps. Prior to this only Expand stopped DAG combine, but that causes LegalizeOps to try to swap operands or invert rather than calling our Custom handler.
Differential Revision: https://reviews.llvm.org/D43607
llvm-svn: 325829
Aaron Smith [Thu, 22 Feb 2018 20:28:40 +0000 (20:28 +0000)]
[PDB] Add missing override to silence buildbots
llvm-svn: 325828
Craig Topper [Thu, 22 Feb 2018 20:24:18 +0000 (20:24 +0000)]
[X86] Make the subus special case in LowerVSETCC self contained
Previously this code overrode the flags and opcode used by the later code in LowerVSETCC. This makes the code difficult to read and follow.
This patch moves all the SUBUS code into its own function and makes it responsible for creating its own SDNodes on success.
Differential Revision: https://reviews.llvm.org/D43530
llvm-svn: 325827
Aaron Smith [Thu, 22 Feb 2018 20:00:07 +0000 (20:00 +0000)]
[PDB] Fix buildbot failure from missing include for DIAEnumLineNumbers
llvm-svn: 325826
Sander de Smalen [Thu, 22 Feb 2018 19:53:59 +0000 (19:53 +0000)]
Revert "[DebugInfo][FastISel] Fix dropping dbg.value()"
This patch reverts r325440 and r325438 because it triggers an
assertion in SelectionDAGBuilder.cpp. Also having debug enabled
may unintentionally affect code-gen. The patch is reverted until
we find a better solution.
llvm-svn: 325825
Aaron Smith [Thu, 22 Feb 2018 19:47:43 +0000 (19:47 +0000)]
[PDB] Implement more find methods for PDB symbols
Summary:
Add additional find methods on PDB raw symbols.
findChildrenByAddr()
findChildrenByVA()
findInlineFramesByAddr()
findInlineFramesByVA()
findInlineLines()
findInlineLinesByAddr()
findInlineLinesByRVA()
findInlineLinesByVA()
Reviewers: zturner, llvm-commits
Reviewed By: zturner
Differential Revision: https://reviews.llvm.org/D43637
llvm-svn: 325824
Easwaran Raman [Thu, 22 Feb 2018 19:44:08 +0000 (19:44 +0000)]
[ThinLTO] Represent relative BF using a scaled representation .
Summary:
The current integer representation of relative block frequency prevents
representing relative block frequencies below 1. This change uses a 8 of
the 29 bits to represent the decimal part by using a fixed scale of -8.
Reviewers: tejohnson, davidxl
Subscribers: mehdi_amini, inglorion, llvm-commits
Differential Revision: https://reviews.llvm.org/D43520
llvm-svn: 325823
Carlo Bertolli [Thu, 22 Feb 2018 19:38:14 +0000 (19:38 +0000)]
[OpenMP] Limit reduction support for pragma 'distribute' when combined with pragma 'simd'
Differential Revision: https://reviews.llvm.org/D43513
This is a bug fix that removes the emission of reduction support for pragma 'distribute' when found alone or in combinations without simd.
Pragma 'distribute' does not have a reduction clause, but when combined with pragma 'simd' we need to emit the support for simd's reduction clause as part of code generation for distribute. This guard is similar to the one used for reduction support earlier in the same code gen function.
llvm-svn: 325822
Zachary Turner [Thu, 22 Feb 2018 19:12:57 +0000 (19:12 +0000)]
Update lld documentation to mention PDB support.
Differential Revision: https://reviews.llvm.org/D43636
llvm-svn: 325821
Peter Collingbourne [Thu, 22 Feb 2018 19:09:07 +0000 (19:09 +0000)]
Fix DataFlowSanitizer instrumentation pass to take parameter position changes into account for custom functions.
When DataFlowSanitizer transforms a call to a custom function, the
new call has extra parameters. The attributes on parameters must be
updated to take the new position of each parameter into account.
Patch by Sam Kerner!
Differential Revision: https://reviews.llvm.org/D43132
llvm-svn: 325820
Vitaly Buka [Thu, 22 Feb 2018 19:06:15 +0000 (19:06 +0000)]
[ThinLTO] Always create linked objects file for --thinlto-index-only=
Summary:
ThinLTO indexing may decide to skip all objects. If we don't write something to
the list build system may consider this as failure or linker can reuse a file
from the previews build.
Reviewers: pcc, tejohnson
Subscribers: mehdi_amini, inglorion, eraman, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D43415
llvm-svn: 325819
Vitaly Buka [Thu, 22 Feb 2018 19:06:05 +0000 (19:06 +0000)]
[gold] Extract runLTO to avoid exit(0) from function with non-trivial objects on the stack
Reviewers: tejohnson, pcc
Subscribers: inglorion, llvm-commits
Differential Revision: https://reviews.llvm.org/D43537
llvm-svn: 325818
Matt Morehouse [Thu, 22 Feb 2018 19:00:17 +0000 (19:00 +0000)]
[libFuzzer] Include TEMP_MAX_LEN in Fuzzer::PrintStats.
Reviewers: kcc
Reviewed By: kcc
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D43597
llvm-svn: 325817
Daniel Neilson [Thu, 22 Feb 2018 18:55:59 +0000 (18:55 +0000)]
[AlignmentFromAssumptions] Set source and dest alignments of memory intrinsiscs separately
Summary:
This change is part of step five in the series of changes to remove alignment argument from
memcpy/memmove/memset in favour of alignment attributes. In particular, this changes the
AlignmentFromAssumptions pass to cease using the old getAlignment()/setAlignment API of
MemoryIntrinsic in favour of getting/setting source & dest specific alignments through
the new API. This allows us to simplify some of the code in this pass and also be more
aggressive about setting the source and destination alignments separately.
Steps:
Step 1) Remove alignment parameter and create alignment parameter attributes for
memcpy/memmove/memset. ( rL322965, rC322964, rL322963 )
Step 2) Expand the IRBuilder API to allow creation of memcpy/memmove with differing
source and dest alignments. ( rL323597 )
Step 3) Update Clang to use the new IRBuilder API. ( rC323617 )
Step 4) Update Polly to use the new IRBuilder API. ( rL323618 )
Step 5) Update LLVM passes that create memcpy/memmove calls to use the new IRBuilder API,
and those that use use MemIntrinsicInst::[get|set]Alignment() to use [get|set]DestAlignment()
and [get|set]SourceAlignment() instead. ( rL323886, rL323891, rL324148, rL324273, rL324278,
rL324384, rL324395, rL324402, rL324626, rL324642, rL324653, rL324654, rL324773, rL324774,
rL324781, rL324784, rL324955, rL324960 )
Step 6) Remove the single-alignment IRBuilder API for memcpy/memmove, and the
MemIntrinsicInst::[get|set]Alignment() methods.
Reference
http://lists.llvm.org/pipermail/llvm-dev/2015-August/089384.html
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-
20151109/312083.html
Reviewers: hfinkel, bollu, reames
Reviewed By: reames
Subscribers: reames, llvm-commits
Differential Revision: https://reviews.llvm.org/D43081
llvm-svn: 325816
Simon Pilgrim [Thu, 22 Feb 2018 18:45:13 +0000 (18:45 +0000)]
[SelectionDAG] Move matchUnaryPredicate/matchBinaryPredicate into SelectionDAGNodes.h
This allows us to improve vector constant matching in more DAG code (backends, TargetLowering etc.).
Differential Revision: https://reviews.llvm.org/D43466
llvm-svn: 325815
Artem Belevich [Thu, 22 Feb 2018 18:40:52 +0000 (18:40 +0000)]
[CUDA] Added missing functions.
Initial commit missed sincos(float), llabs() and few atomics that we
used to pull in from device_functions.hpp, which we no longer include.
Differential Revision: https://reviews.llvm.org/D43602
llvm-svn: 325814
Eric Liu [Thu, 22 Feb 2018 18:40:39 +0000 (18:40 +0000)]
[clangd] Extend textDocument/didChange to specify whether diagnostics should be generated.
Summary:
This would allow us to disable diagnostics when didChange is called but
diagnostics are not wanted (e.g. code completion).
Reviewers: sammccall
Subscribers: klimek, ilya-biryukov, jkorous-apple, cfe-commits
Differential Revision: https://reviews.llvm.org/D43634
llvm-svn: 325813
Alexey Bataev [Thu, 22 Feb 2018 18:33:31 +0000 (18:33 +0000)]
[OPENMP] Require valid SourceLocation in function call, NFC.
Removed default empty SourceLocation argument from `emitCall` function
and require valid location.
llvm-svn: 325812
Simon Pilgrim [Thu, 22 Feb 2018 18:06:48 +0000 (18:06 +0000)]
[MC] Don't crash on modulo by zero (PR35650)
Extension to D12776, handle modulo by zero in the same way we handle divide by zero.
Differential Revision: https://reviews.llvm.org/D43631
llvm-svn: 325810
George Rimar [Thu, 22 Feb 2018 17:52:43 +0000 (17:52 +0000)]
[ELF] - Rewrote outdated comment. NFC.
llvm-svn: 325809
Sanjay Patel [Thu, 22 Feb 2018 17:33:20 +0000 (17:33 +0000)]
[IRBuilder] add creators for FP with FMF; NFCI
Also, add a helper for the constant folder to reduce duplication.
It seems out-of-place for and/or to be doing simplifications here?
Otherwise, I could have used the helper on those opcodes too.
llvm-svn: 325808
Jonas Hahnfeld [Thu, 22 Feb 2018 17:10:28 +0000 (17:10 +0000)]
[docs] Regenerate command line reference
llvm-svn: 325807
Jonas Hahnfeld [Thu, 22 Feb 2018 17:06:35 +0000 (17:06 +0000)]
[docs] Improve help for OpenMP options, NFC.
* Add HelpText for -fopenmp so that it appears in clang --help.
* Hide -fno-openmp-simd, only list the positive option.
* Hide -fopenmp-relocatable-target and -fopenmp-use-tls from
clang --help and from ClangCommandLineReference.
* Improve MetaVarName for -Xopenmp-target=<...>.
Differential Revision: https://reviews.llvm.org/D42841
llvm-svn: 325806
Jonas Hahnfeld [Thu, 22 Feb 2018 17:06:27 +0000 (17:06 +0000)]
[docs] Fix duplicate arguments for JoinedAndSeparate
We can't see how many arguments are in the meta var name, so just
assume that it is the right number.
Differential Revision: https://reviews.llvm.org/D42840
llvm-svn: 325805
Simon Pilgrim [Thu, 22 Feb 2018 16:29:08 +0000 (16:29 +0000)]
[X86][AVX512] Add DQ+VLX scalar int<->fp tests cases for D43441
llvm-svn: 325804
Alexey Bataev [Thu, 22 Feb 2018 16:20:30 +0000 (16:20 +0000)]
[DEBUGINFO] Do not output labels for empty macinfo sections.
Summary:
If there is no debug info for macros, do not emit labels for empty
macinfo sections.
Reviewers: probinson, echristo
Subscribers: aprantl, llvm-commits, JDevlieghere
Differential Revision: https://reviews.llvm.org/D43589
llvm-svn: 325803
Simon Pilgrim [Thu, 22 Feb 2018 16:12:27 +0000 (16:12 +0000)]
Fix "not all control paths return a value" MSVC warning. NFCI.
llvm-svn: 325802
Sam McCall [Thu, 22 Feb 2018 15:33:33 +0000 (15:33 +0000)]
[clangd] fix test use-after-free from r325774
llvm-svn: 325801
Nicolai Haehnle [Thu, 22 Feb 2018 15:27:12 +0000 (15:27 +0000)]
TableGen: Add strict assertions to sanity check earlier type checking
Summary:
Both of these errors should have been caught by type-checking during
parsing.
Change-Id: I891087936fd1a91d21bcda57c256e3edbe12b94d
Reviewers: arsenm, craig.topper, tra, MartinO
Subscribers: wdng, llvm-commits
Differential Revision: https://reviews.llvm.org/D43558
llvm-svn: 325800
Nicolai Haehnle [Thu, 22 Feb 2018 15:27:03 +0000 (15:27 +0000)]
TableGen: Allow implicit casting between string and code
Summary:
Perhaps the distinction between the two should be removed entirely
in the long term, and the [{ ... }] syntax should just be a convenient
way of writing multi-line strings.
In the meantime, a lot of existing .td files are quite relaxed about
string vs. code, and this change allows switching on more consistent
type checks without breaking those.
Change-Id: If85e3e04469e41b58e2703b62ac0032d2711713c
Reviewers: arsenm, craig.topper, tra, MartinO
Subscribers: wdng, llvm-commits
Differential Revision: https://reviews.llvm.org/D43557
llvm-svn: 325799
Nicolai Haehnle [Thu, 22 Feb 2018 15:26:45 +0000 (15:26 +0000)]
TableGen: Fix type of resolved and converted lists
Summary:
There are no new test cases, but a subsequent patch will introduce
assertions that would be triggered by existing test cases without this
fix.
Change-Id: I6a82d4b311b012aff3932978ae86f6a2dcfbf725
Reviewers: arsenm, craig.topper, tra, MartinO
Subscribers: wdng, llvm-commits
Differential Revision: https://reviews.llvm.org/D43556
llvm-svn: 325798
Nicolai Haehnle [Thu, 22 Feb 2018 15:26:35 +0000 (15:26 +0000)]
TableGen: Fix type deduction for !foreach
Summary:
In the case of !foreach(id, input-list, transform) where the type of
input-list is list<A> and the type of transform is B, we now correctly
deduce list<B> as the type of the !foreach.
Change-Id: Ia19dd65eecc5991dd648280ba6a15f6a20fd61de
Reviewers: arsenm, craig.topper, tra, MartinO
Subscribers: wdng, llvm-commits
Differential Revision: https://reviews.llvm.org/D43555
llvm-svn: 325797
Nicolai Haehnle [Thu, 22 Feb 2018 15:26:28 +0000 (15:26 +0000)]
TableGen: Generalize type deduction for !listconcat
Summary:
This way, it should work even with complex operands.
Change-Id: Iaccf5bbb50bd5882a0ba5d59689e4381315fb361
Reviewers: arsenm, craig.topper, tra, MartinO
Subscribers: wdng, llvm-commits
Differential Revision: https://reviews.llvm.org/D43554
llvm-svn: 325796
Nicolai Haehnle [Thu, 22 Feb 2018 15:26:21 +0000 (15:26 +0000)]
TableGen: Add some more helpful error messages
Summary: Some fairly simple changes to start with.
Reviewers: arsenm, craig.topper, tra, MartinO
Subscribers: wdng, llvm-commits
Differential Revision: https://reviews.llvm.org/D43552
Change-Id: I0c92731b36d309c6edfcae42595ae1a70cc051c9
llvm-svn: 325795
Nicolai Haehnle [Thu, 22 Feb 2018 15:25:11 +0000 (15:25 +0000)]
AMDGPU: Stop using .NAME in .td files
Summary:
.NAME is a bit of an odd duck, in that we should really treat it like
a template argument, but we currently don't, and so when and where
NAME is initialized and how is pretty inconsistent. Best to just avoid
using it as a field of already instantiated records, and use cast to
string instead.
Change-Id: I5a0c202401cede3d5c3827ab9c7858ea48b29108
Reviewers: arsenm, rampitec
Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D43551
llvm-svn: 325794
Shiva Chen [Thu, 22 Feb 2018 15:02:28 +0000 (15:02 +0000)]
[RISCV] Implement c.lui immediate operand constraint
Implement c.lui immediate constraint to [1, 31] and [0xfffe0, 0xfffff].
The RISC-V ISA describes the constraint as [1, 63], with that value
being loaded in to bits 17-12 of the destination register and sign extended
from bit 17. Therefore, this 6-bit immediate can represent values in the
ranges [1, 31] and [0xfffe0, 0xfffff].
Differential Revision: https://reviews.llvm.org/D42834
llvm-svn: 325792
Luke Cheeseman [Thu, 22 Feb 2018 14:42:08 +0000 (14:42 +0000)]
[FunctionAttrs][ArgumentPromotion][GlobalOpt] Disable some optimisations passes for naked functions
- Fix for bug 36078.
- Prevent the functionattrs, function-attrs, globalopt and argpromotion passes
from changing naked functions.
- These passes can perform some alterations to the functions that should not be
applied. An example is removing parameters that are seemingly not used because
they are only referenced in the inline assembly. Another example is marking
the function as fastcc.
llvm-svn: 325788
Sanjay Patel [Thu, 22 Feb 2018 14:27:16 +0000 (14:27 +0000)]
[InstCombine] add fmul multi-use test; NFC
Also, rename tests to make their intent clearer.
llvm-svn: 325785
Simon Marchi [Thu, 22 Feb 2018 14:00:39 +0000 (14:00 +0000)]
[clangd] DidChangeConfiguration Notification
Summary:
Implementation of DidChangeConfiguration notification handling in
clangd. This currently only supports changing one setting: the path of
the compilation database to be used for the current project. In other
words, it is no longer necessary to restart clangd with a different
command line argument in order to change the compilation database.
Reviewers: malaperle, krasimir, bkramer, ilya-biryukov
Subscribers: jkorous-apple, ioeric, simark, klimek, ilya-biryukov, arphaman, rwols, cfe-commits
Differential Revision: https://reviews.llvm.org/D39571
Signed-off-by: Simon Marchi <simon.marchi@ericsson.com>
Signed-off-by: William Enright <william.enright@polymtl.ca>
llvm-svn: 325784
Stefan Maksimovic [Thu, 22 Feb 2018 13:40:42 +0000 (13:40 +0000)]
[mips] Generate memory dependencies for byVal arguments
There were no memory dependencies made between stores generated
when lowering formal arguments and loads generated when
call lowering byVal arguments which made the Post-RA scheduler
place a load before a matching store.
Make the fixed object stored to mutable so that the load
instructions can have their memory dependencies added
Set the frame object as isAliased which clears the underlying
objects vector in ScheduleDAGInstrs::buildSchedGraph().
This results in addition of all stores as dependenies for loads.
This problem appeared when passing a byVal parameter
coupled with a fastcc function call.
Differential Revision: https://reviews.llvm.org/D37515
llvm-svn: 325782
Haojian Wu [Thu, 22 Feb 2018 13:35:01 +0000 (13:35 +0000)]
[clangd] Correct setting ignoreWarnings in CodeCompletion.
Summary:
We should set the flag before creating ComplierInstance -- when
CopmilerInstance gets initialized, it also initializes the DiagnosticsEngine
using the DiagnosticOptions.
This was hidden deeply -- as clang suppresses all diagnostics when we
hit the code-completion (but internally it does do unnecessary analysis stuff).
As a bonus point, this fix will optmize the completion speed -- clang won't do
any analysis (e.g. -Wunreachable-code, -Wthread-safety-analysisi) at all internally.
Reviewers: ilya-biryukov
Reviewed By: ilya-biryukov
Subscribers: klimek, jkorous-apple, ioeric, cfe-commits
Differential Revision: https://reviews.llvm.org/D43569
llvm-svn: 325779
Serge Guelton [Thu, 22 Feb 2018 13:30:32 +0000 (13:30 +0000)]
Syndicate duplicate code between CallInst and InvokeInst
NFC intended, syndicate common code to a parametric base class. Part of the original problem is that InvokeInst is a TerminatorInst, unlike CallInst. the problem is solved by introducing a parametrized class paramtertized by its base.
Differential Revision: https://reviews.llvm.org/D40727
llvm-svn: 325778
Simon Pilgrim [Thu, 22 Feb 2018 13:28:42 +0000 (13:28 +0000)]
Fix Wdocumentation warning - remove param tag for old argument
llvm-svn: 325777
Alex Bradbury [Thu, 22 Feb 2018 13:24:25 +0000 (13:24 +0000)]
[RISCV][NFC] Make logic in RISCVMCCodeEmitter::getImmOpValue more defensive
As pointed out by @sabuasal in a comment on D23568, the logic in
RISCVMCCodeEmitter::getImmOpValue could be more defensive. Although with the
current instruction definitions it is always the case that `VK_RISCV_LO` is
always used with either an I- or S-format instruction, this may not always be
the case in the future. Add a check to ensure we will get an assertion in
debug builds if that changes.
llvm-svn: 325775
Sam McCall [Thu, 22 Feb 2018 13:11:12 +0000 (13:11 +0000)]
[clangd] Allow embedders some control over when diagnostics are generated.
Summary:
Through the C++ API, we support for a given snapshot version:
- Yes: make sure we generate diagnostics for exactly this version
- Auto: generate eventually-consistent diagnostics for at least this version
- No: don't generate diagnostics for this version
Eventually auto should be debounced for better UX.
Through LSP, we force diagnostics for initial load (bypassing future debouncing)
and all updates follow the "auto" policy.
This is complicated to implement under the CancellationFlag design, so
rewrote that part to just inspect the queue instead.
It turns out we never pass None to the diagnostics callback, so remove Optional
from the signature. The questionable behavior of not invoking the callback at
all if CppFile::rebuild fails is not changed.
Reviewers: ilya-biryukov
Subscribers: klimek, jkorous-apple, ioeric, cfe-commits
Differential Revision: https://reviews.llvm.org/D43518
llvm-svn: 325774
Simon Pilgrim [Thu, 22 Feb 2018 12:19:34 +0000 (12:19 +0000)]
[SLPVectorizer][X86] Add load extend tests (PR36091)
llvm-svn: 325772
Alexey Sotkin [Thu, 22 Feb 2018 11:54:14 +0000 (11:54 +0000)]
[OpenCL] Add '-cl-uniform-work-group-size' compile option
Summary:
OpenCL 2.0 specification defines '-cl-uniform-work-group-size' option,
which requires that the global work-size be a multiple of the work-group
size specified to clEnqueueNDRangeKernel and allows optimizations that
are made possible by this restriction.
The patch introduces the support of this option.
To keep information about whether an OpenCL kernel has uniform work
group size or not, clang generates 'uniform-work-group-size' function
attribute for every kernel:
- "uniform-work-group-size"="true" for OpenCL 1.2 and lower,
- "uniform-work-group-size"="true" for OpenCL 2.0 and higher if
'-cl-uniform-work-group-size' option was specified,
- "uniform-work-group-size"="false" for OpenCL 2.0 and higher if no
'-cl-uniform-work-group-size' options was specified.
If the function is not an OpenCL kernel, 'uniform-work-group-size'
attribute isn't generated.
Patch by: krisb
Reviewers: yaxunl, Anastasia, b-sumner
Reviewed By: yaxunl, Anastasia
Subscribers: nhaehnle, yaxunl, Anastasia, cfe-commits
Differential Revision: https://reviews.llvm.org/D43570
llvm-svn: 325771
Simon Dardis [Thu, 22 Feb 2018 11:53:01 +0000 (11:53 +0000)]
[mips] Regenerate tests for D38128 (NFC)
llvm-svn: 325770
Jonas Devlieghere [Thu, 22 Feb 2018 11:43:43 +0000 (11:43 +0000)]
[dsymutil] Remove \brief from comments. NFC
With autobrief enabled, these server no purpose anymore. Most of them
were already removed but this makes everything consistent.
llvm-svn: 325769
Jonas Devlieghere [Thu, 22 Feb 2018 11:32:51 +0000 (11:32 +0000)]
[dsymutil] Fix typos and formatting. NFC.
Some over-due gardening: this fixes a bunch of typos and makes the
formatting consistent with LLVM's style guide.
llvm-svn: 325768
Sjoerd Meijer [Thu, 22 Feb 2018 10:43:57 +0000 (10:43 +0000)]
Recommit: [ARM] f16 constant pool fix
This recommits r325754; the modified and failing test case
actually didn't need any modifications.
llvm-svn: 325765
Eric Liu [Thu, 22 Feb 2018 10:14:05 +0000 (10:14 +0000)]
[clangd] Not collect include headers for dynamic index for now.
Summary:
The new behaviors introduced by this patch:
o When include collection is enabled, we always set IncludeHeader field in Symbol
even if it's the same as FileURI in decl.
o Disable include collection in FileIndex which is currently only used to build
dynamic index. We should revisit when we actually want to use FileIndex to global
index.
o Code-completion only uses IncludeHeader to insert headers but not FileURI in
CanonicalDeclaration. This ensures that inserted headers are always canonicalized.
Note that include insertion can still be triggered for symbols that are already
included if they are merged from dynamic index and static index, but we would
only use includes that are already canonicalized (e.g. from static index).
Reason for change:
Collecting header includes in dynamic index enables inserting includes for headers
that are not indexed but opened in the editor. Comparing to inserting includes for
symbols in global/static index, this is nice-to-have but would probably require
non-trivial amount of work to get right. For example:
o Currently it's not easy to fully support CanonicalIncludes in dynamic index, given the way
we run dynamic index.
o It's also harder to reason about the correctness of include canonicalization for dynamic index
(i.e. symbols in the current file/TU) than static index where symbols are collected
offline and sanity check is possible before shipping to production.
o We have less control/flexibility over symbol info in the dynamic index
(e.g. URIs, path normalization), which could be used to help make decision when inserting includes.
As header collection (especially canonicalization) is relatively new, and enabling
it for dynamic index would immediately affect current users with only dynamic
index support, I propose we disable it for dynamic index for now to avoid
compromising other hot features like code completion and only support it for
static index where include insertion would likely to bring more value.
Reviewers: ilya-biryukov, sammccall, hokein
Subscribers: klimek, jkorous-apple, cfe-commits
Differential Revision: https://reviews.llvm.org/D43550
llvm-svn: 325764
George Rimar [Thu, 22 Feb 2018 09:55:28 +0000 (09:55 +0000)]
[ELF] - Introduce getInputSections() helper.
We sometimes need to iterate over input sections for a given
output section. It is not very convinent because we have to iterate
over section descriptions.
Patch introduces getInputSections helper, it simplifies things.
Differential revision: https://reviews.llvm.org/D43574
llvm-svn: 325763
Jonas Devlieghere [Thu, 22 Feb 2018 09:42:10 +0000 (09:42 +0000)]
[dsymutil] Replace PATH_MAX in SmallString with fixed value.
Apparently the Windows bots don't know this define, so just going with a
sensible default.
Failing builds:
http://lab.llvm.org:8011/builders/lldb-x86-windows-msvc2015/builds/19179
http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/19263
llvm-svn: 325762
David Green [Thu, 22 Feb 2018 09:38:57 +0000 (09:38 +0000)]
[ARM] Fix issue with large xor constants.
Fixup to rL325573 for large xor constants.
Thanks to Eli Friedman for the catch.
Differential revision: https://reviews.llvm.org/D43549
llvm-svn: 325761
Mikhail Maltsev [Thu, 22 Feb 2018 09:34:08 +0000 (09:34 +0000)]
[libcxx] Do not include the C math.h header before __config
Summary:
Certain C libraries require configuration macros defined in __config
to provide the correct functionality for libc++. This patch ensures
that the C header math.h is always included after the __config
header. It also adds a Windows-specific #if guard for the case when
the C math.h file is included the second time, as suggested by
Marshall in https://reviews.llvm.org/rL323490.
Fixes PR36382.
Reviewers: mclow.lists, EricWF
Reviewed By: mclow.lists
Subscribers: cfe-commits, pcc, christof, rogfer01
Differential Revision: https://reviews.llvm.org/D43579
llvm-svn: 325760
Jonas Devlieghere [Thu, 22 Feb 2018 09:20:40 +0000 (09:20 +0000)]
[dsymutil] Be smarter in caching calls to realpath
Calling realpath is expensive but necessary to perform the uniqueing in
dsymutil. Although we already cached the results for every individual
file in the line table, we had reports of it taking 40 seconds of a 3.5
minute link.
This patch adds a second level of caching. When we do have to call
realpath, we cache its result for its parents path. We didn't replace
the existing caching, because it's fast (indexed) and saves us from
reading the line table for entries we've already seen.
For WebkitCore this results in a decrease of 11% in linking time: from
85.79 to 76.11 seconds (average over 3 runs).
Differential revision: https://reviews.llvm.org/D43511
llvm-svn: 325757
Sjoerd Meijer [Thu, 22 Feb 2018 08:41:55 +0000 (08:41 +0000)]
Revert r325754 and r325755 (f16 literal pool) because buildbots were unhappy.
llvm-svn: 325756
Sjoerd Meijer [Thu, 22 Feb 2018 08:20:50 +0000 (08:20 +0000)]
Added a test that I forgot to svn add in my previous commit r325754.
llvm-svn: 325755
Sjoerd Meijer [Thu, 22 Feb 2018 08:16:05 +0000 (08:16 +0000)]
[ARM] f16 constant pool fix
This is a follow up of r325012, that allowed half types in constant pools.
Proper alignment was enforced when a big basic block was split up, but not when
a CPE was placed before/after a block; the successor block had the wrong
alignment.
Differential Revision: https://reviews.llvm.org/D43580
llvm-svn: 325754
Hiroshi Inoue [Thu, 22 Feb 2018 07:49:13 +0000 (07:49 +0000)]
[NFC] fix trivial typos in comments
"a a"->"a"
llvm-svn: 325753
Hiroshi Inoue [Thu, 22 Feb 2018 07:48:29 +0000 (07:48 +0000)]
[NFC] fix trivial typos in comments
"a a" -> "a"
llvm-svn: 325752
Kamil Rytarowski [Thu, 22 Feb 2018 07:17:01 +0000 (07:17 +0000)]
Try to fix the syntax in test
Reported on a buildbot:
Error in XFAIL list:
couldn't parse text: '| arm || aarch64 || mips'
in expression: 'freebsd | arm || aarch64 || mips'
Add || in the place of |
Fallout from D43382
llvm-svn: 325751
Craig Topper [Thu, 22 Feb 2018 07:05:27 +0000 (07:05 +0000)]
[DAGCombiner] Add two calls to isVector before making calls to getVectorElementType/getVectorNumElements to avoid an assert.
We looked through a BITCAST, but the bitcast might be a from a scalar type rather than a vector.
I don't have a test case. I stumbled onto it while prototyping another change that isn't ready yet.
llvm-svn: 325750
Kamil Rytarowski [Thu, 22 Feb 2018 07:00:29 +0000 (07:00 +0000)]
Revert part of D43378 in this file
It causes failure on clang-x86_64-debian-fast.
llvm-svn: 325749
Kamil Rytarowski [Thu, 22 Feb 2018 06:48:34 +0000 (06:48 +0000)]
Revert part of r. 325746 D43378
test/Driver/XRay/xray-shared-noxray.cpp fails on !Linux hosts.
llvm-svn: 325748
Mircea Trofin [Thu, 22 Feb 2018 06:42:57 +0000 (06:42 +0000)]
[SampleProf] NFC. Expose reusable functionality in SampleProfile.
Summary:
Exposing getOffset and findFunctionSamples as members of
SampleProfile. They are intimately tied to design choices of the
sample profile format - using offsets instead of line numbers, and
traversing inlined functions stack, respectively.
Reviewers: davidxl
Reviewed By: davidxl
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D43605
llvm-svn: 325747
Kamil Rytarowski [Thu, 22 Feb 2018 06:31:40 +0000 (06:31 +0000)]
FreeBSD driver / Xray flags moving pthread to compile flags.
Summary:
- Using -lpthread instead, with -pthread the linkage does not work.
-Warning about the -fxray-instrument usage outside of the working cases.
Patch by: David CARLIER
Reviewers: krytarowski, vitalybuka, dberris, emaste
Reviewed By: krytarowski, emaste
Subscribers: srhines, emaste, cfe-commits
Differential Revision: https://reviews.llvm.org/D43378
llvm-svn: 325746
Max Kazantsev [Thu, 22 Feb 2018 06:27:32 +0000 (06:27 +0000)]
[SCEV][NFC] Factor out common logic into a separate method
SCEV has multiple occurences of code when we need to prove some predicate on
every iteration of a loop and do it with invocations of couple `isLoopEntryGuardedByCond`,
`isLoopBackedgeGuardedByCond`. This patch factors out these two calls into a separate
method. It is a preparation step to extend this logic: it is not the only way how we can prove
such conditions.
Differential Revision: https://reviews.llvm.org/D43373
llvm-svn: 325745