Petr Hosek [Wed, 11 Apr 2018 01:06:28 +0000 (01:06 +0000)]
[libcxx] Set ABI version 2 as default for Fuchsia
This avoids the need for a custom generated config file which is desired
because the custom config files differs per-target which means we cannot
reuse headers across different targets.
Differential Revision: https://reviews.llvm.org/D45304
llvm-svn: 329770
Craig Topper [Wed, 11 Apr 2018 01:05:32 +0000 (01:05 +0000)]
[X86] Switch a test from grep to FileCheck. NFC
llvm-svn: 329769
Sriraman Tallam [Tue, 10 Apr 2018 23:32:36 +0000 (23:32 +0000)]
Simplification of libcall like printf->puts must check for RtLibUseGOT metadata.
With -fno-plt, for example, calls to printf when getting converted to puts
still use the PLT. This patch checks for the metadata "RtLibUseGOT" and
annotates the declaration with the right attributes.
Differential Revision: https://reviews.llvm.org/D45180
llvm-svn: 329768
Rui Ueyama [Tue, 10 Apr 2018 22:58:08 +0000 (22:58 +0000)]
Use contains_lower() instead of find_lower() != StringRef::npos. NFC.
llvm-svn: 329767
Eugene Zelenko [Tue, 10 Apr 2018 22:54:42 +0000 (22:54 +0000)]
[AST] Fix some Clang-tidy modernize-use-auto and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 329766
Sriraman Tallam [Tue, 10 Apr 2018 22:50:05 +0000 (22:50 +0000)]
GOTPCREL references must always use RIP.
With -fno-plt, global value references can use GOTPCREL and RIP must be used.
Differential Revision: https://reviews.llvm.org/D45460
llvm-svn: 329765
Marek Olsak [Tue, 10 Apr 2018 22:48:23 +0000 (22:48 +0000)]
AMDGPU: enable 128-bit for local addr space under an option
Author: Samuel Pitoiset
ds_read_b128 and ds_write_b128 have been recently enabled
under the amdgpu-ds128 option because the performance benefit
is unclear.
Though, using 128-bit loads/stores for the local address space
appears to introduce regressions in tessellation shaders. Not
sure what is broken, but as ds_read_b128/ds_write_b128 are not
enabled by default, just introduce a global option and enable
128-bit only if requested (until it's fixed/used correctly).
v2: - fix regressions in merge-stores.ll and multiple_tails.ll
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105464
llvm-svn: 329764
Galina Kistanova [Tue, 10 Apr 2018 22:07:29 +0000 (22:07 +0000)]
Disable flaky tests till they get fixed.
llvm-svn: 329763
Aaron Ballman [Tue, 10 Apr 2018 21:58:13 +0000 (21:58 +0000)]
Introduce a new builtin, __builtin_dump_struct, that is useful for dumping structure contents at runtime in circumstances where debuggers may not be easily available (such as in kernel work).
Patch by Paul Semel.
llvm-svn: 329762
Geoff Berry [Tue, 10 Apr 2018 21:43:03 +0000 (21:43 +0000)]
[AArch64][Falkor] Fix bug in Falkor HWPF collision avoidance pass.
Summary:
When inserting MOVs to avoid Falkor HWPF collisions, the non-base
register operand of load instructions (e.g. a register offset) was not
being considered live, so it could potentially have been used as a
scratch register, clobbering the actual offset value.
Reviewers: mcrosier
Subscribers: rengolin, javed.absar, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D45502
llvm-svn: 329761
Petr Hosek [Tue, 10 Apr 2018 21:29:18 +0000 (21:29 +0000)]
Revert "Handle the default case"
This reverts commit r329758.
llvm-svn: 329760
George Burgess IV [Tue, 10 Apr 2018 21:22:22 +0000 (21:22 +0000)]
[clang-tidy] Add a `android-comparison-in-temp-failure-retry` check
This check attempts to catch buggy uses of the `TEMP_FAILURE_RETRY`
macro, which is provided by both Bionic and glibc.
Differential Revision: https://reviews.llvm.org/D45059
llvm-svn: 329759
Petr Hosek [Tue, 10 Apr 2018 21:19:05 +0000 (21:19 +0000)]
Handle the default case
This was omitted in D45422 resulting in a warning.
Differential Revision: https://reviews.llvm.org/D45499
llvm-svn: 329758
Rafael Espindola [Tue, 10 Apr 2018 21:13:52 +0000 (21:13 +0000)]
Don't warn on ICFed symbols, warn on synthetic ones.
Based on a patch for the ICF warning by Rui.
llvm-svn: 329757
Roman Lebedev [Tue, 10 Apr 2018 20:59:27 +0000 (20:59 +0000)]
[clang-tidy] Unbreak run-clang-tidy.cpp test (modernize-use-auto.MinTypeNameLength)
Again, refs. D45405, rL329730.
llvm-svn: 329756
Sanjay Patel [Tue, 10 Apr 2018 20:42:39 +0000 (20:42 +0000)]
[CVP] simplify phi with constant incoming values that match common variable edge values
This is based on an example that was recently posted on llvm-dev:
void *propagate_null(void* b, int* g) {
if (!b) {
return 0;
}
(*g)++;
return b;
}
https://godbolt.org/g/xYk3qG
The original code or constant propagation in other passes has obscured the fact
that the phi can be removed completely.
Differential Revision: https://reviews.llvm.org/D45448
llvm-svn: 329755
Chad Rosier [Tue, 10 Apr 2018 20:30:16 +0000 (20:30 +0000)]
[Driver] Handle the default case missed in r329748.
Differential Revision: https://reviews.llvm.org/D45499
llvm-svn: 329754
Daniel Neilson [Tue, 10 Apr 2018 20:23:50 +0000 (20:23 +0000)]
[Verifier] Refactor duplicate code for atomic mem intrinsic verification (NFC)
Summary:
The verification rules for the intrinsics for atomic memcpy, atomic memmove,
and atomic memset are basically code clones. This change merges their verification
rules into a single block to remove duplication.
llvm-svn: 329753
Steven Wu [Tue, 10 Apr 2018 20:16:35 +0000 (20:16 +0000)]
[MachO] Emit Weak ReadOnlyWithRel to ConstDataSection
Summary:
Darwin dynamic linker can handle weak symbols in ConstDataSection.
ReadonReadOnlyWithRel symbols should be emitted in ConstDataSection
instead of normal DataSection.
rdar://problem/
39298457
Reviewers: dexonsmith, kledzik
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D45472
llvm-svn: 329752
Alexey Bataev [Tue, 10 Apr 2018 20:10:53 +0000 (20:10 +0000)]
[OPENMP] Additional attributes for the pointer parameters.
Added attributes for better optimization of the OpenMP code.
llvm-svn: 329751
Roman Lebedev [Tue, 10 Apr 2018 20:07:06 +0000 (20:07 +0000)]
[clang-tidy][modernize]: don't forget to actually link to Tooling.
Fixes build for me:
[1/5] Linking CXX shared library lib/libclangTidyModernizeModule.so.7svn
FAILED: lib/libclangTidyModernizeModule.so.7svn
<...>
/usr/local/bin/ld.lld: error: undefined symbol: clang::tooling::fixit::internal::getText(clang::SourceRange, clang::ASTContext const&)
>>> referenced by UseAutoCheck.cpp
>>> tools/clang/tools/extra/clang-tidy/modernize/CMakeFiles/clangTidyModernizeModule.dir/UseAutoCheck.cpp.o:(clang::tidy::modernize::UseAutoCheck::replaceExpr(clang::DeclStmt const*, clang::ASTContext*, llvm::function_ref<clang::QualType (clang::Expr const*)>, llvm::StringRef))
Refs. D45405, rL329730.
llvm-svn: 329750
Roman Lebedev [Tue, 10 Apr 2018 20:07:02 +0000 (20:07 +0000)]
[clang-tidy][Fuchsia]: don't forget to actually link to Google Module.
Fixes build for me:
[1/7] Linking CXX shared library lib/libclangTidyFuchsiaModule.so.7svn
FAILED: lib/libclangTidyFuchsiaModule.so.7svn
<...>
/usr/local/bin/ld.lld: error: undefined symbol: clang::tidy::google::build::UnnamedNamespaceInHeaderCheck::UnnamedNamespaceInHeaderCheck(llvm::StringRef, clang::tidy::ClangTidyContext*)
>>> referenced by FuchsiaTidyModule.cpp
>>> tools/clang/tools/extra/clang-tidy/fuchsia/CMakeFiles/clangTidyFuchsiaModule.dir/FuchsiaTidyModule.cpp.o:(std::_Function_handler<clang::tidy::ClangTidyCheck* (llvm::StringRef, clang::tidy::ClangTidyContext*), void clang::tidy::ClangTidyCheckFactories::registerCheck<clang::tidy::google::build::UnnamedNamespaceInHeaderCheck>(llvm::StringRef)::'lambda'(llvm::StringRef, clang::tidy::ClangTidyContext*)>::_M_invoke(std::_Any_data const&, llvm::StringRef&&, clang::tidy::ClangTidyContext*&&))
Refs. D45447, rCTE329720
llvm-svn: 329749
Petr Hosek [Tue, 10 Apr 2018 19:55:55 +0000 (19:55 +0000)]
[Driver] Allow drivers to add multiple libc++ include paths
This allows toolchain drivers to add multiple libc++ include paths akin
to libstdc++. This is useful in multiarch setup when some headers might
be in target specific include directory. There should be no functional
change.
Differential Revision: https://reviews.llvm.org/D45422
llvm-svn: 329748
Daniel Neilson [Tue, 10 Apr 2018 19:51:44 +0000 (19:51 +0000)]
[IR] Refactor memset inst classes (NFC)
Summary:
A simple refactor to remove duplicate code in the definitions of
MemSetInst, AtomicMemSetInst, and AnyMemSetInst. Introduce a
templated base class that contains all of the methods unique to
a memset intrinsic, and derive these three classes from that.
llvm-svn: 329747
Jessica Paquette [Tue, 10 Apr 2018 19:46:43 +0000 (19:46 +0000)]
Recommit r329716 "Add missing nullptr check before getSection() to AArch64MachObjectWriter::recordRelocation"
This commit fixes the bot failures that were coming up before with r329716.
The fix was to move the check for "isInSection()" inside of the if condition
and emit the error there instead of waiting to get past the unreachable statement.
This should work in debug and release builds now.
llvm-svn: 329746
Jim Ingham [Tue, 10 Apr 2018 19:29:37 +0000 (19:29 +0000)]
Convert an absolute to a group relative reference for TestOptionArgParser.cpp.
llvm-svn: 329745
Daniel Neilson [Tue, 10 Apr 2018 19:23:11 +0000 (19:23 +0000)]
[IR] Refactor memtransfer inst classes (NFC)
Summary:
A simple refactor to remove duplicate code in the definitions of
MemTransferInst, AtomicMemTransferInst, and AnyMemTransferInst.
Introduce a templated base class that contains all of the methods
unique to a memory transfer intrinsic, and derive these three
classes from that.
llvm-svn: 329744
Amara Emerson [Tue, 10 Apr 2018 19:01:58 +0000 (19:01 +0000)]
[AArch64] Fix isel failure when BUILD_PAIR nodes are left over.
rdar://
39175175
llvm-svn: 329743
Gabor Buella [Tue, 10 Apr 2018 18:59:13 +0000 (18:59 +0000)]
[X86] Split up -march=icelake to -client & -server
Reviewers: craig.topper, zvi, echristo
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D45055
llvm-svn: 329742
Gabor Buella [Tue, 10 Apr 2018 18:58:26 +0000 (18:58 +0000)]
[X86] Split up -march=icelake to -client & -server
Reviewers: craig.topper, zvi, echristo
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D45056
llvm-svn: 329741
Zinovy Nis [Tue, 10 Apr 2018 18:56:29 +0000 (18:56 +0000)]
[clang-tidy] [modernize-use-auto] Fix members initialization order
llvm-svn: 329740
Nico Weber [Tue, 10 Apr 2018 18:53:28 +0000 (18:53 +0000)]
Revert r329684 (and follow-ups 329693, 329714). See discussion on https://reviews.llvm.org/D43578.
llvm-svn: 329739
Craig Topper [Tue, 10 Apr 2018 18:43:44 +0000 (18:43 +0000)]
[X86] Add test case for llvm change r329734
This test ensures the popfd instruction in MS inline assembly can properly find a clobber name for the dirflag register. Previously the register was named 'DF', but it needs to be named 'dirflag' to match the name in the GCC register name list.
llvm-svn: 329738
Artem Belevich [Tue, 10 Apr 2018 18:38:22 +0000 (18:38 +0000)]
[CUDA] Added --[no-]cuda-include-ptx=sm_XX|all option.
Currently we always include PTX into the fatbin along
with the GPU code.It about doubles the size of the GPU binary
we need to carry in the executable. These options allow control
inclusion of PTX into GPU binary.
This patch does not change the defaults, though we may consider
making no-PTX the default in the future.
Differential Revision: https://reviews.llvm.org/D45495
llvm-svn: 329737
Sanjay Patel [Tue, 10 Apr 2018 18:38:19 +0000 (18:38 +0000)]
[InstSimplify] fix formatting; NFC
llvm-svn: 329736
Volodymyr Sapsai [Tue, 10 Apr 2018 18:29:47 +0000 (18:29 +0000)]
[Parser] Fix assertion-on-invalid for unexpected typename.
In `ParseDeclarationSpecifiers` for the code
class A typename A;
we were able to annotate token `kw_typename` because it refers to
existing type. But later during processing token `annot_typename` we
failed to `SetTypeSpecType` and exited switch statement leaving
annotation token unconsumed. The code after the switch statement failed
because it didn't expect a special token.
The fix is not to assume that switch statement consumes all special
tokens and consume any token, not just non-special.
rdar://problem/
37099386
Reviewers: rsmith, arphaman
Reviewed By: rsmith
Subscribers: jkorous-apple, cfe-commits
Differential Revision: https://reviews.llvm.org/D44449
llvm-svn: 329735
Craig Topper [Tue, 10 Apr 2018 18:21:04 +0000 (18:21 +0000)]
[X86] Change the name string for the newly add DF flag register to 'dirflag' to match the clobber name supported by clang for MS inline assembly.
This should fix the failure found by Chromium reported here https://bugs.chromium.org/p/chromium/issues/detail?id=831158
The test case will be added in clang.
llvm-svn: 329734
Aaron Smith [Tue, 10 Apr 2018 18:12:49 +0000 (18:12 +0000)]
[DebugInfoPDB] Add missing test for findSymbolByRVA and findSymbolByAddr
llvm-svn: 329733
Sanjay Patel [Tue, 10 Apr 2018 18:10:14 +0000 (18:10 +0000)]
[llvm-mca] reorder text
On 2nd reading, putting the C example after the bit about
multiple regions makes this flow better.
llvm-svn: 329732
Robert Widmann [Tue, 10 Apr 2018 18:10:10 +0000 (18:10 +0000)]
[LLVM-C] Add Missing 'break's in InlineAsm bindings
Summary: Noticed by Andrea Di Biagio while reviewing r329369
Reviewers: whitequark, harlanhaskins
Reviewed By: harlanhaskins
Subscribers: llvm-commits, abergmeier-dsfishlabs
Differential Revision: https://reviews.llvm.org/D45496
llvm-svn: 329731
Zinovy Nis [Tue, 10 Apr 2018 18:05:24 +0000 (18:05 +0000)]
[clang-tidy] [modernize-use-auto] Add a threshold for minimal type name length to be replaced with 'auto'
The threshold option is 'MinTypeNameLength' with default value '5'.
With MinTypeNameLength == 5 'int'/'bool' and 'const int'/'const bool'
will not be converted to 'auto', while 'unsigned' will be.
Differential Revision: https://reviews.llvm.org/D45405
llvm-svn: 329730
Sanjay Patel [Tue, 10 Apr 2018 17:56:24 +0000 (17:56 +0000)]
[llvm-mca] fix formatting
llvm-svn: 329729
Jessica Paquette [Tue, 10 Apr 2018 17:53:41 +0000 (17:53 +0000)]
Revert 329716 "Add missing nullptr check before getSection() to AArch64MachObjectWriter::recordRelocation"
This broke a bunch of bots so I'm reverting while I figure it out.
llvm-svn: 329728
Jim Ingham [Tue, 10 Apr 2018 17:49:56 +0000 (17:49 +0000)]
Fix a typo in the gtest build target for Debug configuration.
I usually run DebugClang...
llvm-svn: 329727
Sanjay Patel [Tue, 10 Apr 2018 17:49:45 +0000 (17:49 +0000)]
[llvm-mca] add example workflow for source code
This is copied from Andrea's text in PR36875:
https://bugs.llvm.org/show_bug.cgi?id=36875
As noted there, this is a hack...but it's a good one!
It's important to show potential workflows up-front
with examples, so customers can copy and experiment
with them.
llvm-svn: 329726
Marc-Andre Laperle [Tue, 10 Apr 2018 17:34:46 +0000 (17:34 +0000)]
[clangd] Use operator<< to prevent printers issues in Gtest
Summary:
It is possible that there will be two different instantiations of
the printer template for a given type and some tests could end up calling the
wrong (default) one. For example, it was seen in CodeCompleteTests.cpp when
printing CompletionItems that it would use the wrong printer because the default
is also instantiated in ClangdTests.cpp.
With this change, objects that were previously printed with a custom Printer now
get printed through the operator<< which is declared alongside the class.
This rule of the thumb should make it less error-prone.
Reviewers: simark, ilya-biryukov, sammccall
Reviewed By: simark, ilya-biryukov, sammccall
Subscribers: bkramer, hokein, sammccall, klimek, ilya-biryukov, jkorous-apple, ioeric, MaskRay, cfe-commits
Differential Revision: https://reviews.llvm.org/D44764
llvm-svn: 329725
Aaron Smith [Tue, 10 Apr 2018 17:33:18 +0000 (17:33 +0000)]
[DebugInfoPDB] Add DIA implementations of findSymbolByRVA and findSymbolByAddr
llvm-svn: 329724
Jessica Paquette [Tue, 10 Apr 2018 17:32:12 +0000 (17:32 +0000)]
Fix test failure in arm64-no-section.ll
There was a missing not line. Also, tail call before ret -> call before ret.
llvm-svn: 329723
Jim Ingham [Tue, 10 Apr 2018 17:20:27 +0000 (17:20 +0000)]
Fix the Xcode build for the addition of OptionArgsParser.
llvm-svn: 329722
Julie Hockett [Tue, 10 Apr 2018 16:53:51 +0000 (16:53 +0000)]
[clang-tidy] Adding alias for anon namespaces in header (fuchsia module)
Adding alias to google-build-namespaces to the Fuchsia module (checks
for anonymous namespaces in headers).
Differential Revision: https://reviews.llvm.org/D45447
llvm-svn: 329720
Krzysztof Parzyszek [Tue, 10 Apr 2018 16:46:13 +0000 (16:46 +0000)]
[CodeGen] Fix printing bundles in MIR output
Delay printing the newline until after the opening bracket was
printed, e.g.
BUNDLE implicit-def $r1, implicit-def $r21, implicit $r1 {
renamable $r1 = S2_asr_i_r renamable $r1, 1
renamable $r21 = A2_tfrsi 0
}
instead of
BUNDLE implicit-def $r1, implicit-def $r21, implicit $r1
{ renamable $r1 = S2_asr_i_r renamable $r1, 1
renamable $r21 = A2_tfrsi 0
}
llvm-svn: 329719
Peter Collingbourne [Tue, 10 Apr 2018 16:19:30 +0000 (16:19 +0000)]
Revert r329611, "AArch64: Allow offsets to be folded into addresses with ELF."
Caused a build failure in check-tsan.
llvm-svn: 329718
Sam Clegg [Tue, 10 Apr 2018 16:12:49 +0000 (16:12 +0000)]
[WebAssembly] Add support for custom sections
Copy user-defined custom sections into the output, concatenating
sections with the same name.
Differential Revision: https://reviews.llvm.org/D45340
llvm-svn: 329717
Jessica Paquette [Tue, 10 Apr 2018 15:53:28 +0000 (15:53 +0000)]
Add missing nullptr check to AArch64MachObjectWriter::recordRelocation
There was missing nullptr check before a call to getSection() in
recordRelocation. This would result in a segfault in code like the attached
test.
This adds the missing check and a test which makes sure we get the expected
error output.
llvm-svn: 329716
Nicolai Haehnle [Tue, 10 Apr 2018 15:46:43 +0000 (15:46 +0000)]
AMDGPU/MC: Allow disassembling without symbol info
Summary:
We would like the UMR debugging tool[0] to be able to provide
disassembly for currently live waves based on plain memory
dumps, and we want to leverage the LLVM disassembler for this.
This mostly works, except that UMR clearly can't provide real
symbol info, so it wants to set DisInfo == nullptr.
[0] https://cgit.freedesktop.org/amd/umr/
Reviewers: arsenm, rampitec, artem.tamazov, dp
Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D45477
Change-Id: Ibb2c5af2e66f2e100b4702fd81308e1932bc4ee6
llvm-svn: 329715
Andrew V. Tischenko [Tue, 10 Apr 2018 15:45:43 +0000 (15:45 +0000)]
I removed the failed test.
llvm-svn: 329714
Guansong Zhang [Tue, 10 Apr 2018 15:28:31 +0000 (15:28 +0000)]
[OpenMP] Remove extra warning when we build
Summary:
This one line change is to remove this warning message
"warning: integer conversion resulted in a change of sign"
Reviewers: grokos
Reviewed By: grokos
Subscribers: openmp-commits
Tags: #openmp
Differential Revision: https://reviews.llvm.org/D45415
llvm-svn: 329713
Aaron Smith [Tue, 10 Apr 2018 15:25:04 +0000 (15:25 +0000)]
[PDB] Remove dead code and run clang format; NFC
llvm-svn: 329712
Andrea Di Biagio [Tue, 10 Apr 2018 15:14:15 +0000 (15:14 +0000)]
[llvm-mca] Simplify code. NFC
llvm-svn: 329711
Gabor Buella [Tue, 10 Apr 2018 15:03:03 +0000 (15:03 +0000)]
[X86] Disable SGX for Skylake Server - CPP test
Summary: Fix test case - corresponding to r329701
Reviewers: craig.topper, davezarzycki
Reviewed By: davezarzycki
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D45488
llvm-svn: 329710
Chad Rosier [Tue, 10 Apr 2018 14:57:13 +0000 (14:57 +0000)]
Fix spelling. NFC.
llvm-svn: 329709
Andrea Di Biagio [Tue, 10 Apr 2018 14:55:14 +0000 (14:55 +0000)]
[llvm-mca] Move the logic that prints dispatch unit statistics from BackendStatistics to its own view.
This patch moves the logic that collects and analyzes dispatch events to the
DispatchStatistics view.
Added flag -dispatch-stats to print statistics related to the dispatch logic.
llvm-svn: 329708
Aaron Smith [Tue, 10 Apr 2018 14:47:12 +0000 (14:47 +0000)]
[pdbutil] Print the checksum hex string when using the '-lines' option
llvm-svn: 329707
Kostya Kortchinsky [Tue, 10 Apr 2018 14:41:40 +0000 (14:41 +0000)]
[sanitizer] Allow BackgroundThread to not depend on StackDepot v2
Summary:
This is a redo of D45296.
It looks like the random stack-protector issues I was getting were coming from
my Android emulator, and updating everything all around and relaunching stuff
ended up making it go away.
I guess I'll have to see how it behaves on the bots.
Only additional change from the previous CL is some `const` were appropriate.
Reviewers: alekseyshl
Reviewed By: alekseyshl
Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits
Differential Revision: https://reviews.llvm.org/D45461
llvm-svn: 329706
Pavel Labath [Tue, 10 Apr 2018 14:23:41 +0000 (14:23 +0000)]
[CodeGen/Dwarf] Rename the "sizetype" synthetic type and add it to the accelerator table
Summary:
This type is created on-demand and used as the base type for array
ranges. Since it is "special", its construction did not go through the
createTypeDIE function and so it was never inserted into the accelerator
table, although it clearly belongs there.
I add an explicit addAccelType call to insert it into the table.
During review, we also decided to rename the type to something more
unique to avoid confusion in case the user has own "sizetype" type. The
new name for the type size __ARRAY_SIZE_TYPE__.
Reviewers: JDevlieghere, aprantl, dblaikie
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D45445
llvm-svn: 329705
Simon Pilgrim [Tue, 10 Apr 2018 14:21:33 +0000 (14:21 +0000)]
Fix whitespace indentation. NFCI.
llvm-svn: 329704
Pavel Labath [Tue, 10 Apr 2018 14:11:53 +0000 (14:11 +0000)]
[Testing/Support] Make Failed() matcher work with abstract error types
Failed<ErrorInfoBase>() did not compile, because it was attempting to
create a copy of the Error object when passing it to the nested matcher,
which was not possible because ErrorInfoBase is abstract.
This commit fixes the problem by making sure we pass the ErrorInfo
object by reference, which also improves the handling of non-abstract
objects, as we avoid potentially slicing an object during the copy.
llvm-svn: 329703
Nico Weber [Tue, 10 Apr 2018 14:08:25 +0000 (14:08 +0000)]
Attempt to fix Windows build after r329698.
llvm-svn: 329702
Gabor Buella [Tue, 10 Apr 2018 14:04:21 +0000 (14:04 +0000)]
[X86] Disable SGX for Skylake Server
Reviewers: craig.topper, zvi, echristo
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D45058
llvm-svn: 329701
Gabor Buella [Tue, 10 Apr 2018 13:58:57 +0000 (13:58 +0000)]
[X86] Disable SGX for Skylake Server
Reviewers: craig.topper, zvi, echristo
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D45057
llvm-svn: 329700
Nico Weber [Tue, 10 Apr 2018 13:36:38 +0000 (13:36 +0000)]
Use llvm::sys::fs::real_path() in clang.
No expected behavior change.
https://reviews.llvm.org/D45165
llvm-svn: 329698
Nico Weber [Tue, 10 Apr 2018 13:33:45 +0000 (13:33 +0000)]
s/LLVM_ON_WIN32/_WIN32/, lldb
LLVM_ON_WIN32 is set exactly with MSVC and MinGW (but not Cygwin) in
HandleLLVMOptions.cmake, which is where _WIN32 defined too. Just use the
default macro instead of a reinvented one.
See thread "Replacing LLVM_ON_WIN32 with just _WIN32" on llvm-dev and cfe-dev.
No intended behavior change.
llvm-svn: 329697
Nico Weber [Tue, 10 Apr 2018 13:15:21 +0000 (13:15 +0000)]
s/LLVM_ON_WIN32/_WIN32/, lld
LLVM_ON_WIN32 is set exactly with MSVC and MinGW (but not Cygwin) in
HandleLLVMOptions.cmake, which is where _WIN32 defined too. Just use the
default macro instead of a reinvented one.
See thread "Replacing LLVM_ON_WIN32 with just _WIN32" on llvm-dev and cfe-dev.
No intended behavior change.
llvm-svn: 329696
Nico Weber [Tue, 10 Apr 2018 13:14:03 +0000 (13:14 +0000)]
s/LLVM_ON_WIN32/_WIN32/, clang-tools-extra
LLVM_ON_WIN32 is set exactly with MSVC and MinGW (but not Cygwin) in
HandleLLVMOptions.cmake, which is where _WIN32 defined too. Just use the
default macro instead of a reinvented one.
See thread "Replacing LLVM_ON_WIN32 with just _WIN32" on llvm-dev and cfe-dev.
No intended behavior change.
llvm-svn: 329695
Andrea Di Biagio [Tue, 10 Apr 2018 12:50:03 +0000 (12:50 +0000)]
[llvm-mca] Increase the default number of iterations to 100.
llvm-svn: 329694
Andrew V. Tischenko [Tue, 10 Apr 2018 12:17:01 +0000 (12:17 +0000)]
The test was fixed.
llvm-svn: 329693
David Green [Tue, 10 Apr 2018 11:37:21 +0000 (11:37 +0000)]
[DA] Improve alias checking in dependence analysis
Improve the alias analysis to account for cases where we
know that src/dst pairs cannot alias due to things like
TBAA. As we know they are noalias, we know no dependency
can occur. Also fixes issues around the size parameter
to AA being incorrect.
Differential Revision: https://reviews.llvm.org/D42381
llvm-svn: 329692
Francis Visoiu Mistrih [Tue, 10 Apr 2018 11:29:40 +0000 (11:29 +0000)]
[AArch64] Use FP to access the emergency spill slot
In the presence of variable-sized stack objects, we always picked the
base pointer when resolving frame indices if it was available.
This makes us hit an assert where we can't reach the emergency spill
slot if it's too far away from the base pointer. Since on AArch64 we
decide to place the emergency spill slot at the top of the frame, it
makes more sense to use FP to access it.
The changes here don't affect only emergency spill slots but all the
frame indices. The goal here is to try to choose between FP, BP and SP
so that we minimize the offset and avoid scavenging, or worse, asserting
when trying to access a slot allocated by the scavenger.
Previously discussed here: https://reviews.llvm.org/D40876.
Differential Revision: https://reviews.llvm.org/D45358
llvm-svn: 329691
Tim Renouf [Tue, 10 Apr 2018 11:25:15 +0000 (11:25 +0000)]
[AMDGPU] For OS type AMDPAL, fixed scratch on compute shader
Summary:
For OS type AMDPAL, the scratch descriptor is loaded from offset 0 of
the GIT, whose 32 bit pointer is in s0 (s8 for gfx9 merged shaders).
This commit fixes that to use offset 0x10 instead of offset 0 for a
compute shader, per the PAL ABI spec.
V2: Ensure s0 (s8 for gfx9 merged shader) is marked live-in when loading
scratch descriptor from GIT.
Reviewers: kzhuravl, nhaehnle, timcorringham
Subscribers: kzhuravl, wdng, yaxunl, t-tye, llvm-commits, dstuttard, nhaehnle, arsenm
Differential Revision: https://reviews.llvm.org/D44468
Change-Id: I93dffa647758e37f613bb5e0dfca840d82e6d26f
llvm-svn: 329690
Gabor Buella [Tue, 10 Apr 2018 11:20:05 +0000 (11:20 +0000)]
CodeGen tests - typo fixes NFC
llvm-svn: 329689
Simon Dardis [Tue, 10 Apr 2018 11:09:17 +0000 (11:09 +0000)]
[compiler-rt][asan][mips] UnXFAIL some consistently passing tests
llvm-svn: 329688
Tim Northover [Tue, 10 Apr 2018 11:04:29 +0000 (11:04 +0000)]
AArch64: diagnose unpredictable store-exclusive instructions
Much like any written register in load/store instructions, the status register
is not allowed to overlap with any others. So diagnose it like we already do
with the other cases.
llvm-svn: 329687
Andrea Di Biagio [Tue, 10 Apr 2018 10:49:41 +0000 (10:49 +0000)]
[X86][Broadwell] HWPort5 should not be added to BroadwellModelProcResources.
The BroadwellModelProcResources had an entry for HWPort5, which is a Haswell
resource, and not a Broadwell processor resource. That entry was added to the
Broadwell model because variable blends were consuming it.
This was clearly a typo (the resource name should have been BWPort5), which
unfortunately was never caught before. It was not reported as an error because
HWPort5 is a resource defined by the Haswell model. It has been found when
testing some code with llvm-mca: the list of resources in the resource pressure
view was odd.
This patch fixes the issue; now variable blend instructions consume 2 cycles on
BWPort5 instead of HWPort5. This is enough to get rid of the extra (spurious)
entry in the BroadWellModelProcResources table.
llvm-svn: 329686
Sam McCall [Tue, 10 Apr 2018 10:36:46 +0000 (10:36 +0000)]
[Tooling] fix UB when interpolating compile commands with an empty index
llvm-svn: 329685
Andrew V. Tischenko [Tue, 10 Apr 2018 10:34:13 +0000 (10:34 +0000)]
-ftime-report switch support in Clang.
The current support of the feature produces only 2 lines in report:
-Some general Code Generation Time;
-Total time of Backend Consumer actions.
This patch extends Clang time report with new lines related to Preprocessor, Include Filea Search, Parsing, etc.
Differential Revision: https://reviews.llvm.org/D43578
llvm-svn: 329684
Alexandre Ganea [Tue, 10 Apr 2018 10:26:23 +0000 (10:26 +0000)]
[llvm-ar] Temporarily make the tool case detection test Windows-only to fix the build (introduced in r329658)
llvm-svn: 329683
Pavel Labath [Tue, 10 Apr 2018 10:07:22 +0000 (10:07 +0000)]
Args: replace isprint8 usage with isprint
It looks like we introduced isprint8 way back in r169417 to be used on
getopt's short_options, which we sometimes set to values which are out
of range for normal chars to indicate options with no short form.
However, this is not how the function is used in the Args class, where
we explicitly process a string character by character.
This removes the last external dependency from the Args class.
llvm-svn: 329682
Sander de Smalen [Tue, 10 Apr 2018 10:03:13 +0000 (10:03 +0000)]
[AArch64][SVE] Asm: Add support for unpredicated LSL/LSR (shift by immediate) instructions.
Reviewers: rengolin, fhahn, javed.absar, SjoerdMeijer, huntergr, t.p.northover, echristo, evandro
Reviewed By: rengolin, fhahn
Subscribers: tschuett, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D45371
llvm-svn: 329681
Andrea Di Biagio [Tue, 10 Apr 2018 09:55:33 +0000 (09:55 +0000)]
Reapply "[llvm-mca] Do not separate iterations with a newline in the timeline view."
This reapplies r329403 with a fix for the floating point rounding issue.
llvm-svn: 329680
Pavel Labath [Tue, 10 Apr 2018 09:48:05 +0000 (09:48 +0000)]
Move OptionElementVector helper structs from Args to Options
These are not used anywhere in the Args class. They should have been
moved as a part of r327110 (Moving Option parsing from Args to Options),
but I did not notice them then.
This does not affect the layering in any way, but in makes sense for the
structs to be defined in the near the code that uses them.
llvm-svn: 329679
George Rimar [Tue, 10 Apr 2018 09:44:44 +0000 (09:44 +0000)]
[ELF] - Do not crash when trying to order --defsym/linker script symbols.
Currently, we crash because File is null for
such symbols.
Differential revision: https://reviews.llvm.org/D45440
llvm-svn: 329678
Pavel Labath [Tue, 10 Apr 2018 09:03:59 +0000 (09:03 +0000)]
Move Args::StringTo*** functions to a new OptionArgParser class
Summary:
The idea behind this is to move the functionality which depend on other lldb
classes into a separate class. This way, the Args class can be turned
into a lightweight arc+argv wrapper and moved into the lower lldb
layers.
Reviewers: jingham, zturner
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D44306
llvm-svn: 329677
Clement Courbet [Tue, 10 Apr 2018 08:43:46 +0000 (08:43 +0000)]
[MC][TableGen] Fix r329675.
Caught by bots with -Wmissing-braces.
llvm-svn: 329676
Clement Courbet [Tue, 10 Apr 2018 08:16:37 +0000 (08:16 +0000)]
[MC][TableGen] Add optional libpfm counter names for ProcResUnits.
Summary:
Subtargets can define the libpfm counter names that can be used to
measure cycles and uops issued on ProcResUnits.
This allows making llvm-exegesis available on more targets.
Fixes PR36984.
Reviewers: gchatelet, RKSimon, andreadb, craig.topper
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D45360
llvm-svn: 329675
Sander de Smalen [Tue, 10 Apr 2018 07:01:53 +0000 (07:01 +0000)]
[AArch64][SVE] Asm: Add support for SVE INDEX instructions.
Reviewers: rengolin, fhahn, javed.absar, SjoerdMeijer, huntergr, t.p.northover, echristo, evandro
Reviewed By: rengolin, fhahn
Subscribers: tschuett, llvm-commits, kristof.beyls
Differential Revision: https://reviews.llvm.org/D45370
llvm-svn: 329674
Chandler Carruth [Tue, 10 Apr 2018 06:40:51 +0000 (06:40 +0000)]
[x86] Model the direction flag (DF) separately from the rest of EFLAGS.
This cleans up a number of operations that only claimed te use EFLAGS
due to using DF. But no instructions which we think of us setting EFLAGS
actually modify DF (other than things like popf) and so this needlessly
creates uses of EFLAGS that aren't really there.
In fact, DF is so restrictive it is pretty easy to model. Only STD, CLD,
and the whole-flags writes (WRFLAGS and POPF) need to model this.
I've also somewhat cleaned up some of the flag management instruction
definitions to be in the correct .td file.
Adding this extra register also uncovered a failure to use the correct
datatype to hold X86 registers, and I've corrected that as necessary
here.
Differential Revision: https://reviews.llvm.org/D45154
llvm-svn: 329673
Petr Hosek [Tue, 10 Apr 2018 05:54:36 +0000 (05:54 +0000)]
[sanitizer] Enable threads for libc++ build used by the symbolizer
Disabling threads makes <atomic> unusable, but this is needed by LLVM
libraries that are dependencies of the symbolizer.
Differential Revision: https://reviews.llvm.org/D45424
llvm-svn: 329672
Akira Hatanaka [Tue, 10 Apr 2018 05:15:01 +0000 (05:15 +0000)]
[ExprConstant] Use an AST node and a version number as a key to create
an APValue and retrieve it from map Temporaries.
The version number is needed when a single AST node is visited multiple
times and is used to create APValues that are required to be distinct
from each other (for example, MaterializeTemporaryExprs in default
arguments and VarDecls in loops).
rdar://problem/
36505742
Differential Revision: https://reviews.llvm.org/D42776
llvm-svn: 329671
Craig Topper [Tue, 10 Apr 2018 03:44:15 +0000 (03:44 +0000)]
[X86] Prevent folding loads with 64-bit ANDs with immediates that fit in 32-bits.
Prefer to use the 32-bit AND with immediate instead.
Primarily I'm doing this to ensure that immediates created by shrinkAndImmediate will always get absorbed into the AND. But I do believe this would be a reduction in the number of uops that need to execute. Ideally we should shrink the 'and' and the 'load' during DAG combine to re-enable the fold.
Fixes PR37063.
llvm-svn: 329667
Michael Zolotukhin [Tue, 10 Apr 2018 03:40:29 +0000 (03:40 +0000)]
Revert "[PR16756] Use SSAUpdaterBulk in JumpThreading." one more time.
This reverts r329661. Bots are still unhappy.
llvm-svn: 329666