Artem Dergachev [Sat, 15 Dec 2018 01:50:58 +0000 (01:50 +0000)]
[analyzer] MoveChecker: NFC: De-duplicate a few checks.
No functional change intended.
Differential Revision: https://reviews.llvm.org/D55387
llvm-svn: 349225
Florian Hahn [Sat, 15 Dec 2018 01:32:58 +0000 (01:32 +0000)]
[SILoadStoreOptimizer] Use std::abs to avoid truncation.
Using regular abs() causes the following warning
error: absolute value function 'abs' given an argument of type 'int64_t' (aka 'long') but has parameter of type 'int' which may cause truncation of value [-Werror,-Wabsolute-value]
(uint32_t)abs(Dist) > MaxDist) {
^
lib/Target/AMDGPU/SILoadStoreOptimizer.cpp:1369:19: note: use function 'std::abs' instead
which causes a bot to fail:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/18284/steps/bootstrap%20clang/logs/stdio
llvm-svn: 349224
Craig Topper [Sat, 15 Dec 2018 01:07:19 +0000 (01:07 +0000)]
[X86] Rename hasNoSignedComparisonUses to hasNoSignFlagUses. Add the instruction that only modify the O flag to the waiver list.
The only caller of this turns CMP with 0 into TEST. CMP with 0 and TEST both set OF to 0 so we should have no issues with instructions that only use OF.
Though I don't think there's any reason we would read just OF after a compare with 0 anyway. So this probably isn't an observable change.
llvm-svn: 349223
Craig Topper [Sat, 15 Dec 2018 01:07:16 +0000 (01:07 +0000)]
[X86] Make hasNoCarryFlagUses/hasNoSignedComparisonUses take an SDValue that indicates which result is the flag result. NFCI
hasNoCarryFlagUses hardcoded that the flag result is 1 and used that to filter which uses were of interest. hasNoSignedComparisonUses just assumes the only result is flags and checks whether any user of the node is a CopyToReg instruction.
After this patch we now do a result number check in both and rely on the caller to provide the result number.
This shouldn't change behavior it was just an odd difference between the two functions that I noticed.
llvm-svn: 349222
Heejin Ahn [Sat, 15 Dec 2018 00:58:12 +0000 (00:58 +0000)]
[WebAssembly] Check if the section order is correct
Summary:
This patch checks if the section order is correct when reading a wasm
object file in `WasmObjectFile` and converting YAML to wasm object in
yaml2wasm. (It is not possible to check when reading YAML because it is
handled exclusively by the YAML reader.)
This checks the ordering of all known sections (core sections + known
custom sections). This also adds section ID DataCount section that will
be scheduled to be added in near future.
Reviewers: sbc100
Subscribers: dschuff, mgorny, jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D54924
llvm-svn: 349221
Florian Hahn [Sat, 15 Dec 2018 00:32:38 +0000 (00:32 +0000)]
[NewGVN] Update use counts for SSA copies when replacing them by their operands.
The current code relies on LeaderUseCount to determine if we can remove
an SSA copy, but in that the LeaderUseCount does not refer to the SSA
copy. If a SSA copy is a dominating leader, we use the operand as dominating
leader instead. This means we removed a user of a ssa copy and we should
decrement its use count, so we can remove the ssa copy once it becomes dead.
Fixes PR38804.
Reviewers: efriedma, davide
Reviewed By: davide
Differential Revision: https://reviews.llvm.org/D51595
llvm-svn: 349217
Peter Collingbourne [Sat, 15 Dec 2018 00:20:17 +0000 (00:20 +0000)]
ELF: Handle R_ARM_V4BX correctly in PIC output files.
Previously we considered R_ARM_V4BX to be an absolute relocation,
which meant that we rejected it in read-only sections in PIC output
files. Instead, treat it as a hint relocation so that relocation
processing ignores it entirely.
Also fix a problem with the test case where it was never being run
because it has a .yaml extension and we don't run tests with that
extension.
Differential Revision: https://reviews.llvm.org/D55728
llvm-svn: 349216
Jonas Devlieghere [Sat, 15 Dec 2018 00:15:33 +0000 (00:15 +0000)]
Simplify Boolean expressions
This patch simplifies boolean expressions acorss LLDB. It was generated
using clang-tidy with the following command:
run-clang-tidy.py -checks='-*,readability-simplify-boolean-expr' -format -fix $PWD
Differential revision: https://reviews.llvm.org/D55584
llvm-svn: 349215
Vedant Kumar [Sat, 15 Dec 2018 00:03:33 +0000 (00:03 +0000)]
[Util] Refer to [s|z]exts of args when converting dbg.declares (fix PR35400)
When converting dbg.declares, if the described value is a [s|z]ext,
refer to the ext directly instead of referring to its operand.
This fixes a narrowing bug (the debugger got the sign of a variable
wrong, see llvm.org/PR35400).
The main reason to refer to the ext's operand was that an optimization
may remove the ext itself, leading to a dropped variable. Now that
InstCombine has been taught to use replaceAllDbgUsesWith (r336451), this
is less of a concern. Other passes can/should adopt this API as needed
to fix dropped variable bugs.
Differential Revision: https://reviews.llvm.org/D51813
llvm-svn: 349214
Artem Belevich [Fri, 14 Dec 2018 23:53:06 +0000 (23:53 +0000)]
[NVPTX] Lower instructions that expand into libcalls.
The change is an effort to split and refactor abandoned
D34708 into smaller parts.
Here the behaviour of unsupported instructions is changed
to match the behaviour of explicit intrinsics calls.
Currently LLVM crashes with:
> Assertion getInstruction() && "Not a call or invoke instruction!" failed.
With this patch LLVM produces a more sensible error message:
> Cannot select: ... i32 = ExternalSymbol'__foobar'
Author: Denys Zariaiev <denys.zariaiev@gmail.com>
Differential Revision: https://reviews.llvm.org/D55145
llvm-svn: 349213
Reid Kleckner [Fri, 14 Dec 2018 23:42:59 +0000 (23:42 +0000)]
Mangle calling conventions into function pointer types where GCC does
Summary:
GCC 5.1 began mangling these Windows calling conventions into function
types, since they can be used for overloading. They've always been
mangled in the MS ABI, but they are new to the Itanium mangler. Note
that the calling convention doesn't appear as part of the main
declaration, it only appears on function parameter types and other
types.
Fixes PR39860
Reviewers: rjmccall, efriedma
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D55672
llvm-svn: 349212
Jim Ingham [Fri, 14 Dec 2018 23:27:08 +0000 (23:27 +0000)]
Fix the unittests for the move of Listener & Broadcaster
from Core to Utility.
llvm-svn: 349211
Kostya Serebryany [Fri, 14 Dec 2018 23:21:31 +0000 (23:21 +0000)]
[libFuzzer] make len_control less aggressive
llvm-svn: 349210
Erich Keane [Fri, 14 Dec 2018 23:17:34 +0000 (23:17 +0000)]
Add AddressSpace mangling to MS mode
All of the symbols demangle on llvm-undname and demangler.com. This
address space qualifier is useful for when we want to use opencl C++ in
Windows mode. Additionally, C++ address-space using functions will now
be usable on windows.
Differential Revision: https://reviews.llvm.org/D55715
Change-Id: Ife4506613c3cce778a783456d62117fbf7d83c26
llvm-svn: 349209
Tatyana Krasnukha [Fri, 14 Dec 2018 23:02:41 +0000 (23:02 +0000)]
Update a comment according to r255360 "Remove -r and -R options from dotest.py"
llvm-svn: 349208
David Blaikie [Fri, 14 Dec 2018 22:44:46 +0000 (22:44 +0000)]
DebugInfo: Avoid using split DWARF when the split unit would be empty.
In ThinLTO many split CUs may be effectively empty because of the lack
of support for cross-unit references in split DWARF.
Using a split unit in those cases is just a waste/overhead - and turned
out to be one contributor to a significant symbolizer performance issue
when global variable debug info was being imported (see r348416 for the
primary fix) due to symbolizers seeing CUs with no ranges, assuming
there might still be addresses covered and walking into the split CU to
see if there are any ranges (when that split CU was in a DWP file, that
meant loading the DWP and its index, the index was extra large because
of all these fractured/empty CUs... and so was very expensive to load).
(the 3rd fix which will follow, is to assume that a CU with no ranges is
empty rather than merely missing its CU level range data - and to not
walk into its DIEs (split or otherwise) in search of address information
that is generally not present)
llvm-svn: 349207
Erich Keane [Fri, 14 Dec 2018 22:41:18 +0000 (22:41 +0000)]
Revert "Add extension to always default-initialize nullptr_t."
This reverts commit
46efdf2ccc2a80aefebf8433dbf9c7c959f6e629.
Richard Smith commented just after I submitted this that this is the
wrong solution. Reverting so that I can fix differently.
llvm-svn: 349206
Reid Kleckner [Fri, 14 Dec 2018 22:40:28 +0000 (22:40 +0000)]
[codeview] Add begin/endSymbolRecord helpers, NFC
Previously beginning a symbol record was excessively verbose. Now it's a
bit simpler. This follows the same pattern as begin/endCVSubsection.
llvm-svn: 349205
Michal Gorny [Fri, 14 Dec 2018 22:38:01 +0000 (22:38 +0000)]
[test] Capture stderr from 'tar --version' call as well
Capture the stderr from 'tar --version' call as otherwise error messages
spill onto user's terminal unnecessarily (e.g. on NetBSD where tar does
not support long options). While at it, refactor the code to use
communicate() instead of reinventing the wheel.
Differential Revision: https://reviews.llvm.org/D55443
llvm-svn: 349204
David Blaikie [Fri, 14 Dec 2018 22:34:03 +0000 (22:34 +0000)]
DebugInfo: Move addAddrBase from DwarfUnit to DwarfCompileUnit
Only CUs need an address table reference.
llvm-svn: 349203
Krzysztof Parzyszek [Fri, 14 Dec 2018 22:33:48 +0000 (22:33 +0000)]
[Hexagon] Add patterns for shifts of v2i16
This fixes https://llvm.org/PR39983.
llvm-svn: 349202
Erich Keane [Fri, 14 Dec 2018 22:22:29 +0000 (22:22 +0000)]
Add extension to always default-initialize nullptr_t.
Core issue 1013 suggests that having an uninitialied std::nullptr_t be
UB is a bit foolish, since there is only a single valid value. This DR
reports that DR616 fixes it, which does so by making lvalue-to-rvalue
conversions from nullptr_t be equal to nullptr.
However, just implementing that results in warnings/etc in many places.
In order to fix all situations where nullptr_t would seem uninitialized,
this patch instead (as an otherwise transparent extension) default
initializes uninitialized VarDecls of nullptr_t.
Differential Revision: https://reviews.llvm.org/D53713
Change-Id: I84d72a9290054fa55341e8cbdac43c8e7f25b885
llvm-svn: 349201
Volkan Keles [Fri, 14 Dec 2018 22:11:20 +0000 (22:11 +0000)]
[GlobalISel] LegalizerHelper: Implement fewerElementsVector for G_LOAD/G_STORE
Reviewers: aemerson, dsanders, bogner, paquette, aditya_nandakumar
Reviewed By: dsanders
Subscribers: rovka, kristof.beyls, javed.absar, tschuett, llvm-commits
Differential Revision: https://reviews.llvm.org/D53728
llvm-svn: 349200
Krzysztof Parzyszek [Fri, 14 Dec 2018 22:05:44 +0000 (22:05 +0000)]
[Hexagon] Use IMPLICIT_DEF to any-extend 32-bit values to 64 bits
llvm-svn: 349199
Rui Ueyama [Fri, 14 Dec 2018 21:58:49 +0000 (21:58 +0000)]
Add --plugin-opt=emit-llvm option.
`--plugin-opt=emit-llvm` is an option for LTO. It makes the linker to
combine all bitcode files and write the result to an output file without
doing codegen. Gold LTO plugin has this option.
This option is being used for some post-link code analysis tools that
have to see a whole program but don't need to see them in the native
machine code.
Differential Revision: https://reviews.llvm.org/D55717
llvm-svn: 349198
Aaron Ballman [Fri, 14 Dec 2018 21:14:44 +0000 (21:14 +0000)]
Using llvm::find_if() instead of a range-based for loop; NFC.
This addresses post-commit review feedback from r349188.
llvm-svn: 349197
Farhana Aleen [Fri, 14 Dec 2018 21:13:14 +0000 (21:13 +0000)]
[AMDGPU] Promote constant offset to the immediate by finding a new base with 13bit constant offset from the nearby instructions.
Summary: Promote constant offset to immediate by recomputing the relative 13bit offset from nearby instructions.
E.g.
s_movk_i32 s0, 0x1800
v_add_co_u32_e32 v0, vcc, s0, v2
v_addc_co_u32_e32 v1, vcc, 0, v6, vcc
s_movk_i32 s0, 0x1000
v_add_co_u32_e32 v5, vcc, s0, v2
v_addc_co_u32_e32 v6, vcc, 0, v6, vcc
global_load_dwordx2 v[5:6], v[5:6], off
global_load_dwordx2 v[0:1], v[0:1], off
=>
s_movk_i32 s0, 0x1000
v_add_co_u32_e32 v5, vcc, s0, v2
v_addc_co_u32_e32 v6, vcc, 0, v6, vcc
global_load_dwordx2 v[5:6], v[5:6], off
global_load_dwordx2 v[0:1], v[5:6], off offset:2048
Author: FarhanaAleen
Reviewed By: arsenm, rampitec
Subscribers: llvm-commits, AMDGPU
Differential Revision: https://reviews.llvm.org/D55539
llvm-svn: 349196
Eric Fiselier [Fri, 14 Dec 2018 21:11:28 +0000 (21:11 +0000)]
[Clang] Add __builtin_launder
Summary:
This patch adds `__builtin_launder`, which is required to implement `std::launder`. Additionally GCC provides `__builtin_launder`, so thing brings Clang in-line with GCC.
I'm not exactly sure what magic `__builtin_launder` requires, but based on previous discussions this patch applies a `@llvm.invariant.group.barrier`. As noted in previous discussions, this may not be enough to correctly handle vtables.
Reviewers: rnk, majnemer, rsmith
Reviewed By: rsmith
Subscribers: kristina, Romain-Geissler-1A, erichkeane, amharc, jroelofs, cfe-commits, Prazek
Differential Revision: https://reviews.llvm.org/D40218
llvm-svn: 349195
Adrian Prantl [Fri, 14 Dec 2018 21:06:00 +0000 (21:06 +0000)]
Remove the Disassembly benchmarks.
While I was out hunting for remaining pexpect-based tests, I came
across these tests that can't possibly work an any modern system, as
they rely on having gdb available in /Developer.
This patch simply removes the test without replacement.
Differential Revision: https://reviews.llvm.org/D55559
llvm-svn: 349194
Eric Fiselier [Fri, 14 Dec 2018 21:04:00 +0000 (21:04 +0000)]
Add missing includes and forward decls to unbreak build
llvm-svn: 349193
Alexey Bataev [Fri, 14 Dec 2018 21:00:58 +0000 (21:00 +0000)]
[OPENMP][NVPTX]Improved interwarp copy function.
Inlined runtime with the current implementation of the interwarp copy
function leads to the undefined behavior because of the not quite
correct implementation of the barriers. Start using generic
__kmpc_barier function instead of the custom made barriers.
llvm-svn: 349192
Artem Dergachev [Fri, 14 Dec 2018 20:52:57 +0000 (20:52 +0000)]
[analyzer] MoveChecker Pt.6: Suppress the warning for the move-safe STL classes.
Some C++ standard library classes provide additional guarantees about their
state after move. Suppress warnings on such classes until a more precise
behavior is implemented. Warnings for locals are not suppressed anyway
because it's still most likely a bug.
Differential Revision: https://reviews.llvm.org/D55307
llvm-svn: 349191
Artem Dergachev [Fri, 14 Dec 2018 20:47:58 +0000 (20:47 +0000)]
[analyzer] MoveChecker: Improve invalidation policies.
If a moved-from object is passed into a conservatively evaluated function
by pointer or by reference, we assume that the function may reset its state.
Make sure it doesn't apply to const pointers and const references. Add a test
that demonstrates that it does apply to rvalue references.
Additionally, make sure that the object is invalidated when its contents change
for reasons other than invalidation caused by evaluating a call conservatively.
In particular, when the object's fields are manipulated directly, we should
assume that some sort of reset may be happening.
Differential Revision: https://reviews.llvm.org/D55289
llvm-svn: 349190
Eric Fiselier [Fri, 14 Dec 2018 20:42:36 +0000 (20:42 +0000)]
Tolerate Clangs new static_assert messages
llvm-svn: 349189
Aaron Ballman [Fri, 14 Dec 2018 20:34:23 +0000 (20:34 +0000)]
Update our SARIF support from 10-10 to 11-28.
Functional changes include:
* The run.files property is now an array instead of a mapping.
* fileLocation objects now have a fileIndex property specifying the array index into run.files.
* The resource.rules property is now an array instead of a mapping.
* The result object was given a ruleIndex property that is an index into the resource.rules array.
* rule objects now have their "id" field filled out in addition to the name field.
* Updated the schema and spec version numbers to 11-28.
llvm-svn: 349188
Louis Dionne [Fri, 14 Dec 2018 20:22:44 +0000 (20:22 +0000)]
[libcxx] Mark some tests as still failing on macosx10.14
llvm-svn: 349187
Krzysztof Parzyszek [Fri, 14 Dec 2018 20:14:12 +0000 (20:14 +0000)]
[SDAG] Ignore chain operand in REG_SEQUENCE when emitting instructions
llvm-svn: 349186
Evandro Menezes [Fri, 14 Dec 2018 20:04:58 +0000 (20:04 +0000)]
[AArch64] Simplify the scheduling predicates (NFC)
The instruction encodings make it unnecessary to distinguish extended W-form
from X-form instructions.
llvm-svn: 349185
Michael Kruse [Fri, 14 Dec 2018 19:45:43 +0000 (19:45 +0000)]
[TransformWarning] Do not warn missed transformations in optnone functions.
Optimization transformations are intentionally disabled by the 'optnone'
function attribute. Therefore do not warn if transformation metadata is
still present.
Using the legacy pass manager structure, the `skipFunction` method takes
care for the optnone attribute (already called before this patch). For
the new pass manager, there is no equivalent, so we check for the
'optnone' attribute manually.
Differential Revision: https://reviews.llvm.org/D55690
llvm-svn: 349184
Greg Clayton [Fri, 14 Dec 2018 19:38:08 +0000 (19:38 +0000)]
Add missing .dmp files to test inputs.
llvm-svn: 349183
Greg Clayton [Fri, 14 Dec 2018 19:36:01 +0000 (19:36 +0000)]
Cache memory regions in ProcessMinidump and use the linux maps as the source of the information if available
Breakpad creates minidump files that sometimes have:
- linux maps textual content
- no MemoryInfoList
Right now unless the file has a MemoryInfoList we get no region information.
This patch:
- reads and caches the memory region info one time and sorts it for easy subsequent access
- get the region info from the best source in this order:
- linux maps info (if available)
- MemoryInfoList (if available)
- MemoryList or Memory64List
- returns memory region info for the gaps between regions (before the first and after the last)
Differential Revision: https://reviews.llvm.org/D55522
llvm-svn: 349182
Marshall Clow [Fri, 14 Dec 2018 19:25:22 +0000 (19:25 +0000)]
When resolving a merge conflict, I put something inside an #ifdef. Fixed.
llvm-svn: 349181
Greg Clayton [Fri, 14 Dec 2018 19:22:24 +0000 (19:22 +0000)]
Fix Xcode project for MIPS architecture plug-in and move of Event, Listener and Broadcaster to Utility.
llvm-svn: 349180
Sanjay Patel [Fri, 14 Dec 2018 19:15:54 +0000 (19:15 +0000)]
[x86] add tests for extractelement of FP binops; NFC
llvm-svn: 349179
Marshall Clow [Fri, 14 Dec 2018 18:49:35 +0000 (18:49 +0000)]
Implement P1209 - Adopt Consistent Container Erasure from Library Fundamentals 2 for C++20. Reviewed as https://reviews.llvm.org/D55532
llvm-svn: 349178
Sanjay Patel [Fri, 14 Dec 2018 18:47:04 +0000 (18:47 +0000)]
[ARM] make test immune to scalarization improvements; NFC
llvm-svn: 349177
Sanjay Patel [Fri, 14 Dec 2018 18:44:16 +0000 (18:44 +0000)]
[x86] make tests immune to scalarization improvements; NFC
llvm-svn: 349176
Zachary Turner [Fri, 14 Dec 2018 18:43:42 +0000 (18:43 +0000)]
[NativePDB] Fix local-variables.cpp test.
Since we're actually running an executable on the host now, different
versions of Windows could load different system libraries, so we need
to regex out the number of loaded modules.
llvm-svn: 349175
Daniel Sanders [Fri, 14 Dec 2018 18:25:05 +0000 (18:25 +0000)]
[globalisel][combiner] Fix r349167 for release mode bots
This test relies on -debug-only which is unavailable in non-asserts builds.
llvm-svn: 349174
Zachary Turner [Fri, 14 Dec 2018 18:21:20 +0000 (18:21 +0000)]
[ADT] Fix bugs in SmallBitVector.
Fixes:
* find_last/find_last_unset - off-by-one error
* Compound assignment ops and operator== when mixing big/small modes
Patch by Brad Moody
Differential Revision: https://reviews.llvm.org/D54933
llvm-svn: 349173
Zachary Turner [Fri, 14 Dec 2018 18:20:21 +0000 (18:20 +0000)]
Fix Visual Studio PointerIntPair visualizer
Patch by: Trass3r
Differential Revision: https://reviews.llvm.org/D55252
llvm-svn: 349172
Louis Dionne [Fri, 14 Dec 2018 18:19:14 +0000 (18:19 +0000)]
[libcxx] Make sure use_system_cxx_lib does not override cxx_runtime_root for DYLD_LIBRARY_PATH
Otherwise, even specifying a runtime root different from the library
we're linking against won't work -- the library we're linking against
is always used. This is undesirable if we try testing something like
linking against a recent libc++.dylib but running the tests against an
older version (the back-deployment use case).
llvm-svn: 349171
Michael Kruse [Fri, 14 Dec 2018 18:15:11 +0000 (18:15 +0000)]
[Transforms] Preserve metadata when converting invoke to call.
The `changeToCall` function did not preserve the invoke's metadata.
Currently, there is probably no metadata that depends on being applied
on a CallInst or InvokeInst. Therefore we can replace the instruction's
metadata.
This fixes http://llvm.org/PR39994
Suggested-by: Moritz Kreutzer <moritz.kreutzer@siemens.com>
Differential Revision: https://reviews.llvm.org/D55666
llvm-svn: 349170
Zachary Turner [Fri, 14 Dec 2018 18:10:13 +0000 (18:10 +0000)]
[MS Demangler] Fail gracefully on invalid pointer types.
Once we detect a 'P', we know we a pointer type is upcoming, so
we make some assumptions about the output that follows. If those
assumptions didn't hold, we would assert. Instead, we should
fail gracefully and propagate the error up.
llvm-svn: 349169
Zachary Turner [Fri, 14 Dec 2018 17:59:27 +0000 (17:59 +0000)]
[MS Demangler] Add a regression test for an invalid mangled name.
llvm-svn: 349168
Daniel Sanders [Fri, 14 Dec 2018 17:50:14 +0000 (17:50 +0000)]
[globalisel][combiner] Make the CombinerChangeObserver a MachineFunction::Delegate
Summary:
This allows us to register it with the MachineFunction delegate and be
notified automatically about erasure and creation of instructions. However,
we still need explicit notification for modifications such as those caused
by setReg() or replaceRegWith().
There is a catch with this though. The notification for creation is
delivered before any operands can be added. While appropriate for
scheduling combiner work. This is unfortunate for debug output since an
opcode by itself doesn't provide sufficient information on what happened.
As a result, the work list remembers the instructions (when debug output is
requested) and emits a more complete dump later.
Another nit is that the MachineFunction::Delegate provides const pointers
which is inconvenient since we want to use it to schedule future
modification. To resolve this GISelWorkList now has an optional pointer to
the MachineFunction which describes the scope of the work it is permitted
to schedule. If a given MachineInstr* is in this function then it is
permitted to schedule work to be performed on the MachineInstr's. An
alternative to this would be to remove the const from the
MachineFunction::Delegate interface, however delegates are not permitted
to modify the MachineInstr's they receive.
In addition to this, the observer has three interface changes.
* erasedInstr() is now erasingInstr() to indicate it is about to be erased
but still exists at the moment.
* changingInstr() and changedInstr() have been added to report changes
before and after they are made. This allows us to trace the changes
in the debug output.
* As a convenience changingAllUsesOfReg() and
finishedChangingAllUsesOfReg() will report changingInstr() and
changedInstr() for each use of a given register. This is primarily useful
for changes caused by MachineRegisterInfo::replaceRegWith()
With this in place, both combine rules have been updated to report their
changes to the observer.
Finally, make some cosmetic changes to the debug output and make Combiner
and CombinerHelp
Reviewers: aditya_nandakumar, bogner, volkan, rtereshin, javed.absar
Reviewed By: aditya_nandakumar
Subscribers: mgorny, rovka, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D52947
llvm-svn: 349167
Sanjay Patel [Fri, 14 Dec 2018 17:44:07 +0000 (17:44 +0000)]
[AArch64] make test immune to scalarization improvements; NFC
This is explicitly implementing what the comment says rather
than relying on the implicit zext of a costant operand.
llvm-svn: 349166
Zachary Turner [Fri, 14 Dec 2018 17:43:56 +0000 (17:43 +0000)]
Fix a crash in llvm-undname with invalid types.
llvm-svn: 349165
Sanjay Patel [Fri, 14 Dec 2018 17:28:52 +0000 (17:28 +0000)]
[SystemZ] make test immune to scalarization improvements; NFC
The undef operands mean this test is probably still too fragile
to accomplish what the comments suggest.
llvm-svn: 349164
Sanjay Patel [Fri, 14 Dec 2018 17:23:01 +0000 (17:23 +0000)]
[Hexagon] make test immune to scalarization improvements; NFC
llvm-svn: 349163
Sanjay Patel [Fri, 14 Dec 2018 16:49:57 +0000 (16:49 +0000)]
[x86] auto-generate complete checks; NFC
llvm-svn: 349162
Sanjay Patel [Fri, 14 Dec 2018 16:46:21 +0000 (16:46 +0000)]
[x86] regenerate test checks; NFC
llvm-svn: 349161
Sanjay Patel [Fri, 14 Dec 2018 16:44:58 +0000 (16:44 +0000)]
[x86] make tests immune to scalarization improvements; NFC
llvm-svn: 349160
Kamil Rytarowski [Fri, 14 Dec 2018 16:26:09 +0000 (16:26 +0000)]
Mark interception_failure_test.cc as passing for NetBSD and asan-dynamic-runtime
llvm-svn: 349159
Ehsan Amiri [Fri, 14 Dec 2018 16:19:02 +0000 (16:19 +0000)]
NFC. Adding an empty line to test the updated commit credentials.
llvm-svn: 349158
Pavel Labath [Fri, 14 Dec 2018 15:59:49 +0000 (15:59 +0000)]
Move Broadcaster+Listener+Event combo from Core into Utility
Summary:
These are general purpose "utility" classes, whose functionality is not
debugger-specific in any way. As such, I believe they belong in the
Utility module.
This doesn't break any particular dependency (yet), but it reduces the
number of Core dependencies across the board.
Reviewers: zturner, jingham, teemperor, clayborg
Subscribers: mgorny, lldb-commits
Differential Revision: https://reviews.llvm.org/D55361
llvm-svn: 349157
Kamil Rytarowski [Fri, 14 Dec 2018 15:58:05 +0000 (15:58 +0000)]
Set shared_libasan_path in lit tests for NetBSD
Reuse the Linux code path.
llvm-svn: 349156
Scott Linder [Fri, 14 Dec 2018 15:38:15 +0000 (15:38 +0000)]
Implement -frecord-command-line (-frecord-gcc-switches)
Implement options in clang to enable recording the driver command-line
in an ELF section.
Implement a new special named metadata, llvm.commandline, to support
frontends embedding their command-line options in IR/ASM/ELF.
This differs from the GCC implementation in some key ways:
* In GCC there is only one command-line possible per compilation-unit,
in LLVM it mirrors llvm.ident and multiple are allowed.
* In GCC individual options are separated by NULL bytes, in LLVM entire
command-lines are separated by NULL bytes. The advantage of the GCC
approach is to clearly delineate options in the face of embedded
spaces. The advantage of the LLVM approach is to support merging
multiple command-lines unambiguously, while handling embedded spaces
with escaping.
Differential Revision: https://reviews.llvm.org/D54487
Clang Differential Revision: https://reviews.llvm.org/D54489
llvm-svn: 349155
Pavel Labath [Fri, 14 Dec 2018 14:41:04 +0000 (14:41 +0000)]
Fix minidump unit test failures from r349062
This commit added new test inputs, but it did not add them to the cmake
files. This caused the test to fail at runtime.
While in there, I also sorted the list of minidump test inputs.
llvm-svn: 349154
Pavel Labath [Fri, 14 Dec 2018 14:25:20 +0000 (14:25 +0000)]
Fix build with older (<3.0) swigs
It turns out it wasn't the compilers, but swig who had issues with my
previous patch -- older versions do not recognise the "constexpr"
keyword.
Fortunately, that can be fixed the same way we fix all other swig
incompatibilities: #ifndef SWIG.
llvm-svn: 349153
Kadir Cetinkaya [Fri, 14 Dec 2018 14:17:18 +0000 (14:17 +0000)]
[dexp] Change FuzzyFind to also print scope of symbols
Summary:
When there are multiple symbols in the result of a fuzzy find with the
same name, one has to perform an additional query to figure out which of those
symbols are coming from the "interesting" scope. This patch prints the scope in
fuzzy find results to get rid of the second symbol.
Reviewers: hokein
Subscribers: ilya-biryukov, ioeric, jkorous, arphaman, cfe-commits
Differential Revision: https://reviews.llvm.org/D55705
llvm-svn: 349152
John Brawn [Fri, 14 Dec 2018 14:07:57 +0000 (14:07 +0000)]
[RegAllocGreedy] IMPLICIT_DEF values shouldn't prefer registers
It costs nothing to spill an IMPLICIT_DEF value (the only spill code that's
generated is a KILL of the value), so when creating split constraints if the
live-out value is IMPLICIT_DEF the exit constraint should be DontCare instead
of PrefReg.
Differential Revision: https://reviews.llvm.org/D55652
llvm-svn: 349151
Philipp Stephani [Fri, 14 Dec 2018 13:56:05 +0000 (13:56 +0000)]
clang-include-fixer.el: support remote files
Summary: Support remote files (e.g., Tramp) in the Emacs integration for clang-include-fixer
Reviewers: klimek
Reviewed By: klimek
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D54672
llvm-svn: 349150
Pavel Labath [Fri, 14 Dec 2018 13:51:20 +0000 (13:51 +0000)]
Mark Permissions as a bitmask enum
this allows one to use bitwise operators on the variables of this type
without complicated casting.
The gotcha here is that the combinations of these enums were being used
in some constexpr contexts such as case labels (case
ePermissionsWritable | ePermissionsExecutable:), which is not possible
if the user-defined operator| is not constexpr.
So, this commit also marks these operators as constexpr. I am committing
this as a small standalone patch so it can be easily reverted if some
compiler has an issue with this.
llvm-svn: 349149
Haojian Wu [Fri, 14 Dec 2018 13:49:00 +0000 (13:49 +0000)]
[clangd] Use buildCompilerInvocation to simplify the HeadersTests, NFC.
llvm-svn: 349148
Diana Picus [Fri, 14 Dec 2018 13:45:38 +0000 (13:45 +0000)]
[ARM GlobalISel] Thumb2: casts between int and ptr
Mark as legal and add tests. Nothing special to do.
llvm-svn: 349147
Diana Picus [Fri, 14 Dec 2018 13:28:34 +0000 (13:28 +0000)]
[ARM GlobalISel] Remove duplicate test. NFCI
Fixup for r349026. I forgot to delete these test functions from the
original file when I moved them to arm-legalize-exts.mir.
llvm-svn: 349146
Haojian Wu [Fri, 14 Dec 2018 13:19:38 +0000 (13:19 +0000)]
[clangd] Fix memory leak in ClangdTests.
Summary:
createInvocationFromCommandLine sets DisableFree to true by default,
which leads memory leak in clangd. The fix is to use the `BuildCompilationInvocation`
to create CI with the correct options (DisableFree is false).
Fix https://bugs.llvm.org/show_bug.cgi?id=39991.
Reviewers: kadircet
Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits
Differential Revision: https://reviews.llvm.org/D55702
llvm-svn: 349145
Haojian Wu [Fri, 14 Dec 2018 12:39:08 +0000 (12:39 +0000)]
[clangd] Fix an assertion failure in background index.
Summary:
When indexing a file which contains an uncompilable error, we will
trigger an assertion failure -- the IndexFileIn data is not set, but we
access them in the backgound index.
Reviewers: kadircet
Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits
Differential Revision: https://reviews.llvm.org/D55650
llvm-svn: 349144
Diana Picus [Fri, 14 Dec 2018 12:37:24 +0000 (12:37 +0000)]
[ARM GlobalISel] Minor refactoring. NFCI
Refactor the ARMInstructionSelector to cache some opcodes in the
constructor instead of checking all the time if we're in ARM or Thumb
mode.
llvm-svn: 349143
Diana Picus [Fri, 14 Dec 2018 11:58:14 +0000 (11:58 +0000)]
[ARM GlobalISel] Allow simple binary ops in Thumb2
Mark G_ADD, G_SUB, G_MUL, G_AND, G_OR and G_XOR as legal for both ARM
and Thumb2.
Extract the legalizer tests for these opcodes into another file.
Add tests for the instruction selector.
llvm-svn: 349142
Simon Tatham [Fri, 14 Dec 2018 11:39:55 +0000 (11:39 +0000)]
[TableGen:AsmWriter] Cope with consecutive tied operands.
When you define an instruction alias as a subclass of InstAlias, you
specify all the MC operands for the instruction it expands to, except
for operands that are tied to a previous one, which you leave out in
the expectation that the Tablegen output code will fill them in
automatically.
But the code in Tablegen's AsmWriter backend that skips over a tied
operand was doing it using 'if' instead of 'while', because it wasn't
expecting to find two tied operands in sequence.
So if an instruction updates a pair of registers in place, so that its
MC representation has two input operands tied to the output ones (for
example, Arm's UMLAL instruction), then any alias which wants to
expand to a special case of that instruction is likely to fail to
match, because the indices of subsequent operands will be off by one
in the generated printAliasInstr function.
This patch re-indents some existing code, so it's clearest when
viewed as a diff with whitespace changes ignored.
Reviewers: fhahn, rengolin, sdesmalen, atanasyan, asb, jholewinski, t.p.northover, kparzysz, craig.topper, stoklund
Reviewed By: rengolin
Subscribers: javed.absar, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D53816
llvm-svn: 349141
Luke Cheeseman [Fri, 14 Dec 2018 11:30:12 +0000 (11:30 +0000)]
[AArch64][libunwind] Unwinding support for return address signing
- Follow up to revision r342895
- gcc would not build libunwind with the earlier patch as the autia1716
instruction wasn't allowed to be assembled for pre armv8.3a targets
- The autia1716 instruction lives in the hint space encodings so is a valid
instruction for all armv8a targets
- To work around this I have swapped out the autia1716 instruction for the hint
instruction
Differential Revision: https://reviews.llvm.org/D55700
llvm-svn: 349140
Simon Pilgrim [Fri, 14 Dec 2018 09:25:08 +0000 (09:25 +0000)]
Revert rL349136: [llvm-exegesis] Optimize ToProcess in dbScan
Summary:
Use `vector<char> Added + vector<size_t> ToProcess` to replace `SetVector ToProcess`
We also check `Added[P]` to enqueueing a point more than once, which
also saves us a `ClusterIdForPoint_[Q].isUndef()` check.
Reviewers: courbet, RKSimon, gchatelet, john.brawn, lebedev.ri
Subscribers: tschuett, llvm-commits
Differential Revision: https://reviews.llvm.org/D54442
........
Patch wasn't approved and breaks buildbots
llvm-svn: 349139
Dan Liew [Fri, 14 Dec 2018 09:03:18 +0000 (09:03 +0000)]
Introduce `AddressSpaceView` template parameter to `SizeClassAllocator32`, `FlatByteMap`, and `TwoLevelByteMap`.
Summary:
This is a follow up patch to r346956 for the `SizeClassAllocator32`
allocator.
This patch makes `AddressSpaceView` a template parameter both to the
`ByteMap` implementations (but makes `LocalAddressSpaceView` the
default), some `AP32` implementations and is used in `SizeClassAllocator32`.
The actual changes to `ByteMap` implementations and
`SizeClassAllocator32` are very simple. However the patch is large
because it requires changing all the `AP32` definitions, and users of
those definitions.
For ASan and LSan we make `AP32` and `ByteMap` templateds type that take
a single `AddressSpaceView` argument. This has been done because we will
instantiate the allocator with a type that isn't `LocalAddressSpaceView`
in the future patches. For the allocators used in the other sanitizers
(i.e. HWAsan, MSan, Scudo, and TSan) use of `LocalAddressSpaceView` is
hard coded because we do not intend to instantiate the allocators with
any other type.
In the cases where untemplated types have become templated on a single
`AddressSpaceView` parameter (e.g. `PrimaryAllocator`) their name has
been changed to have a `ASVT` suffix (Address Space View Type) to
indicate they are templated. The only exception to this are the `AP32`
types due to the desire to keep the type name as short as possible.
In order to check that template is instantiated in the correct a way a
`static_assert(...)` has been added that checks that the
`AddressSpaceView` type used by `Params::ByteMap::AddressSpaceView` matches
the `Params::AddressSpaceView`. This uses the new `sanitizer_type_traits.h`
header.
rdar://problem/
45284065
Reviewers: kcc, dvyukov, vitalybuka, cryptoad, eugenis, kubamracek, george.karpenkov
Subscribers: mgorny, llvm-commits, #sanitizers
Differential Revision: https://reviews.llvm.org/D54904
llvm-svn: 349138
Craig Topper [Fri, 14 Dec 2018 08:28:24 +0000 (08:28 +0000)]
[DAGCombiner][X86] Prevent visitSIGN_EXTEND from returning N when (sext (setcc)) already has the target desired type for the setcc
Summary:
If the setcc already has the target desired type we can reach the getSetCC/getSExtOrTrunc after the MatchingVecType check with the exact same types as the nodes we started with. This causes those causes VsetCC to be CSEd to N0 and the getSExtOrTrunc will CSE to N. When we return N, the caller will think that meant we called CombineTo and did our own worklist management. But that's not what happened. This prevents target hooks from being called for the node.
To fix this, I've now returned SDValue if the setcc is already the desired type. But to avoid some regressions in X86 I've had to disable one of the target combines that wasn't being reached before in the case of a (sext (setcc)). If we get vector widening legalization enabled that entire function will be deleted anyway so hopefully this is only for the short term.
Reviewers: RKSimon, spatel
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D55459
llvm-svn: 349137
Fangrui Song [Fri, 14 Dec 2018 08:27:35 +0000 (08:27 +0000)]
[llvm-exegesis] Optimize ToProcess in dbScan
Summary:
Use `vector<char> Added + vector<size_t> ToProcess` to replace `SetVector ToProcess`
We also check `Added[P]` to enqueueing a point more than once, which
also saves us a `ClusterIdForPoint_[Q].isUndef()` check.
Reviewers: courbet, RKSimon, gchatelet, john.brawn, lebedev.ri
Subscribers: tschuett, llvm-commits
Differential Revision: https://reviews.llvm.org/D54442
llvm-svn: 349136
Fangrui Song [Fri, 14 Dec 2018 08:21:08 +0000 (08:21 +0000)]
[ThinLTO] Fix test added in rL349076
llvm-svn: 349135
Fangrui Song [Fri, 14 Dec 2018 08:09:43 +0000 (08:09 +0000)]
[sanitizer] Fix nolibc internal_sleep
Reviewers: kubamracek, vitalybuka
Reviewed By: vitalybuka
Subscribers: delcypher, llvm-commits, #sanitizers
Differential Revision: https://reviews.llvm.org/D55692
llvm-svn: 349134
Fangrui Song [Fri, 14 Dec 2018 07:46:58 +0000 (07:46 +0000)]
[Object] Rename getRelrRelocationType to getRelativeRelocationType
Summary:
The two utility functions were added in D47919 to support SHT_RELR.
However, these are just relative relocations types and are't
necessarily be named Relr.
Reviewers: phosek, dberris
Reviewed By: dberris
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D55691
llvm-svn: 349133
Ivan Donchevskii [Fri, 14 Dec 2018 07:44:52 +0000 (07:44 +0000)]
[clang-tidy] Remove extra config.h includes
It's included in a new header ClangTidyForceLinker.h and should not
be included the second time.
Follow up for the https://reviews.llvm.org/D55595
llvm-svn: 349132
Ivan Donchevskii [Fri, 14 Dec 2018 07:29:06 +0000 (07:29 +0000)]
[clang-tidy] Share the forced linking code between clang-tidy tool and plugin
Extract code that forces linking to the separate header and include it in both plugin and standalone tool.
Try 2: missing header guard and "clang/Config/config.h" are added to the new header.
Differential Revision: https://reviews.llvm.org/D55595
llvm-svn: 349131
Petr Hosek [Fri, 14 Dec 2018 06:06:19 +0000 (06:06 +0000)]
[llvm-xray] Use correct variable name
This fixes the compiler error introduced in r349129.
llvm-svn: 349130
Petr Hosek [Fri, 14 Dec 2018 05:56:20 +0000 (05:56 +0000)]
[llvm-xray] Store offset pointers in temporaries
DataExtractor::getU64 modifies the OffsetPtr which also pass to
RelocateOrElse which breaks on Windows. This addresses the issue
introduced in r349120.
Differential Revision: https://reviews.llvm.org/D55689
llvm-svn: 349129
Richard Trieu [Fri, 14 Dec 2018 05:40:30 +0000 (05:40 +0000)]
Remove unused variable.
llvm-svn: 349128
Eric Fiselier [Fri, 14 Dec 2018 03:48:09 +0000 (03:48 +0000)]
Update google benchmark again
llvm-svn: 349127
Eric Fiselier [Fri, 14 Dec 2018 03:37:13 +0000 (03:37 +0000)]
Update google benchmark version
llvm-svn: 349126
Richard Trieu [Fri, 14 Dec 2018 03:35:10 +0000 (03:35 +0000)]
Fix up diagnostics.
Move some diagnostics around between Diagnostic*Kinds.td files. Diagnostics
used in multiple places were moved to DiagnosticCommonKinds.td. Diagnostics
listed in the wrong place (ie, Sema diagnostics listed in
DiagnosticsParseKinds.td) were moved to the correct places. One diagnostic
split into two so that the diagnostic string is in the .td file instead of in
code. Cleaned up the diagnostic includes after all the changes.
llvm-svn: 349125
Nico Weber [Fri, 14 Dec 2018 03:20:46 +0000 (03:20 +0000)]
[gn build] Merge r348963 and r349076
llvm-svn: 349124
Stephane Moore [Fri, 14 Dec 2018 03:13:31 +0000 (03:13 +0000)]
[clang-tidy] Improve google-objc-function-naming diagnostics 📙
Summary:
The diagnostics from google-objc-function-naming check will be more
actionable if they provide a brief description of the requirements from
the Google Objective-C style guide. The more descriptive diagnostics may
help clarify that functions in the global namespace must have an
appropriate prefix followed by Pascal case (engineers working previously
with static functions might not immediately understand the different
requirements of static and non-static functions).
Test Notes:
Verified against the clang-tidy tests.
Reviewers: benhamilton, aaron.ballman
Reviewed By: benhamilton
Subscribers: MyDeveloperDay, xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D55482
llvm-svn: 349123