Craig Topper [Thu, 15 Nov 2018 08:23:37 +0000 (08:23 +0000)]
[X86] Add -x86-experimental-vector-widening-legalization versions of shuffle-vs-trunc tests.
llvm-svn: 346935
Martin Storsjo [Thu, 15 Nov 2018 08:20:18 +0000 (08:20 +0000)]
[ELF] Fix compilation with GCC 5
Remove the default initializer for TrapInstr; all subclasses overwrite
the defaults in their constructors anyway.
This fixes compilation errors like these, with GCC 5.4 on Ubuntu 16.04,
present since SVN r346893:
In file included from ../tools/lld/ELF/Arch/AArch64.cpp:12:0:
../tools/lld/ELF/Target.h:125:49: error: array must be initialized with a brace-enclosed initializer
std::array<uint8_t, 4> TrapInstr = {0, 0, 0, 0};
^
../tools/lld/ELF/Target.h:125:49: error: too many initializers for ‘std::array<unsigned char, 4ul>’
Differential Revision: https://reviews.llvm.org/D54569
llvm-svn: 346934
Eric Fiselier [Thu, 15 Nov 2018 07:29:56 +0000 (07:29 +0000)]
propagate __config_site includes when building benchmarks
llvm-svn: 346933
Zachary Turner [Thu, 15 Nov 2018 05:06:59 +0000 (05:06 +0000)]
Fix a use-after-free of the ABI plugin.
This was introduced in r346775. Previously the ABI shared_ptr
was declared as a function local static meaning it would live
forever. After the change, someone has to create a strong
reference to it or it will go away. In this code, we were
calling ABI::FindPlugin(...).get(), so it was being immediately
destroyed and we were holding onto a dangling pointer.
llvm-svn: 346932
Thomas Lively [Thu, 15 Nov 2018 03:38:59 +0000 (03:38 +0000)]
[WebAssembly] Renumber SIMD bitwise instructions
Summary: Changed to match https://github.com/WebAssembly/simd/pull/54.
Reviewers: aheejin
Subscribers: dschuff, sbc100, jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D54561
llvm-svn: 346931
David Blaikie [Thu, 15 Nov 2018 03:04:23 +0000 (03:04 +0000)]
NFC cleanup: Prefer make_unique over reset(new T())
llvm-svn: 346929
David Blaikie [Thu, 15 Nov 2018 03:04:21 +0000 (03:04 +0000)]
Fix combining pragma __debug dump & parser_crash with -E
Previously these would be transformed into annotation tokens and the
preprocessor would then assume they were real tokens with source
locations and assert/UB.
Other pragmas that produce annotation tokens aren't a problem because
they aren't handled if the parser isn't hooked up - ParsePragma.cpp
registers those handlers & isn't run for pure preprocessing. So they're
treated as unknown pragmas & printed verbatim by the preprocessor.
Perhaps these pragmas should be treated the same way? But they got mixed
in with other __debug pragmas that do need to be handled during
preprocessing.
The third __debug pragma that produces an annotation token is 'captured'
- which had its own fix for this issue - by not inserting the annotation
token in the first place if it detected that it was in preprocessing
mode. I've removed that fix (from Lex/Pragma.cpp) in favor of the more
general one in Frontend/PrintPreprocessedOutput.cpp.
llvm-svn: 346928
David Blaikie [Thu, 15 Nov 2018 03:04:19 +0000 (03:04 +0000)]
Rewrite-imports on crash: Simplify handling
-frewrite-imports already implies -frewrite-includes (it piggy-backs
on/extends the implementation) so there's no need to conditionally pass
-frewrite-includes when already using -frewrite-imports (& especially I
don't think these would want to be different between crash reporting and
not crash reporting)
llvm-svn: 346927
David Blaikie [Thu, 15 Nov 2018 03:04:18 +0000 (03:04 +0000)]
Stmt bits: Make ExprBits relative to StmtBits
Seems like it makes it a bit easier to read/validate/update in the
future.
llvm-svn: 346926
Konstantin Zhuravlyov [Thu, 15 Nov 2018 02:42:04 +0000 (02:42 +0000)]
AMDGPU: Fix check lines in fdot2 test:
GCN900 -> GFX900
llvm-svn: 346925
Xing GUO [Thu, 15 Nov 2018 02:36:20 +0000 (02:36 +0000)]
[commit-test] Add blank line for test/tools/llvm-objdump/symbol-table-elf.test
Summary: Test commit
Reviewers: Higuoxing
Reviewed By: Higuoxing
Subscribers: llvm-commits, Higuoxing
Differential Revision: https://reviews.llvm.org/D54562
llvm-svn: 346924
Konstantin Zhuravlyov [Thu, 15 Nov 2018 02:32:43 +0000 (02:32 +0000)]
AMDGPU: Enable code object v3 for AMDHSA only
Differential Revision: https://reviews.llvm.org/D54186
llvm-svn: 346923
Jonas Devlieghere [Thu, 15 Nov 2018 01:18:16 +0000 (01:18 +0000)]
Fix copy/paste mistake for r346919.
llvm-svn: 346921
Jonas Devlieghere [Thu, 15 Nov 2018 01:18:15 +0000 (01:18 +0000)]
Add setting to require hardware breakpoints.
When debugging read-only memory we cannot use software breakpoint. We
already have support for hardware breakpoints and users can specify them
with `-H`. However, there's no option to force LLDB to use hardware
breakpoints internally, for example while stepping.
This patch adds a setting target.require-hardware-breakpoint that forces
LLDB to always use hardware breakpoints. Because hardware breakpoints
are a limited resource and can fail to resolve, this patch also extends
error handling in thread plans, where breakpoints are used for stepping.
Differential revision: https://reviews.llvm.org/D54221
llvm-svn: 346920
Jonas Devlieghere [Thu, 15 Nov 2018 01:05:40 +0000 (01:05 +0000)]
[reproducer] Post-commit cleanup
After committing the initial reproducer feature I noticed a few small
issues which warranted addressing here. It fixes incorrect documentation
in the command object and extract some duplicated code into the debugger
object.
llvm-svn: 346919
Sam Clegg [Thu, 15 Nov 2018 00:37:21 +0000 (00:37 +0000)]
[WebAssembly] Initial support for shared objects (-shared)
Based on the initial spec proposal:
https://github.com/WebAssembly/tool-conventions/blob/master/DynamicLinking.md
The llvm/codegen side of this is still missing but I believe this change is
still worth landing as an incremental step
Differential Revision: https://reviews.llvm.org/D54249
llvm-svn: 346918
Eric Fiselier [Thu, 15 Nov 2018 00:27:06 +0000 (00:27 +0000)]
Work around C++03 decltype limitations
llvm-svn: 346917
Craig Topper [Thu, 15 Nov 2018 00:21:41 +0000 (00:21 +0000)]
[X86] Don't mark SEXTLOADS with narrow types as Custom with -x86-experimental-vector-widening-legalization.
The narrow types end up requesting widening, but generic legalization will end up scalaring and using a build_vector to do the widening.
llvm-svn: 346916
JF Bastien [Thu, 15 Nov 2018 00:19:18 +0000 (00:19 +0000)]
CGDecl::emitStoresForConstant fix synthesized constant's name
Summary: The name of the synthesized constants for constant initialization was using mangling for statics, which isn't generally correct and (in a yet-uncommitted patch) causes the mangler to assert out because the static ends up trying to mangle function parameters and this makes no sense. Instead, mangle to `"__const." + FunctionName + "." + DeclName`.
Reviewers: rjmccall
Subscribers: dexonsmith, cfe-commits
Differential Revision: https://reviews.llvm.org/D54055
llvm-svn: 346915
Eric Fiselier [Thu, 15 Nov 2018 00:11:02 +0000 (00:11 +0000)]
Get tests compiling with -Wunused-local-typedef
llvm-svn: 346914
Jessica Paquette [Thu, 15 Nov 2018 00:02:24 +0000 (00:02 +0000)]
[MachineOutliner][NFC] Check if CandidatesForRepeatedSeq < 2
There's no reason to call getOutliningCandidateInfo with a single candidate.
llvm-svn: 346913
Stephan T. Lavavej [Wed, 14 Nov 2018 23:23:55 +0000 (23:23 +0000)]
[libcxx] [test] Fix Clang -Wunused-local-typedef warnings.
C++11's [hash.requirements] never required these typedefs from users.
llvm-svn: 346912
Stephan T. Lavavej [Wed, 14 Nov 2018 23:23:51 +0000 (23:23 +0000)]
[libcxx] [test] Include <cassert> for assert().
This fixes compiler errors with MSVC's STL.
llvm-svn: 346911
Stephan T. Lavavej [Wed, 14 Nov 2018 23:23:46 +0000 (23:23 +0000)]
[libcxx] [test] Fix MSVC warning C4800.
This was implicitly converting [1, 3] to bool, which triggers
an MSVC warning. The test should just pass `true`, which is
simpler, has the same behavior, and avoids the warning. (This
is a library test, not a compiler test, and the conversion happens
before calling `push_back`, so passing [1, 3] isn't interesting
in any way. This resembles a previous change to stop passing
`1 == 1` in the `vector<bool>` tests.)
llvm-svn: 346910
Benjamin Kramer [Wed, 14 Nov 2018 23:13:27 +0000 (23:13 +0000)]
[X86] Remove unused variable
llvm-svn: 346909
Craig Topper [Wed, 14 Nov 2018 23:02:09 +0000 (23:02 +0000)]
[X86] Support v2i32/v4i16/v8i8 load/store using f64 on 32-bit targets under -x86-experimental-vector-widening-legalization.
On 64-bit targets the type legalizer will use i64 to legalize these. But when i64 isn't legal, the type legalizer won't try an FP type. So do it manually instead.
There are a few regressions in here due to some v2i32 operations like mul and div now being reassembled into a full vector just to store instead of storing the pieces. But this was already occuring in 64-bit mode so its not a new issue.
llvm-svn: 346908
Reid Kleckner [Wed, 14 Nov 2018 22:59:27 +0000 (22:59 +0000)]
[codeview] Make "clang -g" emit codeview by default when targetting MSVC
Summary:
If you're using the Microsoft ABI, chances are that you want PDBs and
codeview debug info. Currently, everyone has to remember to specific
-gcodeview by default, when it would be nice if the standard -g option
did the right thing by default.
Also, do some related cleanup of -cc1 options. When targetting the MS
C++ ABI, we probably shouldn't pass -debugger-tuning=gdb. We were also
passing -gcodeview twice, which is silly.
Reviewers: smeenai, zturner
Subscribers: aprantl, JDevlieghere, llvm-commits
Differential Revision: https://reviews.llvm.org/D54499
llvm-svn: 346907
Adrian Prantl [Wed, 14 Nov 2018 22:54:43 +0000 (22:54 +0000)]
Remove the expectedFlakeyDsym decorator. It's not useful anymore.
llvm-svn: 346906
Eric Fiselier [Wed, 14 Nov 2018 22:49:42 +0000 (22:49 +0000)]
Attempt to show progress bar in benchmark tests
llvm-svn: 346905
Eric Fiselier [Wed, 14 Nov 2018 22:48:43 +0000 (22:48 +0000)]
Exclude check-cxx-benchmarks from the global test target.
llvm-svn: 346904
Simon Pilgrim [Wed, 14 Nov 2018 22:44:08 +0000 (22:44 +0000)]
[X86] Update masked expandload/compressstore test names
llvm-svn: 346903
Sanjay Patel [Wed, 14 Nov 2018 22:34:25 +0000 (22:34 +0000)]
[InstSimplify] add more tests for funnel shift with select; NFC
The cases are just different enough that we should have
complete tests to avoid bugs from typos in the code.
llvm-svn: 346902
Jessica Paquette [Wed, 14 Nov 2018 22:23:38 +0000 (22:23 +0000)]
[MachineOutliner][NFC] Don't compute liveness if X16/X17/NZCV are unused
Using the MBB flags, we can tell if X16/X17/NZCV are unused in a block,
and also not live out.
If this holds for all MBBs, then we can avoid checking for liveness on
that candidate. Furthermore, if it holds for an individual candidate's
MBB, then we can avoid checking for liveness on that candidate.
llvm-svn: 346901
Jason Molenda [Wed, 14 Nov 2018 22:14:07 +0000 (22:14 +0000)]
update xcode project file for reproducers.
llvm-svn: 346900
Teresa Johnson [Wed, 14 Nov 2018 21:57:51 +0000 (21:57 +0000)]
Remove unused getMDNodeFwdRefOrNull interfaces (NFC)
Summary:
Followup from D53596/r346891. Remove the getMDNodeFwdRefOrNull interface
to the MDLoader since it is no longer used. Also improve error messages
when the internal implementation is used within the MDLoader.
Reviewers: steven_wu
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D54542
llvm-svn: 346899
Simon Pilgrim [Wed, 14 Nov 2018 21:31:50 +0000 (21:31 +0000)]
[X86][SSE] Add SSE2/SSE42 masked load/store tests
Now that the load/store tests are split the impact of running the tests on multiple (illegal) targets is a lot less impactful
llvm-svn: 346896
Nirav Dave [Wed, 14 Nov 2018 21:11:53 +0000 (21:11 +0000)]
Bias physical register immediate assignments
The machine scheduler currently biases register copies to/from
physical registers to be closer to their point of use / def to
minimize their live ranges. This change extends this to also physical
register assignments from immediate values.
This causes a reduction in reduction in overall register pressure and
minor reduction in spills and indirectly fixes an out-of-registers
assertion (PR39391).
Most test changes are from minor instruction reorderings and register
name selection changes and direct consequences of that.
Reviewers: MatzeB, qcolombet, myatsina, pcc
Subscribers: nemanjai, jvesely, nhaehnle, eraman, hiraditya,
javed.absar, arphaman, jfb, jsji, llvm-commits
Differential Revision: https://reviews.llvm.org/D54218
llvm-svn: 346894
Simon Atanasyan [Wed, 14 Nov 2018 21:05:20 +0000 (21:05 +0000)]
[ELF] Make TrapInstr and Filler byte arrays. NFC.
The uint32_t type does not clearly convey that these fields are interpreted
in the target endianness. Converting them to byte arrays should make this
more obvious and less error-prone.
Patch by James Clarke
Differential Revision: http://reviews.llvm.org/D54207
llvm-svn: 346893
Richard Smith [Wed, 14 Nov 2018 21:04:34 +0000 (21:04 +0000)]
[c++20] Implement P0482R6: enable -fchar8_t by default in C++20 mode.
This unfortunately results in a substantial breaking change when
switching to C++20, but it's not yet clear what / how much we should
do about that. We may want to add a compatibility conversion from
u8 string literals to const char*, similar to how C++98 provided a
compatibility conversion from string literals to non-const char*,
but that's not handled by this patch.
The feature can be disabled in C++20 mode with -fno-char8_t.
llvm-svn: 346892
Teresa Johnson [Wed, 14 Nov 2018 20:58:04 +0000 (20:58 +0000)]
[ThinLTO] Fix a crash in lazy loading of Metadata
This is a revised version of D41474.
When the debug location is parsed in BitcodeReader::parseFunction, the
scope and inlinedAt MDNodes are obtained via MDLoader->getMDNodeFwdRefOrNull(),
which will create a forward ref if they were not yet loaded.
Specifically, if one of these MDNodes is in the module level metadata
block, and this is during ThinLTO importing, that metadata block is
lazily loaded.
Most places in that invoke getMDNodeFwdRefOrNull have a corresponding call
to resolveForwardRefsAndPlaceholders which will take care of resolving them.
E.g. places that call getMetadataFwdRefOrLoad, or at the end of parsing a
function-level metadata block, or at the end of the initial lazy load of
module level metadata in order to handle invocations of getMDNodeFwdRefOrNull
for named metadata and global object attachments. However, the calls for
the scope/inlinedAt of debug locations are not backed by any such call to
resolveForwardRefsAndPlaceholders.
To fix this, change the scope and inlinedAt parsing to instead use
getMetadataFwdRefOrLoad, which will ensure the forward refs to lazily
loaded metadata are resolved.
Fixes PR35472.
llvm-svn: 346891
Simon Pilgrim [Wed, 14 Nov 2018 20:44:59 +0000 (20:44 +0000)]
[X86] Split masked load/store test files
llvm-svn: 346889
Eric Fiselier [Wed, 14 Nov 2018 20:38:46 +0000 (20:38 +0000)]
Rename cxx-benchmark-unittests target and convert to LIT.
This patch renames the cxx-benchmark-unittests to check-cxx-benchmarks
and converts the target to use LIT in order to make the tests run faster
and provide better output.
In particular this runs each benchmark in a suite one by one, allowing
more parallelism while ensuring output isn't garbage with multiple threads.
Additionally, it adds the CMake flag '-DLIBCXX_BENCHMARK_TEST_ARGS=<list>'
to specify what options are passed when running the benchmarks.
llvm-svn: 346888
Simon Pilgrim [Wed, 14 Nov 2018 20:25:50 +0000 (20:25 +0000)]
[X86] Update masked load/store test names
llvm-svn: 346887
Aakanksha Patil [Wed, 14 Nov 2018 20:10:41 +0000 (20:10 +0000)]
AMDGPU: Additional pattern for i16 median3 matching
min(max(a, b), max(min(a, b), c))
Differential Revision: https://reviews.llvm.org/D54494
llvm-svn: 346886
Vedant Kumar [Wed, 14 Nov 2018 19:53:41 +0000 (19:53 +0000)]
Mark @llvm.trap cold
A call to @llvm.trap can be expected to be cold (i.e. unlikely to be
reached in a normal program execution).
Outlining paths which unconditionally trap is an important memory
saving. As the hot/cold splitting pass (imho) should not treat all
noreturn calls as cold, explicitly mark @llvm.trap cold so that it can
be outlined.
Split out of https://reviews.llvm.org/D54244.
Differential Revision: https://reviews.llvm.org/D54329
llvm-svn: 346885
Scott Linder [Wed, 14 Nov 2018 19:39:59 +0000 (19:39 +0000)]
[Support] Teach YAMLIO about polymorphic types
Add support for "polymorphic" types to YAMLIO.
PolymorphicTraits can dynamically switch between other traits (Scalar, Map, or
Sequence). When inputting, the PolymorphicTraits type is told which type to
become, and when outputting the PolymorphicTraits type is asked which type it
currently is.
Also add support for TaggedScalarTraits to allow dynamically differentiating
between multiple scalar types using YAML tags.
Serialize empty maps as "{}" and empty sequences as "[]", so that types
are preserved when round-tripping PolymorphicTraits. This change has
equivalent semantics, but may break e.g. tests which compare output
verbatim.
Differential Revision: https://reviews.llvm.org/D48144
llvm-svn: 346884
Teresa Johnson [Wed, 14 Nov 2018 19:30:13 +0000 (19:30 +0000)]
[ThinLTO] Update handling of vararg functions to match inliner
Summary:
Previously we marked all vararg functions as non-inlinable in the
function summary, which prevented their importing. However, the
corresponding inliner restriction was loosened in r321940/r342675
to only apply to functions calling va_start. Adjust the summary
flag computation to match.
Reviewers: davidxl
Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, llvm-commits
Differential Revision: https://reviews.llvm.org/D54270
llvm-svn: 346883
Shoaib Meenai [Wed, 14 Nov 2018 19:16:22 +0000 (19:16 +0000)]
[AST] Fix typo in MicrosoftMangle
Correct the spelling from Artifical to Artificial.
Differential Revision: https://reviews.llvm.org/D54536
llvm-svn: 346882
Sanjay Patel [Wed, 14 Nov 2018 19:12:54 +0000 (19:12 +0000)]
[InstSimplify] add tests for funnel shift with select; NFC
llvm-svn: 346881
Sam Clegg [Wed, 14 Nov 2018 18:36:24 +0000 (18:36 +0000)]
[WebAssembly] Add support for dylink section in object format
See https://github.com/WebAssembly/tool-conventions/blob/master/DynamicLinking.md.
Differential Revision: https://reviews.llvm.org/D54490
llvm-svn: 346880
Craig Topper [Wed, 14 Nov 2018 18:16:21 +0000 (18:16 +0000)]
[X86] Allow pmulh to be formed from narrow vXi16 vectors under -x86-experimental-vector-widening-legalization
Narrower vectors will be widened to 128 bits without changing the element size. And generic type legalization can already handle widening mulhu/mulhs.
Differential Revision: https://reviews.llvm.org/D54513
llvm-svn: 346879
Alexander Richardson [Wed, 14 Nov 2018 17:58:55 +0000 (17:58 +0000)]
[libcxx] [test] Fix running tests on macOS with python3
Summary:
The result of subprocess.check_output() is bytes in python3 which we need
to convert to str(). Simplify this by using the executeCommand() helper.
Reviewers: ldionne, EricWF
Reviewed By: ldionne
Subscribers: christof, libcxx-commits
Differential Revision: https://reviews.llvm.org/D54522
llvm-svn: 346878
Sean Fertile [Wed, 14 Nov 2018 17:56:43 +0000 (17:56 +0000)]
[PPC64] Long branch thunks.
On PowerPC64, when a function call offset is too large to encode in a call
instruction the address is stored in a table in the data segment. A thunk is
used to load the branch target address from the table relative to the
TOC-pointer and indirectly branch to the callee. When linking position-dependent
code the addresses are stored directly in the table, for position-independent
code the table is allocated and filled in at load time by the dynamic linker.
For position-independent code the branch targets could have gone in the .got.plt
but using the .branch_lt section for both position dependent and position
independent binaries keeps it consitent and helps keep this PPC64 specific logic
seperated from the target-independent code handling the .got.plt.
Differential Revision: https://reviews.llvm.org/D53408
llvm-svn: 346877
Sean Fertile [Wed, 14 Nov 2018 17:56:38 +0000 (17:56 +0000)]
[NFC] Change address __tls_getaddr is defined at so it does not need a thunk.
Minor update to a ppc64 tls test so that it won't need to use a thunk once the
range-extending thunk patch is landed.
llvm-svn: 346876
Mandeep Singh Grang [Wed, 14 Nov 2018 17:55:07 +0000 (17:55 +0000)]
[InstCombine] Remove a couple of asserts based on incorrect assumptions
Summary:
These asserts are based on the assumption that the order of true/false operands in a select and those in the compare would always be the same.
This fixes PR39595.
Reviewers: craig.topper, spatel, dmgreen
Reviewed By: craig.topper
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D54359
llvm-svn: 346874
Zachary Turner [Wed, 14 Nov 2018 17:22:09 +0000 (17:22 +0000)]
Fix some compilation failures introduced in recent patches.
This fixes two compilation failures:
1) Designated initializers are C++20. We can't use them in LLVM.
2) thread_result_t is not a pointer type on all platforms, so
returning nullptr is an error.
llvm-svn: 346873
Kadir Cetinkaya [Wed, 14 Nov 2018 17:07:39 +0000 (17:07 +0000)]
[clangd] Delete unused includes.
llvm-svn: 346872
Sanjay Patel [Wed, 14 Nov 2018 16:03:36 +0000 (16:03 +0000)]
[InstCombine] fix formatting for matchBSwap(); NFC
We should have a similar function for matching rotate and/or
funnel shift, so tidy up the related existing call.
llvm-svn: 346871
Florian Hahn [Wed, 14 Nov 2018 15:58:40 +0000 (15:58 +0000)]
[VPlan, SLP] Use SmallPtrSet for Candidates.
This slightly improves the candidate handling in getBest().
llvm-svn: 346870
John Brawn [Wed, 14 Nov 2018 15:27:07 +0000 (15:27 +0000)]
[SimplifyCFG] Regenerate preserve-branchweights.ll test. NFC
Regenerate this test using update_test_checks.py in preparation for an
upcomming commit, to make it not depend on the names of instructions.
llvm-svn: 346869
Simon Pilgrim [Wed, 14 Nov 2018 15:04:08 +0000 (15:04 +0000)]
[TTI] getOperandInfo - a broadcast shuffle means the result is OK_UniformValue
llvm-svn: 346868
Pavel Labath [Wed, 14 Nov 2018 14:58:36 +0000 (14:58 +0000)]
Move DataExtractorTest to unittests/Utility
The DataExtractor class itself was moved to Utility some time ago, but
it seems this was not reflected in the location of the test code. Fix
that.
llvm-svn: 346867
David Bolvansky [Wed, 14 Nov 2018 14:27:51 +0000 (14:27 +0000)]
Reverted D52835 to fix review comments
llvm-svn: 346866
David Bolvansky [Wed, 14 Nov 2018 14:24:33 +0000 (14:24 +0000)]
[Diagnostics] Check integer to floating point number implicit conversions
Summary:
GCC already catches these situations so we should handle it too.
GCC warns in C++ mode only (does anybody know why?). I think it is useful in C mode too.
Reviewers: rsmith, erichkeane, aaron.ballman, efriedma, xbolva00
Reviewed By: xbolva00
Subscribers: efriedma, craig.topper, scanon, cfe-commits
Differential Revision: https://reviews.llvm.org/D52835
llvm-svn: 346865
Bruno Ricci [Wed, 14 Nov 2018 14:19:34 +0000 (14:19 +0000)]
[AST][NFC] Order the bit-field classes of Stmt like in StmtNodes.td
Reorder the bit-field classes and the members of the anonymous union
so that they both match the order in StmtNodes.td.
There is already a fair amount of them, and this is not going to
improve. Therefore lets try to keep some order here.
Strictly NFC.
llvm-svn: 346864
Peter Smith [Wed, 14 Nov 2018 13:53:47 +0000 (13:53 +0000)]
[AArch64] Fix resolution of R_PLT_PAGE RelExpr
The R_AARCH64_ADR_PREL_PG_HI21 relocation type is given the R_PAGE_PC
RelExpr. This can be transformed to R_PLT_PAGE_PC via toPlt().
Unfortunately the resolution is identical to R_PAGE_PC so instead of
getting the address of the PLT entry we get the address of the symbol
which may not be correct in the case of static ifuncs. The fix is to
handle the cases separately and use getPltVA() + A with R_PLT_PAGE_PC.
Differential Revision: https://reviews.llvm.org/D54474
llvm-svn: 346863
Andrey Churbanov [Wed, 14 Nov 2018 13:49:41 +0000 (13:49 +0000)]
Fix for bugzilla https://bugs.llvm.org/show_bug.cgi?id=39137.
Do not write to internal structure if it keeps same value.
Differential Revision: https://reviews.llvm.org/D54305
llvm-svn: 346862
Paul Robinson [Wed, 14 Nov 2018 13:43:19 +0000 (13:43 +0000)]
Document how to comment an actual parameter.
Differential Revision: https://reviews.llvm.org/D54446
llvm-svn: 346861
Florian Hahn [Wed, 14 Nov 2018 13:33:44 +0000 (13:33 +0000)]
[VPlan] Remove LLVM_DEBUG from VPlanSlp::dumpBundle.
The caller should take care of only calling it with debug enabled.
llvm-svn: 346860
Simon Pilgrim [Wed, 14 Nov 2018 13:23:28 +0000 (13:23 +0000)]
[TTI] Pull out repeated 'ConcreteTTI' static_casts. NFCI.
llvm-svn: 346859
Florian Hahn [Wed, 14 Nov 2018 13:21:26 +0000 (13:21 +0000)]
[VPlan] Update ifdef.
llvm-svn: 346858
Florian Hahn [Wed, 14 Nov 2018 13:11:49 +0000 (13:11 +0000)]
[VPlan, SLP] Add simple SLP analysis on top of VPlan.
This patch adds an initial implementation of the look-ahead SLP tree
construction described in 'Look-Ahead SLP: Auto-vectorization in the Presence
of Commutative Operations, CGO 2018 by Vasileios Porpodas, Rodrigo C. O. Rocha,
Luís F. W. Góes'.
It returns an SLP tree represented as VPInstructions, with combined
instructions represented as a single, wider VPInstruction.
This initial version does not support instructions with multiple
different users (either inside or outside the SLP tree) or
non-instruction operands; it won't generate any shuffles or
insertelement instructions.
It also just adds the analysis that builds an SLP tree rooted in a set
of stores. It does not include any cost modeling or memory legality
checks. The plan is to integrate it with VPlan based cost modeling, once
available and to only apply it to operations that can be widened.
A follow-up patch will add a support for replacing instructions in a
VPlan with their SLP counter parts.
Reviewers: Ayal, mssimpso, rengolin, mkuper, hfinkel, hsaito, dcaballe, vporpo, RKSimon, ABataev
Reviewed By: rengolin
Differential Revision: https://reviews.llvm.org/D4949
llvm-svn: 346857
Aaron Ballman [Wed, 14 Nov 2018 13:03:50 +0000 (13:03 +0000)]
Adding myself as the code owner for clang-query as discussed in https://reviews.llvm.org/D54453.
llvm-svn: 346856
George Rimar [Wed, 14 Nov 2018 13:01:15 +0000 (13:01 +0000)]
[LLDB] - Recommit r346848 "[LLDB] - Support the single file split DWARF.".
Test cases were updated to not use the local compilation dir which
is different between development pc and build bots.
Original commit message:
[LLDB] - Support the single file split DWARF.
DWARF5 spec describes a single file split dwarf case
(when .dwo sections are in the .o files).
Problem is that LLDB does not work correctly in that case.
The issue is that, for example, both .debug_info and .debug_info.dwo
has the same type: eSectionTypeDWARFDebugInfo. And when code searches
section by type it might find the regular debug section
and not the .dwo one.
The patch fixes that. With it, LLDB is able to work with
output compiled with -gsplit-dwarf=single flag correctly.
Differential revision: https://reviews.llvm.org/D52403
llvm-svn: 346855
Simon Pilgrim [Wed, 14 Nov 2018 12:24:50 +0000 (12:24 +0000)]
[CostModel] Add generic expansion funnel shift cost support
Add support for the expansion of funnelshift/rotates to getIntrinsicInstrCost.
This also required us to move the X86 fshl/fshr costs to the same place as the rotates to avoid expansion and get correct scalarization vs vectorization costs.
llvm-svn: 346854
George Rimar [Wed, 14 Nov 2018 12:04:31 +0000 (12:04 +0000)]
Revert r346848 "[LLDB] - Support the single file split DWARF."
It broke BB:
http://green.lab.llvm.org/green/job/lldb-cmake/12522/testReport/junit/LLDB/Breakpoint/single_file_split_dwarf_test/
llvm-svn: 346853
Haojian Wu [Wed, 14 Nov 2018 11:55:45 +0000 (11:55 +0000)]
[clangd] Replace StringRef in SymbolLocation with a char pointer.
Summary:
This would save us 8 bytes per ref, and buy us ~40MB in total
for llvm index (from ~300MB to ~260 MB).
The char pointer must be null-terminated, and llvm::StringSaver
guarantees it.
Reviewers: sammccall
Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D53427
llvm-svn: 346852
Xing GUO [Wed, 14 Nov 2018 11:30:34 +0000 (11:30 +0000)]
[llvm-objdump] Improve ELF file type checking statements (D54509)
llvm-svn: 346851
Simon Pilgrim [Wed, 14 Nov 2018 11:26:35 +0000 (11:26 +0000)]
[X86][AVX512] Remove constant pool shuffle decoding from SelectionDAG
This patch removes the last use of the constant pool shuffle decode helper and consistently uses the 'getTargetShuffleMaskIndices' versions instead. The constant pool versions are now purely used for assembly comments.
The avx512vbmi intrinsic upgrades had to be altered as they were being decoded as broadcasts, similar to what I fixed in rL346032. I don't think the change is critical - although its annoying that we lose the {k}{z} instruction test coverage as they are tricky to generate....
Differential Revision: https://reviews.llvm.org/D54083
llvm-svn: 346850
Pavel Labath [Wed, 14 Nov 2018 11:12:40 +0000 (11:12 +0000)]
Fix a crash when parsing incorrect DWARF
Summary:
While parsing a childless compile unit DIE we could crash if the DIE was
followed by any extra data (such as a superfluous end-of-children
marker). This happened because the break-on-depth=0 check was performed
only when parsing the null DIE, which was not correct because with a
childless root DIE, we could reach the end of the unit without ever
encountering the null DIE.
If the compile unit contribution ended directly after the CU DIE,
everything would be fine as we would terminate parsing due to reaching
EOF. However, if the contribution contained extra data (perhaps a
superfluous end-of-children marker), we would crash because we would
treat that data as the begging of another compile unit.
This fixes the crash by moving the depth=0 check to a more generic
place, and also adds a regression test.
Reviewers: clayborg, jankratochvil, JDevlieghere
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D54417
llvm-svn: 346849
George Rimar [Wed, 14 Nov 2018 10:35:14 +0000 (10:35 +0000)]
[LLDB] - Support the single file split DWARF.
DWARF5 spec describes a single file split dwarf case
(when .dwo sections are in the .o files).
Problem is that LLDB does not work correctly in that case.
The issue is that, for example, both .debug_info and .debug_info.dwo
has the same type: eSectionTypeDWARFDebugInfo. And when code searches
section by type it might find the regular debug section
and not the .dwo one.
The patch fixes that. With it, LLDB is able to work with
output compiled with -gsplit-dwarf=single flag correctly.
Differential revision: https://reviews.llvm.org/D52296
llvm-svn: 346848
Sam McCall [Wed, 14 Nov 2018 10:33:30 +0000 (10:33 +0000)]
[AST] Allow limiting the scope of common AST traversals (getParents, RAV).
Summary:
The goal is to allow analyses such as clang-tidy checks to run on a
subset of the AST, e.g. "only on main-file decls" for interactive tools.
Today, these become "problematically global" by running RecursiveASTVisitors
rooted at the TUDecl, or by navigating up via ASTContext::getParent().
The scope is restricted using a set of top-level-decls that RecursiveASTVisitors
should be rooted at. This also applies to the visitor that populates the
parent map, and so the top-level-decls are considered to have no parents.
This patch makes the traversal scope a mutable property of ASTContext.
The more obvious way to do this is to pass the top-level decls to
relevant functions directly, but this has some problems:
- it's error-prone: accidentally mixing restricted and unrestricted
scopes is a performance trap. Interleaving multiple analyses is
common (many clang-tidy checks run matchers or RAVs from matcher callbacks)
- it doesn't map well to the actual use cases, where we really do want
*all* traversals to be restricted.
- it involves a lot of plumbing in parts of the code that don't care
about traversals.
This approach was tried out in D54259 and D54261, I wanted to like it
but it feels pretty awful in practice.
Caveats: to get scope-limiting behavior of RecursiveASTVisitors, callers
have to call the new TraverseAST(Ctx) function instead of TraverseDecl(TU).
I think this is an improvement to the API regardless.
Reviewers: klimek, ioeric
Subscribers: mgorny, cfe-commits
Differential Revision: https://reviews.llvm.org/D54309
llvm-svn: 346847
Martin Storsjo [Wed, 14 Nov 2018 10:26:47 +0000 (10:26 +0000)]
[COFF] Fix a longstanding typo in a variable name. NFC.
llvm-svn: 346846
Heejin Ahn [Wed, 14 Nov 2018 10:11:22 +0000 (10:11 +0000)]
[WebAssembly] Make sure event-section XFAILs for build options
rL346840 temporarily marked event-section.ll as XFAIL because it was
failing for builds with LLVM_ENABLE_EXPENSIVE_CHECKS turned on, but
to make sure it XFAILs even without LLVM_ENABLE_EXPENSIVE_CHECKS on we
need this `-verify-machineinstrs` flag, which was missing in the
previous commit.
llvm-svn: 346845
Sven van Haastregt [Wed, 14 Nov 2018 10:05:28 +0000 (10:05 +0000)]
Print newline after banner for ModulePass
Before this commit, `llc -print-after-all` would print something like:
*** IR Dump After Pre-ISel Intrinsic Lowering ***; ModuleID = ...
Emit a newline such that ModuleID appears on a line by its own.
llvm-svn: 346844
Florian Hahn [Wed, 14 Nov 2018 10:04:30 +0000 (10:04 +0000)]
Recommit r346483: [CallSiteSplitting] Only record conditions up to the IDom(call site).
The underlying problem causing the expensive-check failure was fixed in
rL346769.
llvm-svn: 346843
Diana Picus [Wed, 14 Nov 2018 09:58:17 +0000 (09:58 +0000)]
Fix r346747 and r346796
Require x86 for the tests in order to fix non-x86 bots. This seems to be
the case for all other tests in that directory.
llvm-svn: 346842
Haojian Wu [Wed, 14 Nov 2018 09:53:45 +0000 (09:53 +0000)]
Suppress a "-Wliteral-conversion" compiler warning.
error: implicit conversion from 'double' to 'uint64_t' (aka 'unsigned long') changes value from -0 to 0 [-Werror,-Wliteral-conversion]
llvm-svn: 346841
Heejin Ahn [Wed, 14 Nov 2018 09:51:21 +0000 (09:51 +0000)]
[WebAssembly] Temporarily disable event-section.ll
This test is failing in builds with LLVM_ENABLE_EXPENSIVE_CHECKS after
rL346825 not because of the patch but due to a pre-existing codegen
problem. Marking this as XFAIL temporarily until the bug is fixed.
llvm-svn: 346840
Haojian Wu [Wed, 14 Nov 2018 09:42:28 +0000 (09:42 +0000)]
Fix the "make_unique is ambiguous" compiler error.
llvm-svn: 346839
Alexey Sotkin [Wed, 14 Nov 2018 09:40:05 +0000 (09:40 +0000)]
[OpenCL] Fix invalid address space generation for clk_event_t
Summary:
Addrspace(32) was generated when putting 0 in clk_event_t * event_ret
parameter for enqueue_kernel function.
Patch by Viktoria Maksimova
Reviewers: Anastasia, yaxunl, AlexeySotkin
Reviewed By: Anastasia, AlexeySotkin
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D53809
llvm-svn: 346838
George Rimar [Wed, 14 Nov 2018 09:22:16 +0000 (09:22 +0000)]
[Clang] - Add '-gsplit-dwarf[=split,=single]' version for '-gsplit-dwarf' option.
The DWARF5 specification says(Appendix F.1):
"The sections that do not require relocation, however, can be
written to the relocatable object (.o) file but ignored by the
linker or they can be written to a separate DWARF object (.dwo)
file that need not be accessed by the linker."
The first part describes a single file split DWARF feature and there
is no way to trigger this behavior atm.
Fortunately, no many changes are required to keep *.dwo sections
in a .o, the patch does that.
Differential revision: https://reviews.llvm.org/D52296
llvm-svn: 346837
Sam McCall [Wed, 14 Nov 2018 09:05:19 +0000 (09:05 +0000)]
[clangd] Improve code completion for ObjC methods
Summary:
Previously code completion did not work well for Objective-C methods
which contained multiple arguments as clangd did not expect to see
multiple typed-text chunks when handling code completion.
Note that even with this change, we do not consider selector fragments
from previous arguments to be part of the signature (although we
could in the future).
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, jfb, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D53934
llvm-svn: 346836
Roman Lebedev [Wed, 14 Nov 2018 09:01:08 +0000 (09:01 +0000)]
[clang-tidy] Avoid C arrays check
Summary:
[[ https://bugs.llvm.org/show_bug.cgi?id=39224 | PR39224 ]]
As discussed, we can't always do the transform automatically due to that array-to-pointer decay of C array.
In order to detect whether we can do said transform, we'd need to be able to see all usages of said array,
which is, i would say, rather impossible if e.g. it is in the header.
Thus right now no fixit exists.
Exceptions: `extern "C"` code.
References:
* [[ https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es27-use-stdarray-or-stack_array-for-arrays-on-the-stack | CPPCG ES.27: Use std::array or stack_array for arrays on the stack ]]
* [[ https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#slcon1-prefer-using-stl-array-or-vector-instead-of-a-c-array | CPPCG SL.con.1: Prefer using STL array or vector instead of a C array ]]
* HICPP `4.1.1 Ensure that a function argument does not undergo an array-to-pointer conversion`
* MISRA `5-2-12 An identifier with array type passed as a function argument shall not decay to a pointer`
Reviewers: aaron.ballman, JonasToth, alexfh, hokein, xazax.hun
Reviewed By: JonasToth
Subscribers: Eugene.Zelenko, mgorny, rnkovacs, cfe-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D53771
llvm-svn: 346835
Craig Topper [Wed, 14 Nov 2018 07:51:26 +0000 (07:51 +0000)]
[X86] Add -x86-experimental-vector-widening command lines to pmulh.ll
I've only added sse2 and sse4.1 variants as I'm only interested in the two v4i16 tests and I don't expect that to different with AVX other than a v prefix.
llvm-svn: 346834
David Blaikie [Wed, 14 Nov 2018 07:19:21 +0000 (07:19 +0000)]
Correctly instantiate `iterator_adaptor_base` when defining `pointer_iterator`
The definition of `pointer_iterator` omits what should be a `iterator_traits::<>::iterator_category` parameter from `iterator_adaptor_base`. As a result, iterators based on `pointer_iterator` always have defaulted value types and the wrong iterator category.
The definition of `pointee_iterator` just a few lines above does this correctly.
This resolves [[ https://bugs.llvm.org/show_bug.cgi?id=39617 | bug 39617 ]].
Patch by Dylan MacKenzie!
Reviewers: dblaikie
Differential Revision: https://reviews.llvm.org/D54377
llvm-svn: 346833
Yaxun Liu [Wed, 14 Nov 2018 04:47:31 +0000 (04:47 +0000)]
[HIP] Fix device only compilation
Fix a bug causing host code being compiled when --cude-device-only is set.
Differential Revision: https://reviews.llvm.org/D54496
llvm-svn: 346828
Petr Hosek [Wed, 14 Nov 2018 04:06:47 +0000 (04:06 +0000)]
[CMake] Include clang-apply-replacements in Fuchsia toolchain
This is needed for run-clang-tidy.py.
Differential Revision: https://reviews.llvm.org/D54505
llvm-svn: 346827
Stephan T. Lavavej [Wed, 14 Nov 2018 03:06:06 +0000 (03:06 +0000)]
[libcxx] [test] Strip trailing whitespace. NFC.
llvm-svn: 346826
Heejin Ahn [Wed, 14 Nov 2018 02:46:21 +0000 (02:46 +0000)]
[WebAssembly] Add support for the event section
Summary:
This adds support for the 'event section' specified in the exception
handling proposal. (This was named 'exception section' first, but later
renamed to 'event section' to take possibilities of other kinds of
events into consideration. But currently we only store exception info in
this section.)
The event section is added between the global section and the export
section. This is for ease of validation per request of the V8 team.
This patch:
- Creates the event symbol type, which is a weak symbol
- Makes 'throw' instruction take the event symbol '__cpp_exception'
- Adds relocation support for events
- Adds WasmObjectWriter / WasmObjectFile (Reader) support
- Adds obj2yaml / yaml2obj support
- Adds '.eventtype' printing support
Reviewers: dschuff, sbc100, aardappel
Subscribers: jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D54096
llvm-svn: 346825