Craig Topper [Sun, 29 Oct 2017 06:51:02 +0000 (06:51 +0000)]
[X86] Fix typo in comment. NFC
llvm-svn: 316859
Saleem Abdulrasool [Sun, 29 Oct 2017 06:01:14 +0000 (06:01 +0000)]
Driver: default to `unsigned int` `wchar_t` for ARM
AAPCS and AAPCS64 mandate that `wchar_t` with `-fno-short-wchar` is an
`unsigned int` rather than a `signed int`. Ensure that the driver does
not flip the signedness of `wchar_t` for those targets.
Add additional tests to ensure that this does not regress.
llvm-svn: 316858
Craig Topper [Sun, 29 Oct 2017 05:14:26 +0000 (05:14 +0000)]
[X86] Use the extended vector register classes in fast isel with AVX512F/VL.
llvm-svn: 316857
Craig Topper [Sun, 29 Oct 2017 02:50:31 +0000 (02:50 +0000)]
[X86] Add AVX512 support to X86FastISel::X86SelectFPExt and X86FastISel::X86SelectFPTrunc.
llvm-svn: 316856
Craig Topper [Sun, 29 Oct 2017 02:25:48 +0000 (02:25 +0000)]
[X86] Use update_llc_test_checks.py to regenerate fast-isel-int-float-conversion.ll
llvm-svn: 316855
Craig Topper [Sun, 29 Oct 2017 02:18:43 +0000 (02:18 +0000)]
[X86] Use update_llc_test_checks.py to regenerate fast-isel-fptrunc-fpext.ll
llvm-svn: 316854
Craig Topper [Sun, 29 Oct 2017 02:18:41 +0000 (02:18 +0000)]
[X86] Add AVX512 support to X86FastISel::X86MaterializeFP
llvm-svn: 316853
Peter Szecsi [Sat, 28 Oct 2017 23:24:00 +0000 (23:24 +0000)]
[analyzer] MisusedMovedObjectChecker: More precise warning message
Added new enum in order to differentiate the warning messages on "misusing" into
3 categories: function calls, moving an object, copying an object. (At the
moment the checker gives the same message in case of copying and moving.)
Additional test cases added as well.
Differential Revision: https://reviews.llvm.org/D38674
llvm-svn: 316852
Craig Topper [Sat, 28 Oct 2017 23:10:13 +0000 (23:10 +0000)]
[X86] Remove invalid code from LowerVSELECT.
This code attempted to say that v8i16/v16i16 VSELECT is legal if BWI and VLX are enabled, but the only way we could reach this point is if the condition was not a vXi1 type. Which means it really wasn't legal.
We don't have any tests that exercise this code. So I'm hoping it wasn't really reachable.
llvm-svn: 316851
Peter Szecsi [Sat, 28 Oct 2017 23:09:37 +0000 (23:09 +0000)]
[analyzer] MisusedMovedObjectChecker: Fix false positive on state-resetting, handling method calls on base-class sub-objects
An earlier solution from Artem r315301 solves the reset problem, however, the
reports should be handled the same way in case of method calls. We should not
just report the base class of the object where the method was defined but the
whole object.
Fixed false positive which came from not removing the subobjects in case of a
state-resetting function. (Just replaced the State->remove(...) call to
removeFromState(..) which was defined exactly for that purpose.)
Some minor typos fixed in this patch as well which did not worth a whole new
patch in my opinion, so included them here.
Differential Revision: https://reviews.llvm.org/D31538
llvm-svn: 316850
Rui Ueyama [Sat, 28 Oct 2017 22:18:29 +0000 (22:18 +0000)]
Fix ubsan error.
This patch fixes ubsan's "shift exponent 64 is too large for 32-bit type
'int'" error.
llvm-svn: 316849
Rui Ueyama [Sat, 28 Oct 2017 22:18:17 +0000 (22:18 +0000)]
Reduce sizeof(Symbol) from 104 bytes to 88 bytes.
Finding aliases for shared symbols doesn't need st_shndx because
we can just compare st_value.
llvm-svn: 316848
Simon Pilgrim [Sat, 28 Oct 2017 22:10:40 +0000 (22:10 +0000)]
[SelectionDAG] Add support for INSERT_SUBVECTOR to computeKnownBits
llvm-svn: 316847
Rui Ueyama [Sat, 28 Oct 2017 21:11:38 +0000 (21:11 +0000)]
Do not handle DefinedCommon symbols in the MapFile writer.
Because of r314495 which converts DefinedCommon symbols to DefinedRegular
symbols, common symbols are no longer reachable to the MapFile writer.
So the code to handle common symbols is now dead.
llvm-svn: 316846
Simon Pilgrim [Sat, 28 Oct 2017 20:51:27 +0000 (20:51 +0000)]
[X86][SSE] Combine 128-bit target shuffles to PACKSS/PACKUS.
llvm-svn: 316845
Simon Pilgrim [Sat, 28 Oct 2017 20:27:22 +0000 (20:27 +0000)]
[X86][SSE] Split off matchVectorShuffleWithPACK. NFCI.
Split matchVectorShuffleWithPACK from lowerVectorShuffleWithPACK so that we can reuse it for target shuffle combines
llvm-svn: 316844
Martin Storsjo [Sat, 28 Oct 2017 20:19:49 +0000 (20:19 +0000)]
Restore arch specific lastDwarfRegNum in builds without _LIBUNWIND_IS_NATIVE_ONLY
This restores the previous behaviour of the Registers_* classes
after SVN r316745.
Differential Revision: https://reviews.llvm.org/D39382
llvm-svn: 316843
Rui Ueyama [Sat, 28 Oct 2017 20:16:11 +0000 (20:16 +0000)]
Rename V -> Ver for readability.
llvm-svn: 316842
Rui Ueyama [Sat, 28 Oct 2017 20:15:56 +0000 (20:15 +0000)]
Pass symbol attributes instead of ElfSym to Shared symbol ctor.
This change allows us to use less templates for Shared symbol and
the functions that deals with shared symbols.
llvm-svn: 316841
Craig Topper [Sat, 28 Oct 2017 19:56:57 +0000 (19:56 +0000)]
[X86] Fix a mistake in the X86ISelDAGToDAG.cpp code for MUL8r/IMUL8r.
I think this code is unreachable due to some promotions that occur elsewhere. I'll look into that to be sure, but for now I thought I should at least fix the obvious typo.
llvm-svn: 316840
Craig Topper [Sat, 28 Oct 2017 19:56:56 +0000 (19:56 +0000)]
[X86] Replace some default cases in X86SelectShift with llvm_unreachable.
llvm-svn: 316839
Saleem Abdulrasool [Sat, 28 Oct 2017 19:15:05 +0000 (19:15 +0000)]
ADT: add a helper to check if the Triple is ARM64
Add a trivial helper for checking if the architecture is AArch64 Little
Endian or Big Endian.
llvm-svn: 316837
Richard Smith [Sat, 28 Oct 2017 18:59:51 +0000 (18:59 +0000)]
PR35039: Materialize temporary objects before wrapping them in an
OpaqueValueExpr in a GNU binary conditional expression.
It's not meaningful for a non-materialized temporary object to be used as a
common subexpression of multiple expressions.
llvm-svn: 316836
Sanjay Patel [Sat, 28 Oct 2017 18:43:07 +0000 (18:43 +0000)]
[SimplifyCFG] use pass options and remove the latesimplifycfg pass
This is no-functional-change-intended.
This is repackaging the functionality of D30333 (defer switch-to-lookup-tables) and
D35411 (defer folding unconditional branches) with pass parameters rather than a named
"latesimplifycfg" pass. Now that we have individual options to control the functionality,
we could decouple when these fire (but that's an independent patch if desired).
The next planned step would be to add another option bit to disable the sinking transform
mentioned in D38566. This should also make it clear that the new pass manager needs to
be updated to limit simplifycfg in the same way as the old pass manager.
Differential Revision: https://reviews.llvm.org/D38631
llvm-svn: 316835
Simon Pilgrim [Sat, 28 Oct 2017 17:59:56 +0000 (17:59 +0000)]
[X86][SSE] Rename truncateVectorCompareWithPACKSS to truncateVectorWithPACKSS. NFC.
We no longer rely on the vector source being a comparison result, just have sufficient sign bits.
llvm-svn: 316834
Craig Topper [Sat, 28 Oct 2017 17:37:51 +0000 (17:37 +0000)]
[X86] Correct the alignments on the aligned test cases in fast-isel-vecload.ll to make sure they test selection of aligned loads.
llvm-svn: 316833
Benjamin Kramer [Sat, 28 Oct 2017 17:32:56 +0000 (17:32 +0000)]
[clangd] Fix clang-tidy warnings.
No functionality change intended.
llvm-svn: 316832
Simon Pilgrim [Sat, 28 Oct 2017 14:27:53 +0000 (14:27 +0000)]
[SelectionDAG] Support 'bit preserving' floating points bitcasts on computeKnownBits/ComputeNumSignBits
For cases where we know the floating point representations match the bitcasted integer equivalent, allow bitcasting to these types.
This is especially useful for the X86 floating point compare results which return all/zero bits but as a floating point type.
Differential Revision: https://reviews.llvm.org/D39289
llvm-svn: 316831
Peter Szecsi [Sat, 28 Oct 2017 12:19:08 +0000 (12:19 +0000)]
[analyzer] LoopUnrolling: check the bitwidth of the used numbers (pr34943)
The loop unrolling feature aims to track the maximum possible steps a loop can
make. In order to implement this, it investigates the initial value of the
counter variable and the bound number. (It has to be known.)
These numbers are used as llvm::APInts, however, it was not checked if their
bitwidths are the same which lead to some crashes.
This revision solves this problem by extending the "shorter" one (to the length
of the "longer" one).
For the detailed bug report, see: https://bugs.llvm.org/show_bug.cgi?id=34943
Differential Revision: https://reviews.llvm.org/D38922
llvm-svn: 316830
Craig Topper [Sat, 28 Oct 2017 06:31:48 +0000 (06:31 +0000)]
[X86] Add avx command lines to fast-isel-constpool.ll to improve coverage.
llvm-svn: 316829
Craig Topper [Sat, 28 Oct 2017 06:31:46 +0000 (06:31 +0000)]
[X86] Use update_llc_test_checks.py to regenerate fast-isel-constpool.ll
llvm-svn: 316828
Craig Topper [Sat, 28 Oct 2017 06:10:03 +0000 (06:10 +0000)]
[X86] Add a fast-isel test for the i8 pseudo cmov.
llvm-svn: 316827
Saleem Abdulrasool [Sat, 28 Oct 2017 06:00:43 +0000 (06:00 +0000)]
Basic: improve coverage for Darwin targets and fix ABI
The existing coverage for the Darwin targets wasn't enough to catch all
the variations. Improve the coverage a bit further and fix a few cases
for Darwin targets.
llvm-svn: 316826
Craig Topper [Sat, 28 Oct 2017 05:52:23 +0000 (05:52 +0000)]
[X86] Remove unneeded MVT::i1 related code from fast isel.
llvm-svn: 316825
Haicheng Wu [Sat, 28 Oct 2017 02:27:14 +0000 (02:27 +0000)]
[ConstantFold] Fix a crash when folding a GEP that has vector index
LLVM crashes when factoring out an out-of-bound index into preceding dimension
and the preceding dimension uses vector index. Simply bail out now when this
case happens.
Differential Revision: https://reviews.llvm.org/D38677
llvm-svn: 316824
Craig Topper [Sat, 28 Oct 2017 02:03:59 +0000 (02:03 +0000)]
[X86] Add avx command lines to two fast-isel tests to get coverage of selecting vucomiss/vucomisd.
The selection of these shows up as a code coverage hole when looking at the llvm-cov link on llvm.org
llvm-svn: 316823
Craig Topper [Sat, 28 Oct 2017 02:03:58 +0000 (02:03 +0000)]
[X86] Use update_llc_test_checks.py to regenerate fast-isel-select-cmov2.ll
llvm-svn: 316822
Martin Pelikan [Sat, 28 Oct 2017 01:35:07 +0000 (01:35 +0000)]
[XRay] [compiler-rt] fix build by including errno.h into FDR mode
The build got broken after D39277 (and rL316816) deleted <cerrno>.
llvm-svn: 316821
Richard Smith [Sat, 28 Oct 2017 01:15:00 +0000 (01:15 +0000)]
Never try to instantiate a deduction guide's "definition". Fixes bogus warning when there inevitably isn't one.
llvm-svn: 316820
Craig Topper [Sat, 28 Oct 2017 00:36:58 +0000 (00:36 +0000)]
[PartialInlineLibCalls] Teach PartialInlineLibCalls to honor nobuiltin, properly check the function signature, and check TLI::has
Summary:
We shouldn't do this transformation if the function is marked nobuitlin.
We were only checking that the return type is floating point, we really should be checking the argument types and argument count as well. This can be accomplished by using the other version of getLibFunc that takes the Function and not just the name.
We should also be checking TLI::has since sqrtf is a macro on Windows.
Fixes PR32559.
Reviewers: hfinkel, spatel, davide, efriedma
Reviewed By: davide, efriedma
Subscribers: efriedma, llvm-commits, eraman
Differential Revision: https://reviews.llvm.org/D39381
llvm-svn: 316819
Eugene Zelenko [Sat, 28 Oct 2017 00:24:26 +0000 (00:24 +0000)]
[ADT] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 316818
Rui Ueyama [Sat, 28 Oct 2017 00:05:12 +0000 (00:05 +0000)]
Simplify error handling.
I don't think we have to aim for precise bug compatibility.
We can return a nullptr if a section is consumed by the linker, and
the rest should naturally work.
llvm-svn: 316817
Dean Michael Berris [Fri, 27 Oct 2017 23:59:41 +0000 (23:59 +0000)]
[XRay][compiler-rt] Remove more STL dependenices from FDR mode
Summary:
This change removes dependencies on STL types:
- std::aligned_storage -- we're using manually-aligned character
buffers instead for metadata and function records.
- std::tuple -- use a plain old struct instead.
This is an incremental step in removing all STL references from the
compiler-rt implementation of XRay (llvm.org/PR32274).
Reviewers: dblaikie, pelikan, kpw
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D39277
llvm-svn: 316816
Tom Stellard [Fri, 27 Oct 2017 23:57:41 +0000 (23:57 +0000)]
AMDGPU/GlobalISel: Mark 32-bit G_FADD as legal
Reviewers: arsenm
Reviewed By: arsenm
Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, igorb, dstuttard, tpr, t-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D38439
llvm-svn: 316815
Bob Haarman [Fri, 27 Oct 2017 23:41:17 +0000 (23:41 +0000)]
[support] remove tautological comparison in Support/Windows/Path.inc
Summary:
The removed code checks that we are able to handle a 64-bit number, but
the code we're calling takes two dwords (for a total of 64 bits), so this
is always true.
Reviewers: zturner, rnk, majnemer, compnerd
Reviewed By: zturner
Subscribers: amccarth, hiraditya, lebedev.ri, llvm-commits
Differential Revision: https://reviews.llvm.org/D39263
llvm-svn: 316814
Jake Ehrlich [Fri, 27 Oct 2017 23:39:31 +0000 (23:39 +0000)]
Revert "Add support for writing 64-bit symbol tables for archives when offsets become too large for 32-bit"
This reverts commit r316805.
llvm-svn: 316813
Rui Ueyama [Fri, 27 Oct 2017 23:29:58 +0000 (23:29 +0000)]
Remove unnecessary namespace specifiers.
llvm-svn: 316812
Rui Ueyama [Fri, 27 Oct 2017 23:26:46 +0000 (23:26 +0000)]
Inline trivial symbol constructors.
llvm-svn: 316811
Saleem Abdulrasool [Fri, 27 Oct 2017 23:04:27 +0000 (23:04 +0000)]
ARM: centralise SizeType, PtrDiffType, and IntPtrType
Centralise the definitions of these compiler vended types to aid
inspection to ensure that they are defined similarly. The one case that
stands out is the Darwin case where the types do not match up. This
fixes the API conformance for APCS-GNU as well.
llvm-svn: 316810
Rui Ueyama [Fri, 27 Oct 2017 22:54:16 +0000 (22:54 +0000)]
Rename isInCurrentDSO -> isInCurrentOutput.
DSO is short for dynamic shared object, so the function name was a
little confusing because it sounded like it didn't work when we were
a creating statically-linked executable or something.
What we mean by "DSO" here is the current output file that we are
creating. Thus the new name. Alternatively, we could call it the current
ELF module, but "module" is a overloaded word, so I avoided that.
llvm-svn: 316809
George Karpenkov [Fri, 27 Oct 2017 22:52:36 +0000 (22:52 +0000)]
[Analyzer] [Tests] Fixing typo from the previous commit.
Can not open a non-existent file with r+.
llvm-svn: 316808
Reid Kleckner [Fri, 27 Oct 2017 22:48:41 +0000 (22:48 +0000)]
[MS] Allow access to ambiguous, inaccessible direct bases
Summary:
Clang typically warns that in the following class hierarchy, 'A' is
inaccessible because there is no series of casts that the user can
write to access it unambiguously:
struct A { };
struct B : A { };
struct C : A, B { };
MSVC allows the user to convert from C* to A*, though, and we've
encountered this issue in the latest Windows SDK headers.
This patch allows this conversion when -fms-compatibility is set and
adds a warning for it under -Wmicrosoft-inaccessible-base.
Reviewers: rsmith
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D39389
llvm-svn: 316807
George Karpenkov [Fri, 27 Oct 2017 22:39:54 +0000 (22:39 +0000)]
[Analyzer] [Tests] Dump the output of scan-build to stdout on failure.
Eliminates extra lookup step during debugging.
llvm-svn: 316806
Jake Ehrlich [Fri, 27 Oct 2017 22:26:37 +0000 (22:26 +0000)]
Add support for writing 64-bit symbol tables for archives when offsets become too large for 32-bit
This should fix https://bugs.llvm.org//show_bug.cgi?id=34189
This change makes it so that if writing a K_GNU style archive, you need
to output a > 32-bit offset it should output in K_GNU64 style instead.
Differential Revision: https://reviews.llvm.org/D36812
llvm-svn: 316805
Krzysztof Parzyszek [Fri, 27 Oct 2017 22:24:49 +0000 (22:24 +0000)]
[Hexagon] Adjust patterns to reflect instruction selection preferences
llvm-svn: 316804
David Blaikie [Fri, 27 Oct 2017 22:12:46 +0000 (22:12 +0000)]
Add a few missing headers for modularization/IWYU/etc
Several cases where class definitions are required for DenseMap pointer
traits handling.
llvm-svn: 316803
Guozhi Wei [Fri, 27 Oct 2017 21:54:24 +0000 (21:54 +0000)]
[DAGCombine] Don't combine sext with extload if sextload is not supported and extload has multi users
In function DAGCombiner::visitSIGN_EXTEND_INREG, sext can be combined with extload even if sextload is not supported by target, then
if sext is the only user of extload, there is no big difference, no harm no benefit.
if extload has more than one user, the combined sextload may block extload from combining with other zext, causes extra zext instructions generated. As demonstrated by the attached test case.
This patch add the constraint that when sextload is not supported by target, sext can only be combined with extload if it is the only user of extload.
Differential Revision: https://reviews.llvm.org/D39108
llvm-svn: 316802
Jake Ehrlich [Fri, 27 Oct 2017 21:47:38 +0000 (21:47 +0000)]
Make 32-bit member offset in Archive::Symbol::getMember 64-bit
When accessing a member for a symbol with an offset greater than 2^32 -
1 the current Archive::Symbol::getMember implementation will overflow
and cause unexpected behavior. This change simply fixes that. In
particular if you call "llvm-nm --print-armap" on an archive that has
this behavior you'll get an error.
Differential Revision: https://reviews.llvm.org/D39379
llvm-svn: 316801
Davide Italiano [Fri, 27 Oct 2017 21:22:57 +0000 (21:22 +0000)]
[CMake] Build clang as dependency when using in-tree clang for tests.
Discussed with Zachary Turner and Pavel Labath on lldb-dev.
Let's hope this doesn't break anything :)
llvm-svn: 316800
Rafael Espindola [Fri, 27 Oct 2017 21:18:48 +0000 (21:18 +0000)]
Handle undefined weak hidden symbols on all architectures.
We were handling the non-hidden case in lib/Target/TargetMachine.cpp,
but the hidden case was handled in architecture dependent code and
only X86_64 and AArch64 were covered.
While it is true that some code sequences in some ABIs might be able
to produce the correct value at runtime, that doesn't seem to be the
common case.
I left the AArch64 code in place since it also forces a got access for
non-pic code. It is not clear if that is needed, but it is probably
better to change that in another commit.
llvm-svn: 316799
Zachary Turner [Fri, 27 Oct 2017 21:12:28 +0000 (21:12 +0000)]
Force #define GTEST_LANG_CXX11.
gtest depends on this #define to determine whether it can
use various classes like std::tuple, or whether it has to fall
back to experimental classes in the std::tr1 namespace. The
check in the current version of gtest relies on the value of
the `__cplusplus` macro, but MSVC provides a non-conformant
value of this macro, making it effectively impossible to detect
C++11. In short, LLVM compiled with MSVC has been silently
using the tr1 versions of several classes since the beginning of
time.
This would normally be pretty benign, except that in the latest
preview of MSVC they have marked all of the tr1 classes
deprecated, so it spews thousands of warnings.
llvm-svn: 316798
Craig Topper [Fri, 27 Oct 2017 21:00:59 +0000 (21:00 +0000)]
[X86] Remove fast-isel code for handling i8 shifts. This is handled by auto generated code.
llvm-svn: 316797
Craig Topper [Fri, 27 Oct 2017 21:00:56 +0000 (21:00 +0000)]
[X86] Add fast-isel tests for integer shifts. We definitely had no coverage of i16 and i32/i64 are only tested by larger tests.
llvm-svn: 316796
Artur Gainullin [Fri, 27 Oct 2017 20:53:41 +0000 (20:53 +0000)]
Improve clamp recognition in ValueTracking.
Summary:
ValueTracking was recognizing not all variations of clamp. Swapping of
true value and false value of select was added to fix this problem. The
first patch was reverted because it caused miscompile in NVPTX target.
Added corresponding test cases.
Reviewers: spatel, majnemer, efriedma, reames
Subscribers: llvm-commits, jholewinski
Differential Revision: https://reviews.llvm.org/D39240
llvm-svn: 316795
David Blaikie [Fri, 27 Oct 2017 20:40:46 +0000 (20:40 +0000)]
StaticAnalyzer: Modularize/fix ODR violations making functions inline but non-static in headers
Also move these out of the llvm namespace & rely on ADL as is
appropriate for these op<< overloads.
llvm-svn: 316794
David Blaikie [Fri, 27 Oct 2017 20:40:45 +0000 (20:40 +0000)]
Sanitizers.h: Modularize/Fix ODR violations by making inline functions non-static
llvm-svn: 316793
David Blaikie [Fri, 27 Oct 2017 20:40:45 +0000 (20:40 +0000)]
CharInfo.h: Modularize/fix ODR violations by making inline functions in header not static
llvm-svn: 316792
David Blaikie [Fri, 27 Oct 2017 20:40:44 +0000 (20:40 +0000)]
ASTContext.h: Modularize/fix ODR violations by removing 'static' from inline functions in headers
llvm-svn: 316791
Craig Topper [Fri, 27 Oct 2017 20:13:10 +0000 (20:13 +0000)]
[X86] Teach fastisel to use VLX VMOVNTDQA for v4f64 and 256-bit integers when available.
This looks to have been missed from r280682.
llvm-svn: 316790
Craig Topper [Fri, 27 Oct 2017 20:13:06 +0000 (20:13 +0000)]
[X86] Add avx512vl command line to fast-isel-nontemporal.ll
llvm-svn: 316789
Kostya Kortchinsky [Fri, 27 Oct 2017 20:10:14 +0000 (20:10 +0000)]
[scudo] Allow to specify the maximum number of TSDs at compile time
Summary:
This introduces `SCUDO_MAX_CACHES` allowing to define an upper bound to the
number of `ScudoTSD` created in the Shared TSD model (by default 32U).
This name felt clearer than `SCUDO_MAX_TSDS` which is technically what it really
is. I am opened to suggestions if that doesn't feel right.
Additionally change `getNumberOfCPUs` to return a `u32` to be more consistent.
Reviewers: alekseyshl
Reviewed By: alekseyshl
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D39338
llvm-svn: 316788
Rui Ueyama [Fri, 27 Oct 2017 19:23:12 +0000 (19:23 +0000)]
Remove trailing whitespace.
llvm-svn: 316787
Vlad Tsyrklevich [Fri, 27 Oct 2017 19:15:13 +0000 (19:15 +0000)]
Fix llvm-special-case-list-fuzzer regexp exception
Summary:
Original oss-fuzz report:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3727#c2
The minimized test case that causes this failure:
5b 5b 5b 3d 47 53 00 5b 3d 5d 5b 5d 0a [[[=GS.[=][].
Note the string "=GS\x00". The failure happens because the code is
searching the string against an array of known collated names. "GS\x00"
is a hit, but since len takes into account an extra NUL byte, indexing
into cp->name[len] goes one byte past it's allocated memory. Fix this to
use a strlen(cp->name) comparison to account for NUL bytes in the input.
Reviewers: pcc
Reviewed By: pcc
Subscribers: hctim, kcc
Differential Revision: https://reviews.llvm.org/D39380
llvm-svn: 316786
Krzysztof Parzyszek [Fri, 27 Oct 2017 18:52:28 +0000 (18:52 +0000)]
[Hexagon] Fix an incorrect assertion in HexagonConstExtenders.cpp
Making sure that an instruction has fewer operands than required, then
attempting to access one out of range is going to fail.
llvm-svn: 316785
Erich Keane [Fri, 27 Oct 2017 18:45:06 +0000 (18:45 +0000)]
Replace a few usages of llvm::join with range-version[NFC]
I noticed a few usages of llvm::join that were using
begin/end rather than just the range version. This patch
just replaces those.
llvm-svn: 316784
Erich Keane [Fri, 27 Oct 2017 18:32:23 +0000 (18:32 +0000)]
Filter out invalid 'target' items from being passed to LLVM
Craig noticed that CodeGen wasn't properly ignoring the
values sent to the target attribute. This patch ignores
them.
This patch also sets the 'default' for this checking to
'supported', since only X86 has implemented the support
for checking valid CPU names and Feature Names.
One test was changed to i686, since it uses a lakemont,
which would otherwise be prohibited in x86_64.
Differential Revision: https://reviews.llvm.org/D39357
llvm-svn: 316783
Rafael Espindola [Fri, 27 Oct 2017 18:30:11 +0000 (18:30 +0000)]
Handle all symbol types in --trace.
One case I was not sure was lazy symbols. bfd skips them completely,
but that is probably an artifact of how they implement archives.
llvm-svn: 316782
Erich Keane [Fri, 27 Oct 2017 18:29:02 +0000 (18:29 +0000)]
Remove x86,x86_32/64 from isValidFeatureName
These are not valid values for this, and are pretty
non-sensical, since LLVM doesn't understand them.
Differential Revision: https://reviews.llvm.org/D39378
llvm-svn: 316781
Alex Lorenz [Fri, 27 Oct 2017 18:19:11 +0000 (18:19 +0000)]
[refactor] Describe refactorings in the operation classes
This commit changes the way that the refactoring operation classes are
structured:
- Users have to call `initiate` instead of constructing an instance of the
class. The `initiate` is now supposed to have custom initiation logic, and
you don't need to subclass the builtin requirements.
- A new `describe` function returns a structure with the id, title and the
description of the refactoring operation.
The refactoring action classes are now placed into one common place in
RefactoringActions.cpp instead of being separate.
Differential Revision: https://reviews.llvm.org/D38985
llvm-svn: 316780
Simon Pilgrim [Fri, 27 Oct 2017 18:14:12 +0000 (18:14 +0000)]
[X86][SSE] Add tests for inserting all-bits (-1) into a vector
We should be able to do this by re-materializing an all-bits vector and then blending with it
llvm-svn: 316779
Alex Lorenz [Fri, 27 Oct 2017 18:13:31 +0000 (18:13 +0000)]
[Sema] Fix an assert-on-invalid by avoiding function template specialisation
deduction for invalid functions
The fabricated template parameters cause an assertion because their depth
is invalid.
rdar://
34109988
Differential Revision: https://reviews.llvm.org/D37341
llvm-svn: 316778
Sam Clegg [Fri, 27 Oct 2017 18:10:19 +0000 (18:10 +0000)]
[WebAssembly] Add crt1.o with calling lld
Also, for OS unknown targets like wasm, don't include
'unknown' in the library path. This is a fix for rL316719.
Differential Revision: https://reviews.llvm.org/D39354
llvm-svn: 316777
Rui Ueyama [Fri, 27 Oct 2017 18:04:49 +0000 (18:04 +0000)]
Instead of enclosing an entire file, add lld:: specifier for public functions.
llvm-svn: 316776
Peter Collingbourne [Fri, 27 Oct 2017 17:49:40 +0000 (17:49 +0000)]
ELF: Add support for emitting dynamic relocations in the Android relocation packing format.
The Android relocation packing format is a more compact
format for dynamic relocations in executables and DSOs
that is based on delta encoding and SLEBs. An overview
of the format can be found in the Android source code:
https://android.googlesource.com/platform/bionic/+/refs/heads/master/tools/relocation_packer/src/delta_encoder.h
This patch implements relocation packing using that format.
This implementation uses a more intelligent algorithm for compressing
relative relocations than Android's own relocation packer. As a
result it can generally create smaller relocation sections than
that packer. If I link Chromium for Android targeting ARM32 I get a
.rel.dyn of size 174693 bytes, as compared to 371832 bytes with gold
and the Android packer.
Differential Revision: https://reviews.llvm.org/D39152
llvm-svn: 316775
Benjamin Kramer [Fri, 27 Oct 2017 17:06:41 +0000 (17:06 +0000)]
[clangd] Don't crash on extremely large JSON messages.
Found by clangd-fuzzer.
llvm-svn: 316774
Don Hinton [Fri, 27 Oct 2017 17:02:33 +0000 (17:02 +0000)]
New lldb python module for managing diagnostic breakpoints
Summary:
Can be used to set breakpoints for either the diagnostics actually
emitted for the current compilation, a particular DiagID, or all
DiagIDs for a particular warning.
Differential Revision: https://reviews.llvm.org/D36347
llvm-svn: 316773
Pavel Labath [Fri, 27 Oct 2017 17:02:32 +0000 (17:02 +0000)]
Add specific ppc64le hardware watchpoint handler
Summary: Add hardware watchpoint funcionality for ppc64le
Reviewers: clayborg, zturner
Reviewed By: clayborg
Subscribers: eugene, clayborg, zturner, lbianc, gut, nemanjai, alexandreyy, kbarton, lldb-commits
Differential Revision: https://reviews.llvm.org/D38897
Patch by Ana Julia Caetano <ana.caetano@eldorado.org.br>
llvm-svn: 316772
Simon Pilgrim [Fri, 27 Oct 2017 16:34:58 +0000 (16:34 +0000)]
[X86][F16C] Fix btver2 AGU pipe scheduling
Use the store AGU for stores, and the load AGU needs to be the first pipe for loads
llvm-svn: 316771
Benjamin Kramer [Fri, 27 Oct 2017 16:33:15 +0000 (16:33 +0000)]
[clangd] Harden clangd a bit against garbage input.
There can be nullptrs here if the YAML fails to parse. Found by
clangd-fuzzer!
llvm-svn: 316770
Michael Kruse [Fri, 27 Oct 2017 14:48:34 +0000 (14:48 +0000)]
[ForwardOpTree] Use space indention. NFC.
llvm-svn: 316769
Artur Pilipenko [Fri, 27 Oct 2017 14:46:17 +0000 (14:46 +0000)]
[LoopPredication] Handle the case when the guard and the latch IV have different offsets
This is a follow up change for D37569.
Currently the transformation is limited to the case when:
* The loop has a single latch with the condition of the form: ++i <pred> latchLimit, where <pred> is u<, u<=, s<, or s<=.
* The step of the IV used in the latch condition is 1.
* The IV of the latch condition is the same as the post increment IV of the guard condition.
* The guard condition is of the form i u< guardLimit.
This patch enables the transform in the case when the latch is
latchStart + i <pred> latchLimit, where <pred> is u<, u<=, s<, or s<=.
And the guard is
guardStart + i u< guardLimit
Reviewed By: anna
Differential Revision: https://reviews.llvm.org/D39097
llvm-svn: 316768
Jonas Toth [Fri, 27 Oct 2017 14:44:08 +0000 (14:44 +0000)]
[clang-tidy] Fix bug 34845, offending standard bitmask types
Summary:
The C++ standard allows implementations to choose the underlying type for
bitmask types (e.g. std::ios_base::openmode). MSVC implemented some of them
as signed integers resulting in warnings for usual code like
`auto dd = std::ios_base::badbit | std::ios_base::failbit;`
These false positives were reported in https://bugs.llvm.org/show_bug.cgi?id=34845
The fix allows bitwise |,&,^ for known standard bitmask types under the condition
that both operands are such bitmask types.
Shifting and bitwise complement are still forbidden.
Reviewers: aaron.ballman, alexfh, hokein
Reviewed By: aaron.ballman
Subscribers: xazax.hun
Differential Revision: https://reviews.llvm.org/D39099
llvm-svn: 316767
Michael Kruse [Fri, 27 Oct 2017 14:26:14 +0000 (14:26 +0000)]
[ForwardOpTree] Reload know values.
For scalar accesses, change the access target to an array element that
is known to contain the same value.
This may become an alternative to forwardKnownLoad which creates new
loads (and therefore closer to forwarding speculatives). Reloading does
not require the known value originating from a load, but can be a store
as well.
Differential Revision: https://reviews.llvm.org/D39325
llvm-svn: 316766
Clement Courbet [Fri, 27 Oct 2017 13:34:41 +0000 (13:34 +0000)]
[CodeGen] Fix -Wunused-private-field warning on lld-x86_64-darwin13.
llvm-svn: 316765
Gabor Horvath [Fri, 27 Oct 2017 12:53:37 +0000 (12:53 +0000)]
[CrossTU] Fix handling of Cross Translation Unit directory path
Differential Revision: https://reviews.llvm.org/D38842
llvm-svn: 316764
Clement Courbet [Fri, 27 Oct 2017 12:34:18 +0000 (12:34 +0000)]
[CodeGen][ExpandMemCmp][NFC] Simplify load sequence generation.
llvm-svn: 316763
whitequark [Fri, 27 Oct 2017 11:51:40 +0000 (11:51 +0000)]
[LLVM-C] Publicly expose getters of MetadataType, TokenType
Patch by Robert Widmann.
Expose getters for MetadataType and TokenType publicly in the C API.
Discovered a need for these while trying to wrap the intrinsics API.
Differential Revision: https://reviews.llvm.org/D38809
llvm-svn: 316762
George Rimar [Fri, 27 Oct 2017 11:49:24 +0000 (11:49 +0000)]
[ELF] - Ignore non-absolute R_386_GOTPC relocation in debug sections.
This is for PR34852.
GCC 8.0 or earlier have a bug that it emits R_386_GOTPC relocations
against _GLOBAL_OFFSET_TABLE for .debug_info. The bug seems to have
been fixed in 2017: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82630,
but we do not want LLD to report errors for such inputs.
In this patch we ignore such relocations.
Differential revision: https://reviews.llvm.org/D38625
llvm-svn: 316761
George Rimar [Fri, 27 Oct 2017 11:38:31 +0000 (11:38 +0000)]
[ELF] - Stop naming relocation sections with first input section name.
It was reported (https://reviews.llvm.org/D38724#902841) that when we use
-ffunction-sections --emit-relocs build, REL[A] output section receives the name of first
input section, like .rela.text.first_function_in_text rather than .rela.text.
It is probably not really an issue as sh_info still points to correct target section, but
it does not look clean in output and allows internal section name to leak there,
what at least looks confusing and is not consistent with ld.bfd.
Patch changes this behavior so that target output section name is used as a base.
Differential revision: https://reviews.llvm.org/D39242
llvm-svn: 316760
George Rimar [Fri, 27 Oct 2017 11:32:22 +0000 (11:32 +0000)]
[ELF] - Simplify reporting of garbage collected sections.
This moves reporting of garbage collected sections right after
we do GC. That simplifies things.
Differential revision: https://reviews.llvm.org/D39058
llvm-svn: 316759