Francis Visoiu Mistrih [Tue, 23 Jul 2019 20:42:46 +0000 (20:42 +0000)]
[Remarks] Introduce a new format: yaml-strtab
This exposes better support to use a string table with a format through
an actual new remark::Format, called yaml-strtab.
This can now be used with -fsave-optimization-record=yaml-strtab.
llvm-svn: 366849
Antonio Afonso [Tue, 23 Jul 2019 20:40:37 +0000 (20:40 +0000)]
Revert "Revert "Add ReadCStringFromMemory for faster string reads""
This reverts commit
9c10b620c0619611dfe062216459431955ac4801.
llvm-svn: 366848
Antonio Afonso [Tue, 23 Jul 2019 20:40:30 +0000 (20:40 +0000)]
Revert "Revert "Implement xfer:libraries-svr4:read packet""
This reverts commit
08c38f77c5fb4d3735ec215032fed8ee6730b3db.
llvm-svn: 366847
Francis Visoiu Mistrih [Tue, 23 Jul 2019 19:28:03 +0000 (19:28 +0000)]
[Remarks][NFC] Move the YAML serializer to its own header
llvm-svn: 366842
Yi-Hong Lyu [Tue, 23 Jul 2019 19:11:07 +0000 (19:11 +0000)]
[PowerPC] Remove redundant load immediate instructions
Currently PowerPC backend emits code like this:
r3 = li 0
std r3, 264(r1)
r3 = li 0
std r3, 272(r1)
This patch fixes that and other cases where a register already contains a value that is loaded so we will get:
r3 = li 0
std r3, 264(r1)
std r3, 272(r1)
Differential Revision: https://reviews.llvm.org/D64220
llvm-svn: 366840
Nico Weber [Tue, 23 Jul 2019 19:02:47 +0000 (19:02 +0000)]
gn build: Merge r366832
llvm-svn: 366837
Nico Weber [Tue, 23 Jul 2019 19:00:01 +0000 (19:00 +0000)]
ld.lld: Demangle symbols from archives in diagnostics
This ports r366573 from COFF to ELF.
There are now to toString(Archive::Symbol), one doing MSVC demangling
in COFF and one doing Itanium demangling in ELF, so rename these two
to toCOFFString() and to toELFString() to not get a duplicate symbol.
Nothing ever passes a raw Archive::Symbol to CHECK(), so these not
being part of the normal toString() machinery seems ok.
There are two code paths in the ELF linker that emits this type of
diagnostic:
1. The "normal" one in InputFiles.cpp. This is covered by the tweaked test.
2. An additional one that's only used for libcalls if there's at least
one bitcode in the link, and if the libcall symbol is lazy, and
lazily loaded from an archive (i.e. not from a lazy .o file).
(This code path was added in r339301.) Since all libcall names so far
are C symbols and never mangled, the change there is not observable
and hence not covered by tests.
Differential Revision: https://reviews.llvm.org/D65095
llvm-svn: 366836
Craig Topper [Tue, 23 Jul 2019 18:46:15 +0000 (18:46 +0000)]
[X86] In lowerVectorShuffle, instead of creating a new node to canonicalize the shuffle mask by commuting, just commute the mask and swap V1/V2.
LegalizeDAG tries to legal the DAG by legalizing nodes before
their operands.
If we create a new node, we end up legalizing it after its operands.
This prevents some of the optimizations that can be done when the
operand is a build_vector since the build_vector will have been
legalized to something else.
Differential Revision: https://reviews.llvm.org/D65132
llvm-svn: 366835
Max Moroz [Tue, 23 Jul 2019 18:26:53 +0000 (18:26 +0000)]
[libFuzzer] Fix __sanitizer_print_memory_profile return type in ExtFunctions.def
Summary:
Looks like a typo, as that function actually returns void and is used
as such in libFuzzer code as well.
Reviewers: kcc, Dor1s
Reviewed By: Dor1s
Subscribers: delcypher, #sanitizers, llvm-commits
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D65160
llvm-svn: 366834
Jonas Devlieghere [Tue, 23 Jul 2019 18:09:13 +0000 (18:09 +0000)]
[utils] Remove sync-source (with SVN)
llvm-svn: 366833
Francis Visoiu Mistrih [Tue, 23 Jul 2019 18:09:12 +0000 (18:09 +0000)]
[Remarks] Add unit tests for YAML serialization
Add tests for both the string table and non string table case.
llvm-svn: 366832
Nico Weber [Tue, 23 Jul 2019 17:49:45 +0000 (17:49 +0000)]
clang-format: Fix namespace end comments for namespaces with attributes and macros.
Fixes PR39247.
While here, also make C++20 `namespace A::inline B::inline C` nested
inline namespaced definitions work.
Before:
#define DEPRECATE_WOOF [[deprecated("meow")]]
namespace DEPRECATE_WOOF woof {
void f() {}
} // namespace DEPRECATE_WOOFwoof
namespace [[deprecated("meow")]] woof {
void f() {}
} // namespace [[deprecated("meow")]]woof
namespace woof::inline bark {
void f() {}
} // namespace woof::inlinebark
Now:
#define DEPRECATE_WOOF [[deprecated("meow")]]
namespace DEPRECATE_WOOF woof {
void f() {}
} // namespace woof
namespace [[deprecated("meow")]] woof {
void f() {}
} // namespace woof
namespace woof::inline bark {
void f() {}
} // namespace woof::inline bark
(In addition to the fixed namespace end comments, also note the correct
indent of the namespace contents.)
Differential Revision: https://reviews.llvm.org/D65125
llvm-svn: 366831
Jonas Devlieghere [Tue, 23 Jul 2019 17:47:08 +0000 (17:47 +0000)]
[Utils] Add back utils directory
Due to a bug my earlier commit removed the whole utils directory:
https://reviews.llvm.org/D65123
llvm-svn: 366830
Philip Reames [Tue, 23 Jul 2019 17:45:11 +0000 (17:45 +0000)]
[IndVars] Fix a subtle bug in optimizeLoopExits
The original code failed to account for the fact that one exit can have a pointer exit count without all of them having pointer exit counts. This could cause two separate bugs:
1) We might exit the loop early, and leave optimizations undone. This is what triggered the assertion failure in the reported test case.
2) We might optimize one exit, then exit without indicating a change. This could result in an analysis invalidaton bug if no other transform is done by the rest of indvars.
Note that the pointer exit counts are a really fragile concept. They show up only when we have a pointer IV w/o a datalayout to provide their size. It's really questionable to me whether the complexity implied is worth it.
llvm-svn: 366829
Nico Weber [Tue, 23 Jul 2019 17:34:18 +0000 (17:34 +0000)]
Improve clang-format-diff help output
The description in clang-format-diff.py is more useful than the one
in `clang-format-diff -h`, so use the same description in both places.
Differential Revision: https://reviews.llvm.org/D64998
llvm-svn: 366828
Jonas Devlieghere [Tue, 23 Jul 2019 17:23:36 +0000 (17:23 +0000)]
[Utils] Remove legacy scripts
As pointed out by Nathan in D65155, these scrips don't seem to serve any
real need anymore.
llvm-svn: 366827
Ryan Taylor [Tue, 23 Jul 2019 17:19:56 +0000 (17:19 +0000)]
[IR][Verifier] Allow IntToPtrInst to be !dereferenceable
Summary:
Allow IntToPtrInst to carry !dereferenceable metadata tag.
This is valid since !dereferenceable can be only be applied to
pointer type values.
Change-Id: If8a6e3c616f073d51eaff52ab74535c29ed497b4
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64954
llvm-svn: 366826
Sam Elliott [Tue, 23 Jul 2019 17:14:42 +0000 (17:14 +0000)]
[RISCV][NFC] Correct RUN in rvi-pseudos-invalid.s
This test should test both riscv32 and riscv64.
llvm-svn: 366825
Jonas Devlieghere [Tue, 23 Jul 2019 17:03:37 +0000 (17:03 +0000)]
[Logging] Fix format strings
Change format strings to use the `{}` syntax instead of the printf
syntax when using LLDB_LOG.
llvm-svn: 366824
Jan Korous [Tue, 23 Jul 2019 16:54:11 +0000 (16:54 +0000)]
[clang][NFCI] Fix random typos
llvm-svn: 366823
Rainer Orth [Tue, 23 Jul 2019 16:33:54 +0000 (16:33 +0000)]
[compiler-rt][builtins] Provide __clear_cache for SPARC
While working on https://reviews.llvm.org/D40900, two tests were failing since __clear_cache
aborted. While libgcc's __clear_cache is just empty, this only happens because
gcc (in gcc/config/sparc/sparc.c (sparc32_initialize_trampoline, sparc64_initialize_trampoline))
emits flush insns directly.
The following patch mimics that.
Tested on sparcv9-sun-solaris2.11.
Differential Revision: https://reviews.llvm.org/D64496
llvm-svn: 366822
Rainer Orth [Tue, 23 Jul 2019 16:27:34 +0000 (16:27 +0000)]
[CMake] Add -z defs on Solaris
Like other ELF targets, shared objects should be linked with -z defs on Solaris.
Tested on x86_64-pc-solaris2.11 and sparcv9-sun-solaris2.11.
Differential Revision: https://reviews.llvm.org/D64484
llvm-svn: 366821
Rainer Orth [Tue, 23 Jul 2019 16:24:00 +0000 (16:24 +0000)]
[clang, test] Fix Clang :: Headers/max_align.c on 64-bit SPARC
Clang :: Headers/max_align.c currently FAILs on 64-bit SPARC:
error: 'error' diagnostics seen but not expected:
File /vol/llvm/src/clang/dist/test/Headers/max_align.c Line 12: static_assert failed due to requirement '8 == _Alignof(max_align_t)' ""
1 error generated.
This happens because SuitableAlign isn't defined for SPARCv9 unlike SPARCv8
(which uses the default of 64 bits). gcc's sparc/sparc.h has
#define BIGGEST_ALIGNMENT (TARGET_ARCH64 ? 128 : 64)
This patch sets SuitableAlign to match and updates the corresponding testcase.
Tested on sparcv9-sun-solaris2.11.
Differential Revision: https://reviews.llvm.org/D64487
llvm-svn: 366820
Jessica Paquette [Tue, 23 Jul 2019 16:09:42 +0000 (16:09 +0000)]
[GlobalISel][AArch64] Teach GISel to handle shifts in load addressing modes
When we select the XRO variants of loads, we can pull in very specific shifts
(of the size of an element). E.g.
```
ldr x1, [x2, x3, lsl #3]
```
This teaches GISel to handle these when they're coming from shifts
specifically.
This adds a new addressing mode function, `selectAddrModeShiftedExtendXReg`
which recognizes this pattern.
This also packs this up with `selectAddrModeRegisterOffset` into
`selectAddrModeXRO`. This is intended to be equivalent to `selectAddrModeXRO`
in AArch64ISelDAGtoDAG.
Also update load-addressing-modes to show that all of the cases here work.
Differential Revision: https://reviews.llvm.org/D65119
llvm-svn: 366819
Gabor Marton [Tue, 23 Jul 2019 15:46:38 +0000 (15:46 +0000)]
[ASTImporter] Fix inequivalence of ClassTemplateInstantiations
Summary:
We falsely state inequivalence if the template parameter is a
qualified/nonquialified template in the first/second instantiation.
Also, different kinds of TemplateName should be equal if the template
decl (if available) is equal (even if the name kind is different).
Reviewers: a_sidorin, a.sidorin
Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64241
llvm-svn: 366818
Simon Pilgrim [Tue, 23 Jul 2019 15:35:55 +0000 (15:35 +0000)]
[TargetLowering] SimplifyMultipleUseDemandedBits - add VECTOR_SHUFFLE support.
If all the demanded elts are from one operand and are inline, then we can use the operand directly.
The changes are mainly from SSE41 targets which has blendvpd but not cmpgtq, allowing the v2i64 comparison to be simplified as we only need the signbit from alternate v4i32 elements.
llvm-svn: 366817
Vlad Tsyrklevich [Tue, 23 Jul 2019 15:02:13 +0000 (15:02 +0000)]
Revert "[Object/ELF.h] - Improve testing of the fields in ELFFile<ELFT>::sections()."
This reverts commit r366796 because it was causing ubsan buildbot
failures.
llvm-svn: 366815
Owen Reynolds [Tue, 23 Jul 2019 14:44:21 +0000 (14:44 +0000)]
[llvm-ar] Fix support for archives with members larger than 4GB
llvm-ar outputs a strange error message when handling archives with
members larger than 4GB due to not checking file size when passing the
value as an unsigned 32 bit integer. This overflow issue caused
malformed archives to be created.:
https://bugs.llvm.org/show_bug.cgi?id=38058
This change allows for members above 4GB and will error in a case that
is over the formats size limit, a 10 digit decimal integer.
Differential Revision: https://reviews.llvm.org/D65093
llvm-svn: 366813
Sam McCall [Tue, 23 Jul 2019 14:30:28 +0000 (14:30 +0000)]
[clangd] Log version, cwd, args, and transport on startup. NFC
Reviewers: hokein
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D65146
llvm-svn: 366811
Jonas Hahnfeld [Tue, 23 Jul 2019 14:20:48 +0000 (14:20 +0000)]
[libomptarget] Handle offload policy in push_tripcount
If the first target region in a program calls the push_tripcount
function, libomptarget didn't handle the offload policy correctly.
This could lead to unexpected error messages as seen in
http://lists.llvm.org/pipermail/openmp-dev/2019-June/002561.html
To solve this, add a check calling IsOffloadDisabled() as all other
entry points already do. If this method returns false, libomptarget
is effectively disabled.
Differential Revision: https://reviews.llvm.org/D64626
llvm-svn: 366810
Sam Parker [Tue, 23 Jul 2019 14:08:46 +0000 (14:08 +0000)]
[ARM][LowOverheadLoops] Fix branch target codegen
While lowering test.set.loop.iterations, it wasn't checked how the
brcond was using the result and so the wls could branch to the loop
preheader instead of not entering it. The same was true for
loop.decrement.reg.
So brcond and br_cc and now lowered manually when using the hwloop
intrinsics. During this we now check whether the result has been
negated and whether we're using SETEQ or SETNE and 0 or 1. We can
then figure out which basic block the WLS and LE should be targeting.
Differential Revision: https://reviews.llvm.org/D64616
llvm-svn: 366809
Simon Pilgrim [Tue, 23 Jul 2019 14:04:54 +0000 (14:04 +0000)]
Fix MSVC warning about extending a uint32_t shift result to uint64_t. NFCI.
llvm-svn: 366808
Simon Pilgrim [Tue, 23 Jul 2019 13:42:01 +0000 (13:42 +0000)]
[SLPVectorizer] Revert local change that got accidently got committed in rL366799
This wasn't part of D63281
llvm-svn: 366807
Sam Elliott [Tue, 23 Jul 2019 13:30:56 +0000 (13:30 +0000)]
Revert [RISCV] Re-enable rv32i-aliases-invalid.s test
This reverts r366797 (git commit
53f9fec8e8b58f5a904bbfb4a1d648cde65aa860)
llvm-svn: 366806
Lei Huang [Tue, 23 Jul 2019 13:10:29 +0000 (13:10 +0000)]
[NFC][ASAN] Add brackets around not command
Under certain execution conditions, the `not` command binds to the command the
output is piped to rather than the command piping the output. In this case, that
flips the return code of the FileCheck invocation, causing a failure when
FileCheck succeeds.
llvm-svn: 366805
Raphael Isemann [Tue, 23 Jul 2019 12:54:33 +0000 (12:54 +0000)]
[lldb][NFC] Tablegenify process
llvm-svn: 366804
Pavel Labath [Tue, 23 Jul 2019 12:53:45 +0000 (12:53 +0000)]
ProcessMachCore: Fix a -Wmisleading-indentation warning
llvm-svn: 366803
Roman Lebedev [Tue, 23 Jul 2019 12:42:57 +0000 (12:42 +0000)]
[NFC][InstCombine] Fixup commutative/negative tests with icmp preds in @llvm.umul.with.overflow tests
llvm-svn: 366802
Roman Lebedev [Tue, 23 Jul 2019 12:42:49 +0000 (12:42 +0000)]
[InstSimplify][NFC] Tests for skipping 'div-by-0' checks before inverted @llvm.umul.with.overflow
It would be already handled by the non-inverted case if we were hoisting
the `not` in InstCombine, but we don't (granted, we don't sink it
in this case either), so this is a separate case.
llvm-svn: 366801
Roman Lebedev [Tue, 23 Jul 2019 12:42:41 +0000 (12:42 +0000)]
[NFC][PhaseOredering][SimplifyCFG] Add more runlines to umul.with.overflow tests
This way it will be more obvious that the problem is both
in cost threshold and in hardcoded benefit check,
plus will show how the instsimplify cleans this all in the end.
llvm-svn: 366800
Simon Pilgrim [Tue, 23 Jul 2019 12:39:08 +0000 (12:39 +0000)]
[TargetLowering] Add SimplifyMultipleUseDemandedBits
This patch introduces the DAG version of SimplifyMultipleUseDemandedBits, which attempts to peek through ops (mainly and/or/xor so far) that don't contribute to the demandedbits/elts of a node - which means we can do this even in cases where we have multiple uses of an op, which normally requires us to demanded all bits/elts. The intention is to remove a similar instruction - SelectionDAG::GetDemandedBits - once SimplifyMultipleUseDemandedBits has matured.
The InstCombine version of SimplifyMultipleUseDemandedBits can constant fold which I haven't added here yet, and so far I've only wired this up to some basic binops (and/or/xor/add/sub/mul) to demonstrate its use.
We do see a couple of regressions that need to be addressed:
AMDGPU unsigned dot product codegen retains an AND mask (for ZERO_EXTEND) that it previously removed (but otherwise the dotproduct codegen is a lot better).
X86/AVX2 has poor handling of vector ANY_EXTEND/ANY_EXTEND_VECTOR_INREG - it prematurely gets converted to ZERO_EXTEND_VECTOR_INREG.
The code owners have confirmed its ok for these cases to fixed up in future patches.
Differential Revision: https://reviews.llvm.org/D63281
llvm-svn: 366799
Pavel Labath [Tue, 23 Jul 2019 12:26:09 +0000 (12:26 +0000)]
Fix windows build after r366791
A side effect of this commit was that it exchanged the order of types
and compile units in the output of SymbolVendor::Dump. A couple of PDB
tests dependened on that to assert the links between the two.
While it wouldn't be too hard to update the tests, the change of
ordering was not something I intended to do with that patch, and is easy
to restore the original order, so I do just that.
llvm-svn: 366798
Sam Elliott [Tue, 23 Jul 2019 11:40:55 +0000 (11:40 +0000)]
[RISCV] Re-enable rv32i-aliases-invalid.s test
We were getting test failures on some builders, which pointed to @LINE
being an undefined variable. I think that these failures should have
been fixed by https://reviews.llvm.org/rL366434, so I'm re-enabling the
test.
llvm-svn: 366797
George Rimar [Tue, 23 Jul 2019 11:37:14 +0000 (11:37 +0000)]
[Object/ELF.h] - Improve testing of the fields in ELFFile<ELFT>::sections().
This eliminates a one error untested and
also introduces a error for one more possible case
which lead to crash previously.
Differential revision: https://reviews.llvm.org/D64987
llvm-svn: 366796
Raphael Isemann [Tue, 23 Jul 2019 11:08:12 +0000 (11:08 +0000)]
[lldb][NFC] Tablegenify source
llvm-svn: 366795
George Rimar [Tue, 23 Jul 2019 11:03:37 +0000 (11:03 +0000)]
[yaml2obj] - Add a support for defining null sections in YAMLs.
ELF spec shows (Figure 4-10: Section Header Table Entry:Index 0,
http://www.sco.com/developers/gabi/latest/ch4.sheader.html)
that section header at index 0 (null section) can have sh_size and
sh_link fields set to non-zero values.
It says (https://docs.oracle.com/cd/E19683-01/817-3677/6mj8mbtc9/index.html):
"If the number of sections is greater than or equal to SHN_LORESERVE (0xff00),
this member has the value zero and the actual number of section header table
entries is contained in the sh_size field of the section header at index 0.
Otherwise, the sh_size member of the initial entry contains 0."
and:
"If the section name string table section index is greater than or equal to SHN_LORESERVE
(0xff00), this member has the value SHN_XINDEX (0xffff) and the actual index of the section
name string table section is contained in the sh_link field of the section header at index 0.
Otherwise, the sh_link member of the initial entry contains 0."
At this moment it is not possible to create custom section headers at index 0 using yaml2obj.
This patch implements this.
Differential revision: https://reviews.llvm.org/D64913
llvm-svn: 366794
Simon Pilgrim [Tue, 23 Jul 2019 10:51:43 +0000 (10:51 +0000)]
[SLPVectorizer] Remove null-pointer test. NFCI.
cast<CallInst> shouldn't return null and we dereference the pointer in a lot of other places, causing both MSVC + cppcheck to warn about dereferenced null pointers
llvm-svn: 366793
Balazs Keri [Tue, 23 Jul 2019 10:21:42 +0000 (10:21 +0000)]
PlistDiagnostics Fix for compile warning (NFC).
llvm-svn: 366792
Pavel Labath [Tue, 23 Jul 2019 09:24:02 +0000 (09:24 +0000)]
SymbolVendor: Move compile unit handling into the SymbolFile class
Summary:
SymbolFile classes are responsible for creating CompileUnit instances
and they already need to have a notion of the id<->CompileUnit mapping
(because of APIs like ParseCompileUnitAtIndex). However, the
SymbolVendor has remained as the thing responsible for caching created
units (which the SymbolFiles were calling via convoluted constructs like
"m_obj_file->GetModule()->GetSymbolVendor()->SetCompileUnitAtIndex(...)").
This patch moves the responsibility of caching the units into the
SymbolFile class. It does this by moving the implementation of
SymbolVendor::{GetNumCompileUnits,GetCompileUnitAtIndex} into the
equivalent SymbolFile functions. The SymbolVendor functions become just
a passthrough much like the rest of SymbolVendor.
The original implementations of SymbolFile::GetNumCompileUnits is moved
to "CalculateNumCompileUnits", and are made protected, as the "Get"
function is the external api of the class.
SymbolFile::ParseCompileUnitAtIndex is made protected for the same
reason.
This is the first step in removing the SymbolVendor indirection, as
proposed in
<http://lists.llvm.org/pipermail/lldb-dev/2019-June/015071.html>. After
removing all interesting logic from the SymbolVendor class, I'll proceed
with removing the indirection itself.
Reviewers: clayborg, jingham, JDevlieghere
Subscribers: jdoerfert, lldb-commits
Differential Revision: https://reviews.llvm.org/D65089
llvm-svn: 366791
David Green [Tue, 23 Jul 2019 09:19:24 +0000 (09:19 +0000)]
[ARM] Rename NEONModImm to VMOVModImm. NFC
Rename NEONModImm to VMOVModImm as it is used in both NEON and MVE.
llvm-svn: 366790
Hideto Ueno [Tue, 23 Jul 2019 08:29:22 +0000 (08:29 +0000)]
[Attributor][NFC] Re-run clang-format on the Attributor.cpp
llvm-svn: 366789
Hideto Ueno [Tue, 23 Jul 2019 08:16:17 +0000 (08:16 +0000)]
[Attributor] Deduce "dereferenceable" attribute
Summary:
Deduce dereferenceable attribute in Attributor.
These will be added in a later patch.
* dereferenceable(_or_null)_globally (D61652)
* Deduction based on load instruction (similar to D64258)
Reviewers: jdoerfert, sstefan1
Reviewed By: jdoerfert
Subscribers: hiraditya, jfb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64876
llvm-svn: 366788
Eugene Leviant [Tue, 23 Jul 2019 08:03:30 +0000 (08:03 +0000)]
[llvm-objcopy] Allow strip symtab in executables and DSOs
Re-commit of the patch after addressing -Wl,--emit-relocs case.
Differential revision: https://reviews.llvm.org/D61672
llvm-svn: 366787
Yi Kong [Tue, 23 Jul 2019 07:41:17 +0000 (07:41 +0000)]
Fix gold-plugin Windows build
r365588 missed one instance of integer file descriptor use in
gold-plugin.cpp.
llvm-svn: 366786
George Rimar [Tue, 23 Jul 2019 07:38:44 +0000 (07:38 +0000)]
[yaml2elf] - Treat the SHN_UNDEF section as kind of regular section.
We have a logic that adds a few sections implicitly.
Though the SHT_NULL section with section number 0
is an exception.
In D64913 I want to teach yaml2obj to redefine the null section.
And in this patch I add it to the sections list,
to make it kind of a regular section.
Differential revision: https://reviews.llvm.org/D65087
llvm-svn: 366785
Martin Storsjo [Tue, 23 Jul 2019 07:28:23 +0000 (07:28 +0000)]
[test] Fix the test from the previous commit when run on windows. NFC.
Apparently the escaped dollar sign didn't work the same way in "echo -e"
on windows buildbots.
llvm-svn: 366784
Raphael Isemann [Tue, 23 Jul 2019 07:15:54 +0000 (07:15 +0000)]
[lldb][NFC] Tablegenify disassemble
llvm-svn: 366783
Balazs Keri [Tue, 23 Jul 2019 07:04:20 +0000 (07:04 +0000)]
[CrossTU] Added CTU argument to diagnostic consumer create fn.
Summary:
The PListDiagnosticConsumer needs a new CTU parameter that is passed
through the create functions.
Reviewers: NoQ, Szelethus, xazax.hun, martong
Reviewed By: Szelethus
Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64635
llvm-svn: 366782
Hideto Ueno [Tue, 23 Jul 2019 06:48:47 +0000 (06:48 +0000)]
[AMDGPU][NFC] Simplify test file for amdgcn intrinsics
Summary: Remove unchecked attribute in the call site and use FileCheck String Substitution for `convergent` check.
Reviewers: nhaehnle
Reviewed By: nhaehnle
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64901
llvm-svn: 366781
Martin Storsjo [Tue, 23 Jul 2019 06:38:04 +0000 (06:38 +0000)]
[COFF] Unbreak sorting of mingw comdat .tls sections after SVN r363457
Code built for mingw with -fdata-sections will store each TLS variable
in a comdat section, named .tls$$<varname>. Normal TLS variables are
stored in sections named .tls$ with a trailing dollar, which are
sorted after a starter marker (in a later linked object file) in a
section named ".tls" (with no dollar suffix), before an ending marker
in a section named ".tls$ZZZ".
The mingw comdat section suffix stripping introduced in SVN r363457
broke sorting of such tls sections, ending up sorting the stripped
.tls$$<varname> sections (stripped to ".tls") before the start marker
in the section named ".tls".
We could add exceptions to the section name suffix stripping for
.tls (and .CRT, where suffixes always should be honored), but the
more conservative option is probably the reverse; to only apply the
stripping for the normal sections where sorting shouldn't have any
effect.
Differential Revision: https://reviews.llvm.org/D65018
llvm-svn: 366780
Craig Topper [Tue, 23 Jul 2019 05:13:39 +0000 (05:13 +0000)]
[DAGCombiner] Make ShrinkLoadReplaceStoreWithStore return an SDValue instead of an SDNode*. NFCI
The function was calling getNode() on an SDValue to return and the
caller turned the result back into a SDValue. So just return the
original SDValue to avoid this.
llvm-svn: 366779
Craig Topper [Tue, 23 Jul 2019 05:13:35 +0000 (05:13 +0000)]
[DAGCombiner] Use SDNode::isOperandOf to simplify some code. NFCI
llvm-svn: 366778
Robert Widmann [Tue, 23 Jul 2019 04:56:44 +0000 (04:56 +0000)]
[LLVM-C] Improve Bindings to The Internalize Pass
Summary: Adds a binding to the internalize pass that allows the caller to pass a function pointer that acts as the visibility-preservation predicate. Previously, one could only pass an unsigned value (not LLVMBool?) that directed the pass to consider "main" or not.
Reviewers: whitequark, deadalnix, harlanhaskins
Reviewed By: whitequark, harlanhaskins
Subscribers: kren1, hiraditya, llvm-commits, harlanhaskins
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62456
llvm-svn: 366777
Marshall Clow [Tue, 23 Jul 2019 04:20:19 +0000 (04:20 +0000)]
Implement most of P1612R1: Relocate endian. Moves the std::endian functionality from 'type-traits' to 'bit'. No other change. The reason that this is 'partial' is that P1621 also recommends a feature-test macro, but I don't have the value for that one yet. In a month or so, I'll add that
llvm-svn: 366776
Zi Xuan Wu [Tue, 23 Jul 2019 03:34:40 +0000 (03:34 +0000)]
[PowerPC] Replace float load/store pair with integer load/store pair when it's only used in load/store
Replace float load/store pair with integer load/store pair when it's only used in load/store,
because float load/store instructions cost more cycles then integer load/store.
A typical scenario is when there is a call with more than 13 float arguments passing, we need pass them by stack.
So we need a load/store pair to do such memory operation if the variable is global variable.
Differential Revision: https://reviews.llvm.org/D64195
llvm-svn: 366775
Richard Trieu [Tue, 23 Jul 2019 03:10:06 +0000 (03:10 +0000)]
Inline function call into assert to fix unused variable warning.
llvm-svn: 366774
Richard Trieu [Tue, 23 Jul 2019 02:59:15 +0000 (02:59 +0000)]
Move variable out from debug only section.
MFI is no longer just needed for an assert. Move it out of the debug only
section to allow non-assert builds to be able to find it.
llvm-svn: 366773
Shoaib Meenai [Tue, 23 Jul 2019 00:42:03 +0000 (00:42 +0000)]
[llvm-lipo] Implement -info
Prints architecture type of all input files.
Patch by Anusha Basana <anusha.basana@gmail.com>
Differential Revision: https://reviews.llvm.org/D64668
llvm-svn: 366772
Alex Langford [Tue, 23 Jul 2019 00:41:00 +0000 (00:41 +0000)]
[lldb][test_suite] Fix skipIfTargetAndroid decorator
Summary:
Delete the duplicate func `skipIfTargetAndroid`
Fix the old one. It didn't work for missing an argument `bugnumber`, this somehow made the decorator failed
Differential Revision: https://reviews.llvm.org/D64583
Patch by Wanyi Ye <kusmour@gmail.com>
llvm-svn: 366771
Alex Langford [Tue, 23 Jul 2019 00:28:26 +0000 (00:28 +0000)]
[lldb][test_suite] skip tests of `libstdcpp` on Android and clean up
Summary: Delete the android target from `libstdcpp` test category, since android no longer support libstdcxx
Reviewers: xiaobai, labath
Reviewed By: labath
Subscribers: srhines, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D64771
llvm-svn: 366770
Stefan Stipanovic [Mon, 22 Jul 2019 23:58:23 +0000 (23:58 +0000)]
Fixing build error from commit 95cbc3d
[Attributor] Liveness analysis.
Liveness analysis abstract attribute used to indicate which BasicBlocks are dead and can therefore be ignored.
Right now we are only looking at noreturn calls.
Reviewers: jdoerfert, uenoku
Subscribers: hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D64162
llvm-svn: 366769
Jonas Devlieghere [Mon, 22 Jul 2019 23:48:01 +0000 (23:48 +0000)]
[Logging] Replace LogIfAnyCategoriesSet with LLDB_LOG.
This patch removes any remaining instances of LogIfAnyCategoriesSet and
replaces them with the LLDB_LOG macro. This in turn made it possible to
make Log::VAPrintf and Log::VAError private.
llvm-svn: 366768
Antonio Afonso [Mon, 22 Jul 2019 23:35:05 +0000 (23:35 +0000)]
Restore tests for lldb-server and lldb-vscode removed at rL366590
Summary: This was removed here rL366590 by accident.
Reviewers: xiaobai, jfb
Reviewed By: xiaobai
Subscribers: dexonsmith, srhines, krytarowski, jfb, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D65123
llvm-svn: 366766
Philip Reames [Mon, 22 Jul 2019 23:33:18 +0000 (23:33 +0000)]
[Statepoints] Fix a bug in statepoint lowering for functions w/no-realign-stack
We were silently using the ABI alignment for all of the stores generated for deopt and gc values. We'd gotten the alignment of the stack slot itself properly reduced (via MachineFrameInfo's clamping), but having the MMO on the store incorrect was enough for us to generate an aligned store to a unaligned location.
The simplest fix would have been to just pass the alignment to the helper function, but once we do that, the helper function doesn't really help. So, inline it and directly call the MMO version of DAG.getStore with a properly constructed MMO.
Note that there's a separate performance possibility here. Even if we *can* realign stacks, we probably don't *want to* if all of the stores are in slowpaths. But that's a later patch, if at all. :)
llvm-svn: 366765
Peter Collingbourne [Mon, 22 Jul 2019 23:32:41 +0000 (23:32 +0000)]
Fix pointer width in test from r366754.
llvm-svn: 366764
Nico Weber [Mon, 22 Jul 2019 23:23:38 +0000 (23:23 +0000)]
gn build: Wrap two comments to 80 columns
llvm-svn: 366763
Jonas Devlieghere [Mon, 22 Jul 2019 23:23:34 +0000 (23:23 +0000)]
[DWARF] Add more error handling to debug line parser.
This patch exnteds the error handling in the debug line parser to get
rid of the existing MD5 assertion. I want to reuse the debug line parser
from LLVM in LLDB where we cannot crash on invalid input.
Differential revision: https://reviews.llvm.org/D64544
llvm-svn: 366762
Puyan Lotfi [Mon, 22 Jul 2019 23:10:10 +0000 (23:10 +0000)]
[NFC][clang] Refactor getCompilationPhases()+Types.def step 1.
Moves list of phases into Types.def table: Currently Types.def contains a
table of strings that are used to assemble a list of compilation phases to be
setup in the clang driver's jobs pipeline. This change makes it so that the table
itself contains the list of phases. A subsequent patch will remove the strings.
Differential Revision: https://reviews.llvm.org/D64098
llvm-svn: 366761
Philip Reames [Mon, 22 Jul 2019 23:08:56 +0000 (23:08 +0000)]
[Statepoints] Add a test which shows a miscompile with no-realign-stacks
llvm-svn: 366760
Stefan Stipanovic [Mon, 22 Jul 2019 22:55:05 +0000 (22:55 +0000)]
Revert "Fixing build error from commit 9285295."
This reverts commit
95cbc3da8871f43c1ce2b2926afaedcd826202b1.
llvm-svn: 366759
David Blaikie [Mon, 22 Jul 2019 22:23:52 +0000 (22:23 +0000)]
llvm-objcopy/test: add REQUIRES: shell for use of umask
(follow-up to r365162)
llvm-svn: 366755
Peter Collingbourne [Mon, 22 Jul 2019 22:13:46 +0000 (22:13 +0000)]
Analysis: Don't look through aliases when simplifying GEPs.
It is not safe in general to replace an alias in a GEP with its aliasee
if the alias can be replaced with another definition (i.e. via strong/weak
resolution (linkonce_odr) or via symbol interposition (default visibility
in ELF)) while the aliasee cannot. An example of how this can go wrong is
in the included test case.
I was concerned that this might be a load-bearing misoptimization (it's
possible for us to use aliases to share vtables between base and derived
classes, and on Windows, vtable symbols will always be aliases in RTTI
mode, so this change could theoretically inhibit trivial devirtualization
in some cases), so I built Chromium for Linux and Windows with and without
this change. The file sizes of the resulting binaries were identical, so it
doesn't look like this is going to be a problem.
Differential Revision: https://reviews.llvm.org/D65118
llvm-svn: 366754
Stefan Stipanovic [Mon, 22 Jul 2019 22:10:59 +0000 (22:10 +0000)]
Fixing build error from commit 9285295.
[Attributor] Liveness analysis.
Liveness analysis abstract attribute used to indicate which BasicBlocks are dead and can therefore be ignored.
Right now we are only looking at noreturn calls.
Reviewers: jdoerfert, uenoku
Subscribers: hiraditya, llvm-commits
Differential revision: https://reviews.llvm.org/D64162
llvm-svn: 366753
Roman Lebedev [Mon, 22 Jul 2019 22:09:24 +0000 (22:09 +0000)]
[NFC][PatternMatch] Refactor code into a proper "matcher for any integral constant"
Having it as a proper matcher is better for reusability elsewhere
(in a follow-up patch.)
llvm-svn: 366752
Roman Lebedev [Mon, 22 Jul 2019 22:09:11 +0000 (22:09 +0000)]
[InstSimplify][NFC] Tests for skipping 'div-by-0' checks before @llvm.umul.with.overflow
These may remain after @llvm.umul.with.overflow was canonicalized
from the code that was originally doing the check via division.
llvm-svn: 366751
Roman Lebedev [Mon, 22 Jul 2019 22:09:02 +0000 (22:09 +0000)]
[SimplifyCFG][NFC] Test that we fail to flatten CFG in JPEG "sign" value extend pattern
This comes up in JPEG decoding, see e.g.
Figure F.12 – Extending the sign bit of a decoded value in V
of ITU T.81 (JPEG specification).
llvm-svn: 366750
Roman Lebedev [Mon, 22 Jul 2019 22:08:55 +0000 (22:08 +0000)]
[SimplifyCFG][NFC] Test that we fail to flatten CFG after forming @llvm.umul.with.overflow
Even if we formed @llvm.umul.with.overflow, we are still stuck
with that guard against div-by-zero, which is no longer needed,
because we didn't flatten the CFG.
llvm-svn: 366749
Roman Lebedev [Mon, 22 Jul 2019 22:08:45 +0000 (22:08 +0000)]
[InstCombine][NFC] Tests for canonicalization of unsigned multiply overflow check
llvm-svn: 366748
Roman Lebedev [Mon, 22 Jul 2019 22:08:35 +0000 (22:08 +0000)]
[NFC][PhaseOrdering] Add tests showcasing the problems of unsigned multiply overflow check
While we can form the @llvm.mul.with.overflow easily,
we are still left with that check that was guarding against div-by-0.
And in the second case we won't even flatten the CFG.
llvm-svn: 366747
Roman Lebedev [Mon, 22 Jul 2019 22:08:27 +0000 (22:08 +0000)]
[IndVarSimplify][NFC] Autogenerate check lines in loop_evaluate_1.ll
Being affected by upcoming patch.
llvm-svn: 366746
Jonas Devlieghere [Mon, 22 Jul 2019 21:51:04 +0000 (21:51 +0000)]
Remove Xcode project remnants
llvm-svn: 366745
Vedant Kumar [Mon, 22 Jul 2019 21:46:45 +0000 (21:46 +0000)]
[Driver] Set the default win32-macho debug format to DWARF
rdar://
53267670
Differential Revision: https://reviews.llvm.org/D65116
llvm-svn: 366744
Matt Arsenault [Mon, 22 Jul 2019 21:38:11 +0000 (21:38 +0000)]
AMDGPU: Don't use SDNodeXForm for DS offset output
The xform has no real valuewhen it's using out of a complex pattern
output. The complex pattern was already creating TargetConstants with
i16, so this was just unnecessary machinery.
This allows global isel to import the simple cases once the complex
pattern is implemented.
llvm-svn: 366743
Jonas Devlieghere [Mon, 22 Jul 2019 21:33:43 +0000 (21:33 +0000)]
Remove INSTALL.txt file
Its contents are stale and much better documentation can be found either
online or in the docs directory.
llvm-svn: 366742
Jonas Devlieghere [Mon, 22 Jul 2019 21:26:50 +0000 (21:26 +0000)]
[Docs] Remove stale documentation
This removes a stale piece of documentation about building LLDB with the
Xcode project.
llvm-svn: 366741
Jonas Devlieghere [Mon, 22 Jul 2019 21:20:23 +0000 (21:20 +0000)]
[LLDB] Remove the Xcode project
Finally, after a lot of hard work from a bunch of people, we're in a
state where we can unify LLDB's build system.
This patch removes the hand-maintained Xcode project in favor of using
CMake in combination with the Xcode generator. Going forward, we want to
focus our efforts on improving the generated Xcode project.
Differential revision: https://reviews.llvm.org/D65109
llvm-svn: 366739
Julian Lettner [Mon, 22 Jul 2019 21:13:19 +0000 (21:13 +0000)]
[TSan] Enable fiber tests on iOS simulator
These tests *do not* work on device, but they *do* work in the
simulator.
rdar://
53403778
llvm-svn: 366738
Eric Christopher [Mon, 22 Jul 2019 21:04:23 +0000 (21:04 +0000)]
Temporarily Revert "[Attributor] Liveness analysis." as it's breaking the build.
This reverts commit
9285295f75a231dc446fa7cbc10a0a391b3434a5.
llvm-svn: 366737
Stefan Stipanovic [Mon, 22 Jul 2019 20:54:30 +0000 (20:54 +0000)]
[Attributor] Liveness analysis.
Liveness analysis abstract attribute used to indicate which BasicBlocks are dead and can therefore be ignored.
Right now we are only looking at noreturn calls.
Reviewers: jdoerfert, uenoku
Subscribers: hiraditya, llvm-commits
Differential revision: https://reviews.llvm.org/D64162
llvm-svn: 366736
Louis Dionne [Mon, 22 Jul 2019 20:45:23 +0000 (20:45 +0000)]
[NFC][libc++] Add missing EXPLICIT to pair and tuple synopsis
The constructors for std::pair and std::tuple have been made conditionally
explicit, however the synopsis in the headers do not reflect that.
llvm-svn: 366735