Jatin Bhateja [Sun, 9 Jun 2019 09:59:26 +0000 (09:59 +0000)]
[X86] NFCI : Comment updation for EVEX to VEX translation.
Reviewers: llvm-commits, jbhateja
Reviewed By: jbhateja
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D63055
llvm-svn: 362898
Simon Pilgrim [Sun, 9 Jun 2019 09:07:30 +0000 (09:07 +0000)]
Use for-range loop. NFCI.
llvm-svn: 362897
Amara Emerson [Sun, 9 Jun 2019 07:31:25 +0000 (07:31 +0000)]
[AArch64][GlobalISel] Select immediate forms of cmp instructions.
A simple re-use of the immediate operand matcher and renderer functions.
rdar://
43795178
llvm-svn: 362896
Craig Topper [Sun, 9 Jun 2019 03:21:33 +0000 (03:21 +0000)]
[X86] Remove (store (f32 (extractelt (v4f32))) isel patterns which is redundant.
We emit a MOVSSmr and a COPY_TO_REGCLASS, but that's what we would get from
selecting the store and extractelt independently.
llvm-svn: 362895
Craig Topper [Sat, 8 Jun 2019 23:53:31 +0000 (23:53 +0000)]
[X86] Mutate scalar fceil/ffloor/ftrunc/fnearbyint/frint into X86ISD::RNDSCALE during PreProcessIselDAG to cut down on number of isel patterns.
Similar was done for vectors in r362535. Removes about 1200 bytes from the isel table.
llvm-svn: 362894
Ayke van Laethem [Sat, 8 Jun 2019 22:21:37 +0000 (22:21 +0000)]
[bindings/go] Add bindings to LLVMGet?CmpPredicate
Add bindings so that predicates on comparisons (icmp/fcmp) can be
inspected from IR.
Note: I considered adding Value.ICmpPredicate() etc. instead but
Value.IntPredicate() seemed easier to read and matches the name of the
returned type.
(This change was also pushed two commits ago but accidentally had the
wrong title and description.)
Revision: https://reviews.llvm.org/D53884
llvm-svn: 362893
Ayke van Laethem [Sat, 8 Jun 2019 22:17:51 +0000 (22:17 +0000)]
Revert "[bindings/go] Add Go bindings for CalledValue"
This reverts commit
f675a60ca7a93f22e22dd4209504a9846dd04630.
The commit had the wrong title/description. Sorry about the mess!
llvm-svn: 362892
Ayke van Laethem [Sat, 8 Jun 2019 22:15:38 +0000 (22:15 +0000)]
[bindings/go] Add Go bindings for CalledValue
This is very useful for inspecting generated IR, there appears to be no
other way to get the called function from a CallInst.
Differential Revision: https://reviews.llvm.org/D52972
llvm-svn: 362891
Ayke van Laethem [Sat, 8 Jun 2019 22:08:52 +0000 (22:08 +0000)]
[bindings/go] Add Go bindings for CalledValue
This is very useful for inspecting generated IR, there appears to be no
other way to get the called function from a CallInst.
Revision: https://reviews.llvm.org/D52972
llvm-svn: 362890
Ayke van Laethem [Sat, 8 Jun 2019 22:00:19 +0000 (22:00 +0000)]
[bindings/go] Add EraseFromParent
After using ReplaceAllUsesWith on an instruction, it may be necessary to
erase it even though it is dead.
llvm-svn: 362889
Ayke van Laethem [Sat, 8 Jun 2019 21:42:00 +0000 (21:42 +0000)]
[NFC] Test commit
Add a newline, which is missing according to go fmt.
llvm-svn: 362888
Kristof Umann [Sat, 8 Jun 2019 20:25:39 +0000 (20:25 +0000)]
[analyzer][NFC] Add dividers to BugReporterVisitors.cpp
Some minor formatting to make the file more readable.
Added //===----------===// around the implementation of class methods
and divided anonymous namespaces as per
https://llvm.org/docs/CodingStandards.html#anonymous-namespaces
llvm-svn: 362887
Roman Lebedev [Sat, 8 Jun 2019 19:38:14 +0000 (19:38 +0000)]
[X86][Codegen] Add missed pattern that may be a lea+neg
llvm-svn: 362886
Alex Langford [Sat, 8 Jun 2019 19:07:05 +0000 (19:07 +0000)]
[Target] Remove unused header from Process
I forgot to remove this when I removed GetCPPLanguageRuntime from
Process
llvm-svn: 362885
Alex Langford [Sat, 8 Jun 2019 18:45:00 +0000 (18:45 +0000)]
[LanguageRuntime] Introduce LLVM-style casts
Summary:
Using llvm-style rtti gives us stronger guarantees around casting
LanguageRuntimes.
As discussed in D62755
Differential Revision: https://reviews.llvm.org/D62934
llvm-svn: 362884
Martin Storsjo [Sat, 8 Jun 2019 18:26:27 +0000 (18:26 +0000)]
[ELF] [PPC] Fix a typo from SVN r362721
Apparently no test covers this exact codepath, but GCC produced a
warning about it.
llvm-svn: 362883
Martin Storsjo [Sat, 8 Jun 2019 18:26:24 +0000 (18:26 +0000)]
[MinGW] Support the -u/--undefined option.
This is implemented by the lld-link option -include:, just like
--require-defined. Contrary to --require-defined, the -u/--undefined
option allows the symbol to remain undefined in the end.
This should fix PR42121.
Differential Revision: https://reviews.llvm.org/D62876
llvm-svn: 362882
Martin Storsjo [Sat, 8 Jun 2019 18:26:18 +0000 (18:26 +0000)]
[COFF] Add an lld specific option /includeoptional
This works like /include, but is not fatal if the requested symbol
wasn't found. This allows implementing the GNU ld option -u.
Differential Revision: https://reviews.llvm.org/D62976
llvm-svn: 362881
Simon Pilgrim [Sat, 8 Jun 2019 17:02:00 +0000 (17:02 +0000)]
[DAGCombine] visitAND - merge (zext_inreg ((s)extload x)) -> (zextload x) combines. NFCI.
Same codegen, only differ by the oneuse limit for the sextload case.
llvm-svn: 362880
Sanjay Patel [Sat, 8 Jun 2019 15:12:33 +0000 (15:12 +0000)]
[InstSimplify] enhance fcmp fold with never-nan operand
This is 1 step towards correcting our usage of fast-math-flags when applied on an fcmp.
In this case, we are checking for 'nnan' on the fcmp itself rather than the operand of
the fcmp. But I'm leaving that clause in until we're more confident that we can stop
relying on fcmp's FMF.
By using the more general "isKnownNeverNaN()", we gain a simplification shown on the
tests with 'uitofp' regardless of the FMF on the fcmp (uitofp never produces a NaN).
On the tests with 'fabs', we are now relying on the FMF for the call fabs instruction
in addition to the FMF on the fcmp.
I'll update the 'ult' case below here as a follow-up assuming no problems here.
Differential Revision: https://reviews.llvm.org/D62979
llvm-svn: 362879
Sylvestre Ledru [Sat, 8 Jun 2019 15:07:55 +0000 (15:07 +0000)]
fix a typo unavaliable=>unavailable
llvm-svn: 362878
Hubert Tong [Sat, 8 Jun 2019 13:51:37 +0000 (13:51 +0000)]
[analyzer][NFC][tests] Pre-normalize expected-plists
As suggested in the review for D62949, this patch pre-normalizes the
reference expected output plist files by removing lines containing
fields for which we expect differences that should be ignored.
llvm-svn: 362877
Hubert Tong [Sat, 8 Jun 2019 13:48:25 +0000 (13:48 +0000)]
[analyzer][NFC][tests] Remove unused expected-plist files
llvm-svn: 362876
David Bolvansky [Sat, 8 Jun 2019 12:07:59 +0000 (12:07 +0000)]
[NFC] Added tests for D63038
llvm-svn: 362875
David Green [Sat, 8 Jun 2019 10:32:53 +0000 (10:32 +0000)]
[ARM] Adjust isLegalT1AddressImmediate for non-legal types
Types such as float and i64's do not have legal loads in Thumb1, but will still
be loaded with a LDR (or potentially multiple LDR's). As such we can treat the
cost of addressing mode calculations the same as an i32 and get some optimisation
benefits.
Differential Revision: https://reviews.llvm.org/D62968
llvm-svn: 362874
David Green [Sat, 8 Jun 2019 10:18:23 +0000 (10:18 +0000)]
[ARM] Add MVE addressing to isLegalT2AddressImmediate
Now with MVE being added, we can add the vector addressing mode costs for it.
These are generally imm7 multiplied by the size of the type being loaded /
stored.
Differential Revision: https://reviews.llvm.org/D62967
llvm-svn: 362873
David Green [Sat, 8 Jun 2019 10:09:02 +0000 (10:09 +0000)]
[ARM] Add fp16 addressing to isLegalT2AddressImmediate
The fp16 version of VLDR takes a imm8 multiplied by 2. This updates the costs
to account for those, and adds extra testing. It is dependant upon hasFPRegs16
as this is what the load/store instructions require.
Differential Revision: https://reviews.llvm.org/D62966
llvm-svn: 362872
David Green [Sat, 8 Jun 2019 09:58:05 +0000 (09:58 +0000)]
[ARM] Add extra gep costmodel tests for MVE and half float. NFC
llvm-svn: 362871
David Green [Sat, 8 Jun 2019 09:36:49 +0000 (09:36 +0000)]
[ARM] Add HasNEON for all Neon patterns in ARMInstrNEON.td. NFCI
We are starting to add an entirely separate vector architecture to the ARM
backend. To do that we need at least some separation between the existing NEON
and the new MVE code. This patch just goes through the Neon patterns and
ensures that they are predicated on HasNEON, giving MVE a stable place to start
from.
No tests yet as this is largely an NFC, and we don't have the other target that
will treat any of these intructions as legal.
Differential Revision: https://reviews.llvm.org/D62945
llvm-svn: 362870
Jonas Paulsson [Sat, 8 Jun 2019 06:42:02 +0000 (06:42 +0000)]
[SystemZ] Fix CMakeLists.txt for alphabetical order (NFC).
llvm-svn: 362869
Jonas Paulsson [Sat, 8 Jun 2019 06:19:15 +0000 (06:19 +0000)]
[SystemZ, RegAlloc] Favor 3-address instructions during instruction selection.
This patch aims to reduce spilling and register moves by using the 3-address
versions of instructions per default instead of the 2-address equivalent
ones. It seems that both spilling and register moves are improved noticeably
generally.
Regalloc hints are passed to increase conversions to 2-address instructions
which are done in SystemZShortenInst.cpp (after regalloc).
Since the SystemZ reg/mem instructions are 2-address (dst and lhs regs are
the same), foldMemoryOperandImpl() can no longer trivially fold a spilled
source register since the reg/reg instruction is now 3-address. In order to
remedy this, new 3-address pseudo memory instructions are used to perform the
folding only when the dst and lhs virtual registers are known to be allocated
to the same physreg. In order to not let MachineCopyPropagation run and
change registers on these transformed instructions (making it 3-address), a
new target pass called SystemZPostRewrite.cpp is run just after
VirtRegRewriter, that immediately lowers the pseudo to a target instruction.
If it would have been possibe to insert a COPY instruction and change a
register operand (convert to 2-address) in foldMemoryOperandImpl() while
trusting that the caller (e.g. InlineSpiller) would update/repair the
involved LiveIntervals, the solution involving pseudo instructions would not
have been needed. This is perhaps a potential improvement (see Phabricator
post).
Common code changes:
* A new hook TargetPassConfig::addPostRewrite() is utilized to be able to run a
target pass immediately before MachineCopyPropagation.
* VirtRegMap is passed as an argument to foldMemoryOperand().
Review: Ulrich Weigand, Quentin Colombet
https://reviews.llvm.org/D60888
llvm-svn: 362868
Fangrui Song [Sat, 8 Jun 2019 05:19:05 +0000 (05:19 +0000)]
[ELF][PPC] Simplify {read,write}FromHalf16
I've change the variable names used in PPC64.cpp from "Instr" to "Insn"
because "Insn" is a more common abbreviation for "instruction".
While changing PPC64.cpp relocateOne(), make R_PPC64_ADDR16_LO{_DS}
slightly more efficient by saving a read and a write for the TocOptimize
case.
Reviewed By: ruiu
Differential Revision: https://reviews.llvm.org/D63043
llvm-svn: 362867
Eric Fiselier [Sat, 8 Jun 2019 04:59:41 +0000 (04:59 +0000)]
update debugging docs to be less out of date
llvm-svn: 362866
Eric Fiselier [Sat, 8 Jun 2019 01:31:19 +0000 (01:31 +0000)]
Substantially reduce instantiations and debug size of std::function
std::function uses a standard allocator to manage its memory, however
standard allocators are templates and using them correctly requires
a stupid amount of instantiations. This leads to a substantial increase
in debug info and object sizes.
This patch addresses the issue by dropping the allocator when possible
and using raw new and delete to get memory.
This change decreases the object file size for the test func.wrap.func.con/F.pass.cpp by 33% and the final binary by 29% (when compiled with -g -ggnu-pubnames -gpubnames).
It also roughly halfs the number of entries in the pubnames and pubtype
sections.
llvm-svn: 362865
Nico Weber [Sat, 8 Jun 2019 01:27:47 +0000 (01:27 +0000)]
gn build: Merge r362857
llvm-svn: 362864
Seiya Nuta [Sat, 8 Jun 2019 01:22:54 +0000 (01:22 +0000)]
[llvm-objcopy][MachO] Recompute and update offset/size fields in the writer
Summary:
Recompute and update offset/size fields so that we can implement llvm-objcopy options like --only-section.
This patch is the first step and focuses on supporting load commands that covered by existing tests: executable files and
dynamic libraries are not supported.
Reviewers: alexshap, rupprecht, jhenderson
Reviewed By: alexshap, rupprecht
Subscribers: compnerd, jakehehrlich, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62652
llvm-svn: 362863
Alex Langford [Sat, 8 Jun 2019 00:55:03 +0000 (00:55 +0000)]
Revert "DWARF: Simplify SymbolFileDWARF::GetDWARFCompileUnit"
This reverts commit
58afc1bdebf9fa8b178d6c9d89af94c5cc091760.
This commit caused the test suite on macOS to fail many tests. It
appears that setting breakpoints is the issue. One example that fails
is the lit test Breakpoint/case-sensitive.test.
llvm-svn: 362862
Eric Fiselier [Sat, 8 Jun 2019 00:45:45 +0000 (00:45 +0000)]
Fix some incorrect std::function tests
llvm-svn: 362861
Mike Spertus [Sat, 8 Jun 2019 00:23:08 +0000 (00:23 +0000)]
Visualizer for APInt and remove obsolete visualizer
Visualizer for the simple case of APInt (uints < 2^64)
as will be required for Clang ConstantArrayType visualizer.
Also, removed obsolete VS2013 SmallVectorVisualizer as VS2013
is no longer supported.
llvm-svn: 362860
Kostya Serebryany [Sat, 8 Jun 2019 00:22:23 +0000 (00:22 +0000)]
Experimantal dfsan mode "fast16labels=1"
Summary:
dfsan mode "fast16labels=1".
In this mode the labels are treated as 16-bit bit masks.
Reviewers: pcc
Reviewed By: pcc
Subscribers: delcypher, #sanitizers, llvm-commits
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D62870
llvm-svn: 362859
Amara Emerson [Sat, 8 Jun 2019 00:05:17 +0000 (00:05 +0000)]
Factor out SelectionDAG's switch analysis and lowering into a separate component.
In order for GlobalISel to re-use the significant amount of analysis and
optimization code in SDAG's switch lowering, we first have to extract it and
create an interface to be used by both frameworks.
No test changes as it's NFC.
Differential Revision: https://reviews.llvm.org/D62745
llvm-svn: 362857
David Blaikie [Sat, 8 Jun 2019 00:01:21 +0000 (00:01 +0000)]
DebugInfo: Add support for 'nodebug' attribute on typedefs and alias templates
Seems like a logical extension to me - and of interest because it might
help reduce the debug info size of libc++ by applying this attribute to
type traits that have a disproportionate debug info cost compared to the
benefit (& possibly harm/confusion) they cause users.
llvm-svn: 362856
Keno Fischer [Fri, 7 Jun 2019 23:34:00 +0000 (23:34 +0000)]
[analyzer] Add werror flag for analyzer warnings
Summary:
We're using the clang static analyzer together with a number of
custom analyses in our CI system to ensure that certain invariants
are statiesfied for by the code every commit. Unfortunately, there
currently doesn't seem to be a good way to determine whether any
analyzer warnings were emitted, other than parsing clang's output
(or using scan-build, which then in turn parses clang's output).
As a simpler mechanism, simply add a `-analyzer-werror` flag to CC1
that causes the analyzer to emit its warnings as errors instead.
I briefly tried to have this be `Werror=analyzer` and make it go
through that machinery instead, but that seemed more trouble than
it was worth in terms of conflicting with options to the actual build
and special cases that would be required to circumvent the analyzers
usual attempts to quiet non-analyzer warnings. This is simple and it
works well.
Reviewed-By: NoQ, Szelethusw
Differential Revision: https://reviews.llvm.org/D62885
llvm-svn: 362855
Matt Arsenault [Fri, 7 Jun 2019 23:17:38 +0000 (23:17 +0000)]
LoopDistribute: Add testcase where SCEV wants to insert a runtime
check.
Only the memory based checks were being tested. Prepare for fix in
convergent handling.
llvm-svn: 362854
Keno Fischer [Fri, 7 Jun 2019 23:08:38 +0000 (23:08 +0000)]
[GVN] non-functional code movement
Summary: Move some code around, in preparation for later fixes
to the non-integral addrspace handling (D59661)
Patch By Jameson Nash <jameson@juliacomputing.com>
Reviewed By: reames, loladiro
Differential Revision: https://reviews.llvm.org/D59729
llvm-svn: 362853
Matt Arsenault [Fri, 7 Jun 2019 23:02:52 +0000 (23:02 +0000)]
AMDGPU: Force skips around traps
llvm-svn: 362852
Reid Kleckner [Fri, 7 Jun 2019 22:05:12 +0000 (22:05 +0000)]
[COFF] Fix /export:foo=bar when bar is a weak alias
Summary:
When handling exports from the command line or from .def files, the
linker does a "fuzzy" string lookup to allow finding mangled symbols.
However, when the symbol is re-exported under a new name, the linker has
to transfer the decorations from the exported symbol over to the new
name. This is implemented by taking the mangled symbol that was found in
the object and replacing the original symbol name with the export name.
Before this patch, LLD implemented the fuzzy search by adding an
undefined symbol with the unmangled name, and then during symbol
resolution, checking if similar mangled symbols had been added after the
last round of symbol resolution. If so, LLD makes the original symbol a
weak alias of the mangled symbol. Later, to get the original symbol
name, LLD would look through the weak alias and forward it on to the
import library writer, which copies the symbol decorations. This
approach doesn't work when bar is itself a weak alias, as is the case in
asan. It's especially bad when the aliasee of bar contains the string
"bar", consider "bar_default". In this case, we would end up exporting
the symbol "foo_default" when we should've exported just "foo".
To fix this, don't look through weak aliases to find the mangled name.
Save the mangled name earlier during fuzzy symbol lookup.
Fixes PR42074
Reviewers: mstorsjo, ruiu
Subscribers: thakis, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62984
llvm-svn: 362849
Alexander Shaposhnikov [Fri, 7 Jun 2019 22:03:02 +0000 (22:03 +0000)]
[llvm-lipo] Add docs for llvm-lipo
Add docs (llvm-lipo.rst) for llvm-lipo.
Test plan:
make -j8 sphinx
check that ./docs/html/CommandGuide/llvm-lipo.html is built correctly and looks okay.
Differential revision: https://reviews.llvm.org/D62706
llvm-svn: 362848
Jordan Rupprecht [Fri, 7 Jun 2019 21:49:26 +0000 (21:49 +0000)]
[llvm-objdump] Fix Bugzilla ID 41862 to support checking addresses of disassembled object
Summary:
This fixes the bugzilla id,41862 to support dealing with checking
stop address against start address to support this not being a
proper object to check the disasembly against like gnu objdump
currently does.
Reviewers: jakehehrlich, rupprecht, echristo, jhenderson, grimar
Reviewed By: jhenderson
Subscribers: MaskRay, smeenai, rupprecht, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D61969
Patch by Nicholas Krause!
llvm-svn: 362847
Adrian McCarthy [Fri, 7 Jun 2019 21:14:33 +0000 (21:14 +0000)]
Fix string literals to avoid deprecation warnings in regexp patterns
In LLDB, where tests run with the debug version of Python, we get a
series of deprecation warnings because escape sequences like `\(` are
being treated as part of the string literal rather than an escape for
the regexp pattern.
NFC intended.
Differential Revision: https://reviews.llvm.org/D62882
llvm-svn: 362846
Adrian McCarthy [Fri, 7 Jun 2019 21:14:01 +0000 (21:14 +0000)]
NFC: Fix typo in a cmake message
llvm-svn: 362845
Adrian McCarthy [Fri, 7 Jun 2019 21:13:30 +0000 (21:13 +0000)]
Fix lit tests on Windows related to CR+LF
Problem discovered in the breakpoint lit test, but probably exists in others.
lldb-test splits lines on LF. Input files that are CR+LF separated (as is
common on Windows) then resulted in commands being sent to LLDB that ended
in CR, which confused the command interpreter.
This could be fixed at different levels:
1. Treat '\r' like a tab or space in the argument splitter.
2. Fix the line splitters (plural) in lldb-test.
3. Normalize the test files to LF only.
If we did only 3, I'd expect similar problems to recur, so this patch does
1 and 2. I may also do 3 in a separate patch later, but that's tricky
because I believe we have some input files that MUST use CR+LF.
Differential Revision: https://reviews.llvm.org/D62759
llvm-svn: 362844
Jorge Gorbe Moya [Fri, 7 Jun 2019 21:09:30 +0000 (21:09 +0000)]
[lldb] Fix msan use-of-uninitialized-value in DWARFDebugLine::FileNameEntry.
lldb/lit/SymbolFile/DWARF/debug-types-expressions.test fails with msan.
This change fixes the issue by ensuring FileNameEntry::checksum is
always default-initialized.
llvm-svn: 362843
Mitch Phillips [Fri, 7 Jun 2019 20:56:32 +0000 (20:56 +0000)]
[GWP-ASan] Removed unittests from Android build.
Summary:
Longstanding issues in the Android test runner means that compiler-rt unit
tests don't work on Android due to libc++ link-time issues. Looks like the
exported libc++ from the Android NDK is x86-64, even though it's part of the
ARM[64] toolchain... See similar measures for ASan and sanitizer-common that
disable unit tests for Android.
Should fully fix the Android bots (@vlad.tsyrklevich).
Reviewers: vitalybuka
Reviewed By: vitalybuka
Subscribers: srhines, kubamracek, mgorny, javed.absar, kristof.beyls, #sanitizers, llvm-commits, vlad.tsyrklevich
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D63019
llvm-svn: 362842
Shoaib Meenai [Fri, 7 Jun 2019 20:52:17 +0000 (20:52 +0000)]
[llvm-lipo] Drop unneeded braces. NFC
llvm-svn: 362841
Shoaib Meenai [Fri, 7 Jun 2019 20:47:58 +0000 (20:47 +0000)]
[llvm-lipo] Implement -archs
Displays the architecture names of an input file.
Unknown architectures are represented by unknown(cputype,cpusubtype).
Patch by Anusha Basana <anusha.basana@gmail.com>
Differential Revision: https://reviews.llvm.org/D62753
llvm-svn: 362840
Alina Sbirlea [Fri, 7 Jun 2019 20:43:55 +0000 (20:43 +0000)]
[DomTreeUpdater] Add all insert before all delete updates to reduce compile time.
Summary:
The cleanup in D62751 introduced a compile-time regression due to the way DT updates are performed.
Add all insert edges then all delete edges in DTU to match the previous compile time.
Compile time on the test provided by @mstorsjo before and after this patch on my machine:
113.046s vs 35.649s
Repro: clang -target x86_64-w64-mingw32 -c -O3 glew-preproc.c; on https://martin.st/temp/glew-preproc.c.
Reviewers: kuhar, NutshellySima, mstorsjo
Subscribers: jlebar, mstorsjo, dmgreen, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62981
llvm-svn: 362839
Michael Pozulp [Fri, 7 Jun 2019 20:34:31 +0000 (20:34 +0000)]
[llvm-objdump] Add warning if --disassemble-functions specifies an unknown symbol
Summary:
Fixes Bug 41904 https://bugs.llvm.org/show_bug.cgi?id=41904
Re-land r362768 after it was reverted in r362826.
Reviewers: jhenderson, rupprecht, grimar, MaskRay
Reviewed By: jhenderson, rupprecht, MaskRay
Subscribers: dexonsmith, rupprecht, kristina, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62275
llvm-svn: 362838
Craig Topper [Fri, 7 Jun 2019 20:30:40 +0000 (20:30 +0000)]
[X86] Remove unnecessary new line escape from the end of a macro. NFC
llvm-svn: 362837
Peter Collingbourne [Fri, 7 Jun 2019 20:26:47 +0000 (20:26 +0000)]
Relax test so that the clang binary doesn't need to be named "clang".
llvm-svn: 362836
Michael Pozulp [Fri, 7 Jun 2019 20:23:03 +0000 (20:23 +0000)]
[ADT] Enable set_difference() to be used on StringSet
Summary: Re-land r362766 after it was reverted in r362823.
Reviewers: jhenderson, dsanders, aaron.ballman, MatzeB, lhames, dblaikie
Reviewed By: dblaikie
Subscribers: smeenai, mgrang, mgorny, dexonsmith, kristina, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62369
llvm-svn: 362835
Volkan Keles [Fri, 7 Jun 2019 20:19:27 +0000 (20:19 +0000)]
[GlobalISel] IRTranslator: Translate the intrinsics ignored by CodeGen
Summary:
Translate `llvm.assume`, `llvm.var.annotation` and `llvm.sideeffect` to nothing
as they have no effect on CodeGen.
Reviewers: qcolombet, aditya_nandakumar, dsanders, paquette, aemerson, arsenm
Reviewed By: arsenm
Subscribers: hiraditya, wdng, rovka, kristof.beyls, javed.absar, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D63022
llvm-svn: 362834
Nick Desaulniers [Fri, 7 Jun 2019 19:51:22 +0000 (19:51 +0000)]
[APFloat] APFloat::Storage::Storage - refix use after move
Summary:
Re-land r360675 after it was reverted in r360770.
This was reported in:
https://llvm.org/reports/scan-build/
Based on feedback in:
https://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-
20190513/652286.html
Reviewers: RKSimon, efriedma
Reviewed By: RKSimon, efriedma
Subscribers: eli.friedman, hiraditya, llvm-commits, srhines
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62767
llvm-svn: 362833
Lang Hames [Fri, 7 Jun 2019 19:33:51 +0000 (19:33 +0000)]
[ORC] Update symbol lookup to use a single callback with a required symbol state
rather than two callbacks.
The asynchronous lookup API (which the synchronous lookup API wraps for
convenience) used to take two callbacks: OnResolved (called once all requested
symbols had an address assigned) and OnReady to be called once all requested
symbols were safe to access). This patch updates the asynchronous lookup API to
take a single 'OnComplete' callback and a required state (SymbolState) to
determine when the callback should be made. This simplifies the common use case
(where the client is interested in a specific state) and will generalize neatly
as new states are introduced to track runtime initialization of symbols.
Clients who were making use of both callbacks in a single query will now need to
issue two queries (one for SymbolState::Resolved and another for
SymbolState::Ready). Synchronous lookup API clients who were explicitly passing
the WaitOnReady argument will now need neeed to pass a SymbolState instead (for
'WaitOnReady == true' use SymbolState::Ready, for 'WaitOnReady == false' use
SymbolState::Resolved). Synchronous lookup API clients who were using default
arugment values should see no change.
llvm-svn: 362832
Peter Collingbourne [Fri, 7 Jun 2019 19:23:19 +0000 (19:23 +0000)]
docs: Update partitioning docs now that the feature is fully landed.
llvm-svn: 362831
Vlad Tsyrklevich [Fri, 7 Jun 2019 19:18:30 +0000 (19:18 +0000)]
Revert "[CodeComplete] Improve overload handling for C++ qualified and ref-qualified methods."
This reverts commit
f1f6e0fc2468e9c120b22b939507c527d08b8ee8, it was
causing LSan failures on the sanitizer bots:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/32809
llvm-svn: 362830
Peter Collingbourne [Fri, 7 Jun 2019 19:10:08 +0000 (19:10 +0000)]
Driver, IRGen: Set partitions on GlobalValues according to -fsymbol-partition flag.
Differential Revision: https://reviews.llvm.org/D62636
llvm-svn: 362829
Cameron McInally [Fri, 7 Jun 2019 18:59:51 +0000 (18:59 +0000)]
[IR] Add UnaryOperator::CreateFNegFMF(...)
Differential Revision: https://reviews.llvm.org/D62705
llvm-svn: 362828
Peter Collingbourne [Fri, 7 Jun 2019 18:57:32 +0000 (18:57 +0000)]
Unbreak 32-bit build.
llvm-svn: 362827
Vlad Tsyrklevich [Fri, 7 Jun 2019 18:55:12 +0000 (18:55 +0000)]
Revert "[llvm-objdump] Add warning if --disassemble-functions specifies an unknown symbol"
This reverts commit
50f61af3f304a03f10d9ecb0828829f0a72d0099, it used
the function introduced in the previous revert of
0bddef79019a23ab14fcdb27028e55e484674c88.
llvm-svn: 362826
Simon Pilgrim [Fri, 7 Jun 2019 18:36:43 +0000 (18:36 +0000)]
[DAGCombine] visitAND - fix local shadow variable warnings. NFCI.
llvm-svn: 362825
Anton Afanasyev [Fri, 7 Jun 2019 18:35:58 +0000 (18:35 +0000)]
Revert "[Support][Test] Time profiler: add regression test"
This reverts commit
44282a60c90fdded249d57d91b12c6c0907102ec.
This breaks buildbot.
llvm-svn: 362824
Vlad Tsyrklevich [Fri, 7 Jun 2019 18:34:29 +0000 (18:34 +0000)]
Revert "[ADT] Enable set_difference() to be used on StringSet"
This reverts commit
0bddef79019a23ab14fcdb27028e55e484674c88, it was
causing ASan failures on the sanitizer bots:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/32800
llvm-svn: 362823
Simon Pilgrim [Fri, 7 Jun 2019 18:20:09 +0000 (18:20 +0000)]
Fix -Wunused-lambda-capture warning. NFCI.
llvm-svn: 362822
Anton Afanasyev [Fri, 7 Jun 2019 18:13:48 +0000 (18:13 +0000)]
[Support][Test] Time profiler: add regression test
Summary:
Add output to `llvm::errs()` when `-ftime-trace` option is enabled,
add regression test checking this option works as expected.
Reviewers: thakis, aganea
Subscribers: cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D61914
> llvm-svn: 362792
llvm-svn: 362821
Simon Pilgrim [Fri, 7 Jun 2019 18:07:06 +0000 (18:07 +0000)]
[DAGCombine] Use APInt::extractBits in "sub-splat" constant mask detection. NFCI.
llvm-svn: 362820
Peter Collingbourne [Fri, 7 Jun 2019 17:57:58 +0000 (17:57 +0000)]
ELF: Create synthetic sections for loadable partitions.
We create several types of synthetic sections for loadable partitions, including:
- The dynamic symbol table. This allows code outside of the loadable partitions
to find entry points with dlsym.
- Creating a dynamic symbol table also requires the creation of several other
synthetic sections for the partition, such as the dynamic table and hash table
sections.
- The partition's ELF header is represented as a synthetic section in the
combined output file, and will be used by llvm-objcopy to extract partitions.
Differential Revision: https://reviews.llvm.org/D62350
llvm-svn: 362819
Peter Collingbourne [Fri, 7 Jun 2019 17:57:48 +0000 (17:57 +0000)]
llvm-objcopy: Implement --extract-partition and --extract-main-partition.
This implements the functionality described in
https://lld.llvm.org/Partitions.html. It works as follows:
- Reads the section headers using the ELF header at file offset 0;
- If extracting a loadable partition:
- Finds the section containing the required partition ELF header by looking it up in the section table;
- Reads the ELF and program headers from the section.
- If extracting the main partition:
- Reads the ELF and program headers from file offset 0.
- Filters the section table according to which sections are in the program headers that it read:
- If ParentSegment != nullptr or section is not SHF_ALLOC, then it goes in.
- Sections containing partition ELF headers or program headers are excluded as there are no headers for these in ordinary ELF files.
Differential Revision: https://reviews.llvm.org/D62364
llvm-svn: 362818
Matt Arsenault [Fri, 7 Jun 2019 17:55:07 +0000 (17:55 +0000)]
AMDGPU: Fix MIR test verifier error
llvm-svn: 362817
Simon Pilgrim [Fri, 7 Jun 2019 17:37:04 +0000 (17:37 +0000)]
Revert rL362792 : [Support][Test] Time profiler: add regression test
Summary:
Add output to `llvm::errs()` when `-ftime-trace` option is enabled,
add regression test checking this option works as expected.
Reviewers: thakis, aganea
Subscribers: cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D61914
........
Breaks buildbots - @anton-afanasyev please can you take a look?
llvm-svn: 362816
Jonas Devlieghere [Fri, 7 Jun 2019 17:35:19 +0000 (17:35 +0000)]
[dsymutil] Use the number of threads specified.
Before this patch we used either a single thread, or the number of
hardware threads available, effectively ignoring the number of threads
specified on the command line.
llvm-svn: 362815
David Green [Fri, 7 Jun 2019 17:28:12 +0000 (17:28 +0000)]
[ARM] Add ACLE feature macros for MVE.
Fixup uninitialised variable.
llvm-svn: 362814
James Henderson [Fri, 7 Jun 2019 16:43:44 +0000 (16:43 +0000)]
[docs]Move llvm-readobj from "Developer Tools" to "Basic Commands"
On the Command Guide page, there are multiple sections with links to the
different documentation pages available for LLVM tools. The "Basic
Tools" section includes tools like llvm-objdump, llvm-nm and so on. The
"Developer Tools" section contains things like FileCheck and lit. This
change moves llvm-readobj into the former block, from the latter.
Reviewed by: MaskRay
Differential Revision: https://reviews.llvm.org/D63011
llvm-svn: 362813
Ilya Biryukov [Fri, 7 Jun 2019 16:31:06 +0000 (16:31 +0000)]
AST Matchers tutorial requests to enable clang-tools-extra. NFC
Otherwise the examples do not build.
llvm-svn: 362812
Ilya Biryukov [Fri, 7 Jun 2019 16:24:38 +0000 (16:24 +0000)]
[clangd] Return empty results on spurious completion triggers
Summary:
We currently return an error, this causes `coc.nvim` and VSCode to
show an error message in the logs.
Returning empty list of completions allows to avod the error message
without altering other user-visible behavior.
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62999
llvm-svn: 362811
Sanjay Patel [Fri, 7 Jun 2019 16:09:54 +0000 (16:09 +0000)]
[Analysis] simplify code for getSplatValue(); NFC
AFAIK, this is only currently called by TTI, but it could be
used from instcombine or CGP to help solve problems like:
https://bugs.llvm.org/show_bug.cgi?id=37428
https://bugs.llvm.org/show_bug.cgi?id=42174
llvm-svn: 362810
Nico Weber [Fri, 7 Jun 2019 16:06:27 +0000 (16:06 +0000)]
Attempt to fix nm-archive.test after r362798
llvm-lib now needs a `target triple` for bitcode, so add a new file
that's like trivial.ll but has one, and use that in the test.
(trivial.ll had a comment that looked like it wasn't supposed to be used
in tests directly, so I don't want to change that file.)
llvm-svn: 362809
David Tenty [Fri, 7 Jun 2019 15:45:25 +0000 (15:45 +0000)]
Build with _XOPEN_SOURCE defined on AIX
Summary:
It is useful to build with _XOPEN_SOURCE defined on AIX, enabling X/Open
and POSIX compatibility mode, to work around stray macros and other
bugs in the headers provided by the system and build compiler.
This patch adds the config to cmake to build with _XOPEN_SOURCE defined
on AIX with a few exceptions. Google Test internals require access to
platform specific thread info constructs on AIX so in that case we build
with _ALL_SOURCE defined instead. Libclang also uses header which needs
_ALL_SOURCE on AIX so we leave that as is as well.
We also add building on AIX with the large file API and doing CMake
header checks with X/OPEN definitions so the results are consistent with
the environment that will be present in the build.
Reviewers: hubert.reinterpretcast, xingxue, andusy
Reviewed By: hubert.reinterpretcast
Subscribers: mgorny, jsji, cfe-commits, llvm-commits
Tags: #llvm, #clang
Differential Revision: https://reviews.llvm.org/D62533
llvm-svn: 362808
Sjoerd Meijer [Fri, 7 Jun 2019 15:20:56 +0000 (15:20 +0000)]
[ARM] Add ACLE feature macros for MVE
If MVE is present at all, then the macro __ARM_FEATURE_MVE is defined
to a value which has bit 0 set for integer MVE, and bit 1 set for
floating-point MVE.
(Floating-point MVE implies integer MVE, so if this macro is defined
at all then it will be set to 1 or 3, never 2.)
Patch mostly by Simon Tatham
Differential Revision: https://reviews.llvm.org/D60710
llvm-svn: 362806
Jinsong Ji [Fri, 7 Jun 2019 14:54:47 +0000 (14:54 +0000)]
[MachineScheduler] checkResourceLimit boundary condition update
When we call checkResourceLimit in bumpCycle or bumpNode, and we
know the resource count has just reached the limit (the equations
are equal). We should return true to mark that we are resource
limited for next schedule, or else we might continue to schedule
in favor of latency for 1 more schedule and create a schedule that
actually overbook the resource.
When we call checkResourceLimit to estimate the resource limite before
scheduling, we don't need to return true even if the equations are
equal, as it shouldn't limit the schedule for it .
Differential Revision: https://reviews.llvm.org/D62345
llvm-svn: 362805
Stefan Granitz [Fri, 7 Jun 2019 14:32:51 +0000 (14:32 +0000)]
[CMake] Add special case for processing LLDB_DOTEST_ARGS
Summary:
Allow to run the test suite when building LLDB Standalone with Xcode against a provided LLVM build-tree that used a single-configuration generator like Ninja.
So far both test drivers, lit-based `check-lldb` as well as `lldb-dotest`, were looking for test dependencies (clang/dsymutil/etc.) in a subdirectory with the configuration name (Debug/Release/etc.). It was implicitly assuming that both, LLDB and the provided LLVM used the same generator. In practice, however, the opposite is quite common: build the dependencies with Ninja and LLDB with Xcode for development*. With this patch it becomes the default.
(* In fact, it turned out that the Xcode<->Xcode variant didn't even build out of the box. It's fixed since D62879)
Once this is sound, I'm planning the following steps:
* add stage to the [lldb-cmake-standalone bot](http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake-standalone/) to build and test it
* update `Building LLDB with Xcode` section in the docs
* bring the same mechanism to swift-lldb
* fade out the manually maintained Xcode project
On macOS build and test like this:
```
$ git clone https://github.com/llvm/llvm-project.git /path/to/llvm-project
$ cd /path/to/lldb-dev-deps
$ cmake -GNinja -C/path/to/llvm-project/lldb/cmake/caches/Apple-lldb-macOS.cmake -DLLVM_ENABLE_PROJECTS="clang;libcxx;libcxxabi" /path/to/llvm-project/llvm
$ ninja
$ cd /path/to/lldb-dev-xcode
$ cmake -GXcode -C/path/to/llvm-project/lldb/cmake/caches/Apple-lldb-macOS.cmake -DLLDB_BUILD_FRAMEWORK=Off -DLLVM_DIR=/path/to/lldb-dev-deps/lib/cmake/llvm -DClang_DIR=/path/to/lldb-dev-deps/lib/cmake/clang /path/to/llvm-project/lldb
$ xcodebuild -configuration Debug -target check-lldb
$ xcodebuild -configuration Debug -target lldb-dotest
$ ./Debug/bin/lldb-dotest
```
Reviewers: JDevlieghere, jingham, xiaobai, stella.stamenova, labath
Reviewed By: stella.stamenova
Subscribers: labath, mgorny, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D62859
llvm-svn: 362803
Stefan Stipanovic [Fri, 7 Jun 2019 14:18:02 +0000 (14:18 +0000)]
test-commit
llvm-svn: 362802
David Bolvansky [Fri, 7 Jun 2019 14:05:42 +0000 (14:05 +0000)]
[NFC] Added tests for D63004
llvm-svn: 362801
Matt Arsenault [Fri, 7 Jun 2019 13:33:34 +0000 (13:33 +0000)]
TailDuplicator: Remove no-op analyzeBranch call
This could fail, which looked concerning. However nothing was actually
using the results of this. I assume this was intended to use the
anti-feature of analyzeBranch of removing instructions, but wasn't
actually calling it with AllowModify = true.
Fixes bug 42162.
llvm-svn: 362800
Joerg Sonnenberger [Fri, 7 Jun 2019 13:28:52 +0000 (13:28 +0000)]
[NFC] Don't export helpers of ConstantFoldCall
llvm-svn: 362799
Nico Weber [Fri, 7 Jun 2019 13:24:34 +0000 (13:24 +0000)]
llvm-lib: Disallow mixing object files with different machine types
lib.exe doesn't allow creating .lib files with object files that have
differing machine types. Update llvm-lib to match.
The motivation is to make it possible to infer the machine type of a
.lib file in lld, so that it can warn when e.g. a 32-bit .lib file is
passed to a 64-bit link (PR38965).
Fixes PR38782.
Differential Revision: https://reviews.llvm.org/D62913
llvm-svn: 362798
Sanjay Patel [Fri, 7 Jun 2019 13:17:46 +0000 (13:17 +0000)]
[x86] narrow extract subvector of vector select
This is a potentially large perf win for AVX1 targets because of the way we
auto-vectorize to 256-bit but then expect the backend to legalize/optimize
for the half-implemented AVX1 ISA.
On the motivating example from PR37428 (even though this patch doesn't solve
the vector shift issue):
https://bugs.llvm.org/show_bug.cgi?id=37428
...there's a 16% speedup when compiling with "-mavx" (perf tested on Haswell)
because we eliminate the remaining 256-bit vblendv ops.
I added comments on a couple of tests that require further work. If we have
256-bit logic ops separating the vselect and extract, we should probably narrow
everything to 128-bit, but that requires a larger pattern match.
Differential Revision: https://reviews.llvm.org/D62969
llvm-svn: 362797
Nico Weber [Fri, 7 Jun 2019 13:09:40 +0000 (13:09 +0000)]
gn build: Merge r362766
llvm-svn: 362796
Nico Weber [Fri, 7 Jun 2019 13:08:17 +0000 (13:08 +0000)]
gn build: Merge r362774
llvm-svn: 362795
Nico Weber [Fri, 7 Jun 2019 13:07:00 +0000 (13:07 +0000)]
gn build: Run `git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format`
llvm-svn: 362794