Simon Pilgrim [Wed, 16 May 2018 08:23:47 +0000 (08:23 +0000)]
[X86][SSE] Fix tests for vector rotates by splat variable.
We weren't correctly splatting the offset shift
llvm-svn: 332435
Francois Ferrand [Wed, 16 May 2018 08:03:52 +0000 (08:03 +0000)]
clang-format: tweak formatting of variable initialization blocks
Summary:
This patch changes the behavior of PenaltyBreakBeforeFirstCallParameter
so that is does not apply after a brace, when Cpp11BracedListStyle is
false.
This way, variable initialization is wrapped more like an initializer
than like a function call, which is more consistent with user
expectations for this braced list style.
With PenaltyBreakBeforeFirstCallParameter=200, this gives the following
code: (with Cpp11BracedListStyle=false)
Before :
const std::unordered_map<std::string, int> Something::MyHashTable =
{ { "
aaaaaaaaaaaaaaaaaaaaa", 0 },
{ "
bbbbbbbbbbbbbbbbbbbbb", 1 },
{ "
ccccccccccccccccccccc", 2 } };
After :
const std::unordered_set<std::string> Something::MyUnorderedSet = {
{ "
aaaaaaaaaaaaaaaaaaaaa", 0 },
{ "
bbbbbbbbbbbbbbbbbbbbb", 1 },
{ "
ccccccccccccccccccccc", 2 }
};
Reviewers: krasimir, djasper, klimek
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D43290
llvm-svn: 332434
Sander de Smalen [Wed, 16 May 2018 07:50:09 +0000 (07:50 +0000)]
[AArch64][SVE] Asm: Support for contiguous PRF prefetch instructions.
Reviewers: rengolin, fhahn, samparker, SjoerdMeijer, javed.absar
Reviewed By: SjoerdMeijer
Differential Revision: https://reviews.llvm.org/D46682
llvm-svn: 332433
Fangrui Song [Wed, 16 May 2018 06:43:27 +0000 (06:43 +0000)]
[Unix] Indent ChangeStd{in,out}ToBinary.
llvm-svn: 332432
Mikael Holmen [Wed, 16 May 2018 06:36:11 +0000 (06:36 +0000)]
Remove unused variable introduced in r332336
The unused variable caused a compilation warning:
../lib/Target/X86/X86ISelLowering.cpp:34614:17: error: unused variable 'SMax' [-Werror,-Wunused-variable]
if (SDValue SMax = MatchMinMax(SMin, ISD::SMAX, C1))
^
1 error generated.
llvm-svn: 332431
Shoaib Meenai [Wed, 16 May 2018 04:52:18 +0000 (04:52 +0000)]
[ObjCARC] Prevent code motion into a catchswitch
A catchswitch must be the only non-phi instruction in its basic block;
attempting to move a retain or release into a catchswitch basic block
will result in invalid IR. Explicitly mark a CFG hazard in this case to
prevent the code motion.
Differential Revision: https://reviews.llvm.org/D46482
llvm-svn: 332430
JF Bastien [Wed, 16 May 2018 04:36:37 +0000 (04:36 +0000)]
Revert "Signal handling should be signal-safe"
Some bots don't have double-pointer width compare-and-exchange. Revert for now.q
llvm-svn: 332429
JF Bastien [Wed, 16 May 2018 04:30:00 +0000 (04:30 +0000)]
Signal handling should be signal-safe
Summary:
Before this patch, signal handling wasn't signal safe. This leads to real-world
crashes. It used ManagedStatic inside of signals, this can allocate and can lead
to unexpected state when a signal occurs during llvm_shutdown (because
llvm_shutdown destroys the ManagedStatic). It also used cl::opt without custom
backing storage. Some de-allocation was performed as well. Acquiring a lock in a
signal handler is also a great way to deadlock.
We can't just disable signals on llvm_shutdown because the signals might do
useful work during that shutdown. We also can't just disable llvm_shutdown for
programs (instead of library uses of clang) because we'd have to then mark the
pointers as not leaked and make sure all the ManagedStatic uses are OK to leak
and remain so.
Move all of the code to lock-free datastructures instead, and avoid having any
of them in an inconsistent state. I'm not trying to be fancy, I'm not using any
explicit memory order because this code isn't hot. The only purpose of the
atomics is to guarantee that a signal firing on the same or a different thread
doesn't see an inconsistent state and crash. In some cases we might miss some
state (for example, we might fail to delete a temporary file), but that's fine.
Note that I haven't touched any of the backtrace support despite it not
technically being totally signal-safe. When that code is called we know
something bad is up and we don't expect to continue execution, so calling
something that e.g. sets errno is the least of our problems.
A similar patch should be applied to lib/Support/Windows/Signals.inc, but that
can be done separately.
<rdar://problem/
28010281>
Reviewers: dexonsmith
Subscribers: aheejin, llvm-commits
Differential Revision: https://reviews.llvm.org/D46858
llvm-svn: 332428
Shiva Chen [Wed, 16 May 2018 02:57:26 +0000 (02:57 +0000)]
[DebugInfo] Only handle DBG_VALUE in InlineSpiller.
The instructions using registers should be DBG_VALUE and normal
instructions. Use isDebugValue() to filter out DBG_VALUE and add
an assert to ensure there is no other kind of debug instructions
using the registers.
Differential Revision: https://reviews.llvm.org/D46739
Patch by Hsiangkai Wang.
llvm-svn: 332427
Evgeny Stupachenko [Wed, 16 May 2018 02:48:50 +0000 (02:48 +0000)]
Fix LSR compile time hang.
Summary:
Limit number of reassociations in GenerateReassociationsImpl.
Reviewers: qcolombet, mkazantsev
Differential Revision: https://reviews.llvm.org/D46039
From: Evgeny Stupachenko <evstupac@gmail.com>
<evgeny.v.stupachenko@intel.com>
llvm-svn: 332426
Richard Smith [Wed, 16 May 2018 01:08:07 +0000 (01:08 +0000)]
Fix 32-bit buildbots.
llvm-svn: 332425
Chris Matthews [Wed, 16 May 2018 00:37:00 +0000 (00:37 +0000)]
remove output xml incase it is leftover from another run
llvm-svn: 332424
Chris Matthews [Wed, 16 May 2018 00:33:29 +0000 (00:33 +0000)]
Use not to catch unexpected pass as well as remove old test results
As per review feedback, make sure we rm temp files, and make the return
code checking for lit more specific.
llvm-svn: 332423
George Karpenkov [Wed, 16 May 2018 00:29:13 +0000 (00:29 +0000)]
[analyzer] Do not crash on callback for call_once passed by value
https://bugs.llvm.org/show_bug.cgi?id=37312
rdar://
40270582
Differential Revision: https://reviews.llvm.org/D46913
llvm-svn: 332422
Douglas Yung [Wed, 16 May 2018 00:27:43 +0000 (00:27 +0000)]
Revert commits r332160, r332164, r332236.
It was decided this is the wrong approach to fix this issue.
llvm-svn: 332421
Peter Collingbourne [Wed, 16 May 2018 00:21:47 +0000 (00:21 +0000)]
ARM: Remove unnecessary argument. NFCI.
IsLittleEndian is already a field of ARMAsmBackend.
llvm-svn: 332420
Peter Collingbourne [Wed, 16 May 2018 00:21:31 +0000 (00:21 +0000)]
ARM: Deduplicate code and remove unnecessary declaration. NFCI.
llvm-svn: 332419
Anastasis Grammenos [Wed, 16 May 2018 00:11:52 +0000 (00:11 +0000)]
[Debugify] Fix test failing after r332416
I missed a test that needed an update.
Failing bot: http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/30071
llvm-svn: 332418
Artem Dergachev [Wed, 16 May 2018 00:11:24 +0000 (00:11 +0000)]
[analyzer] Make plist-html diagnostic consumer produce multi-file reports.
Previously plist-html output produced multi-file HTML reports
but only single-file Plist reports.
Change plist-html output to produce multi-file Plist reports as well.
Differential Revision: https://reviews.llvm.org/D46902
llvm-svn: 332417
Anastasis Grammenos [Tue, 15 May 2018 23:38:05 +0000 (23:38 +0000)]
[Debugfiy] Print the pass name next to the result
CheckDebugify now prints the pass name right next to the result of the check.
Differential Revision: https://reviews.llvm.org/D46908
llvm-svn: 332416
Eli Friedman [Tue, 15 May 2018 23:36:46 +0000 (23:36 +0000)]
[MachineOutliner] Add optsize markings to outlined functions.
It doesn't matter much this late in the pipeline, but one place that
does check for it is the function alignment code.
Differential Revision: https://reviews.llvm.org/D46373
llvm-svn: 332415
John Baldwin [Tue, 15 May 2018 22:44:56 +0000 (22:44 +0000)]
[libunwind][MIPS] Support MIPS floating-point registers for hard-float ABIs.
Summary:
For MIPS ABIs with 64-bit floating point registers including newabi
and O32 with 64-bit floating point registers, just save and restore the
32 floating-point registers as doubles.
For O32 MIPS with 32-bit floating-point registers, save and restore the
individual floating-point registers as "plain" registers. These registers
are encoded as floats rather than doubles, but the DWARF unwinder
assumes that floating-point registers are stored as doubles when reading
them from memory (via AddressSpace::getDouble()). Treating the
registers as "normal" registers instead causes the DWARF unwinder to
fetch them from memory as a 32-bit register. This does mean that for
O32 with 32-bit floating-point registers unw_get_fpreg() and
unw_set_fpreg() do not work. One would have to use unw_get_reg()
and unw_set_reg() instead. However, DWARF unwinding works
correctly as the DWARF CFI emits records for individual 32-bit
floating-point registers even when they are treated as doubles stored
in paired registers. If the lack of unw_get/set_fpreg() becomes a pressing
need in the future for O32 MIPS we could add in special handling to
make it work.
Reviewers: sdardis, compnerd
Reviewed By: sdardis
Differential Revision: https://reviews.llvm.org/D41968
llvm-svn: 332414
Volodymyr Sapsai [Tue, 15 May 2018 22:38:31 +0000 (22:38 +0000)]
Emit an error when include <atomic> after <stdatomic.h>
C11 defines `kill_dependency` as a macro in <stdatomic.h>. When you
include <atomic> after <stdatomic.h>, the macro clashes with
`std::kill_dependency` and causes multiple errors. Explicit error should
help in diagnosing those errors.
No change for working code that includes <atomic> before <stdatomic.h>.
rdar://problem/
27435938
Reviewers: rsmith, EricWF, mclow.lists, jfb
Reviewed By: jfb
Subscribers: jfb, jkorous-apple, christof, bumblebritches57, JonChesterfield, smeenai, cfe-commits
Differential Revision: https://reviews.llvm.org/D45470
llvm-svn: 332413
Sam Clegg [Tue, 15 May 2018 22:27:50 +0000 (22:27 +0000)]
[WebAssembly] Fix R_WEBASSEMBLY_FUNCTION_OFFSET_I32 relocation entries
Fixes: lld: warning: unexpected existing value for R_WEBASSEMBLY_FUNCTION_OFFSET_I32: existing=839 expected=838
The existing solution is trying to erroneously recover correct offset of
the function code from the body (which is not a function segment that
includes its size, locals, and code).
The D46763 is trying to maintain the offset of the function code
allowing properly calculate the new relocation entry.
Patch by Yury Delendik
Differential Revision: https://reviews.llvm.org/D46765
llvm-svn: 332412
Joel E. Denny [Tue, 15 May 2018 22:16:47 +0000 (22:16 +0000)]
[Attr] Don't print implicit attributes
Fixes bug reported at:
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-
20180514/228390.html
Reviewed by: aaron.ballman
Differential Revision: https://reviews.llvm.org/D46894
llvm-svn: 332411
Simon Pilgrim [Tue, 15 May 2018 22:11:51 +0000 (22:11 +0000)]
[X86][SSE] Add tests for vector rotates by splat variable.
llvm-svn: 332410
Stanislav Mekhanoshin [Tue, 15 May 2018 22:07:51 +0000 (22:07 +0000)]
[AMDGPU] Fix handling of void types in isLegalAddressingMode
It is legal for the type passed to isLegalAddressingMode to be
unsized or, more specifically, VoidTy. In this case, we must
check the legality of load / stores for all legal types. Directly
trying to call getTypeStoreSize is incorrect, and leads to breakage
in e.g. Loop Strength Reduction. This change guards against that
behaviour.
Differential Revision: https://reviews.llvm.org/D40405
llvm-svn: 332409
Benjamin Kramer [Tue, 15 May 2018 22:01:54 +0000 (22:01 +0000)]
[lld] Make helpers static. NFC.
llvm-svn: 332408
Sanjay Patel [Tue, 15 May 2018 22:00:37 +0000 (22:00 +0000)]
[InstCombine] fix binop (shuffle X), C --> shuffle (binop X, C') to check uses
llvm-svn: 332407
Sam Clegg [Tue, 15 May 2018 21:49:58 +0000 (21:49 +0000)]
[WebAssembly] Provide WasmFunction content offset information.
WasmObjectWriter mostly operates with function segments offsets that do
not include their size fields. WasmObjectFile needs to have and provide
this information to the lld to maintain proper
R_WEBASSEMBLY_FUNCTION_OFFSET_I32 relocations entries.
Patch by Yury Delendik
Differential Revision: https://reviews.llvm.org/D46763
llvm-svn: 332406
Eugene Zelenko [Tue, 15 May 2018 21:45:01 +0000 (21:45 +0000)]
[Documentation] Fix Release Notes format issues.
llvm-svn: 332405
Marek Olsak [Tue, 15 May 2018 21:41:57 +0000 (21:41 +0000)]
AMDGPU: Add a missing test for the 128-bit local addr space option
This should have been pushed with:
"AMDGPU: enable 128-bit for local addr space under an option"
llvm-svn: 332404
Marek Olsak [Tue, 15 May 2018 21:41:55 +0000 (21:41 +0000)]
StructurizeCFG: fix inverting conditions
Author: Samuel Pitoiset
Without this patch, it appears to me that we are selecting
the wrong operand when inverting conditions. In the attached
test, it will select %tmp3 instead of %tmp4. To fix it, just
use 'A' as everywhere.
This fixes a regression introduced by
"[PatternMatch] define m_Not using m_Xor and cst_pred_ty"
https://reviews.llvm.org/D46351
llvm-svn: 332403
Evgeniy Stepanov [Tue, 15 May 2018 21:28:25 +0000 (21:28 +0000)]
[msan] Instrument masked.store, masked.load intrinsics.
Summary: Instrument masked store/load intrinsics.
Reviewers: kcc
Subscribers: hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D46785
llvm-svn: 332402
Richard Smith [Tue, 15 May 2018 21:27:30 +0000 (21:27 +0000)]
Don't produce a redundant "auto type is incompatible with C++98" on every lambda with no explicit return type.
We already warned about the lambda, and we don't have a source location for the imagined "auto" anyway.
llvm-svn: 332401
Benjamin Kramer [Tue, 15 May 2018 21:26:47 +0000 (21:26 +0000)]
Move helper classes into anonymous namespaces. NFCI.
llvm-svn: 332400
Sanjay Patel [Tue, 15 May 2018 21:23:58 +0000 (21:23 +0000)]
[InstCombine] clean up code for binop-shuffle transforms; NFCI
llvm-svn: 332399
Martin Storsjo [Tue, 15 May 2018 21:12:29 +0000 (21:12 +0000)]
[MinGW] Handle the GNU ld option -Map for outputting a linker map
Differential Revision: https://reviews.llvm.org/D46872
llvm-svn: 332398
Akira Hatanaka [Tue, 15 May 2018 21:00:30 +0000 (21:00 +0000)]
Address post-commit review comments after r328731. NFC.
- Define a function (canPassInRegisters) that determines whether a
record can be passed in registers based on language rules and
target-specific ABI rules.
- Set flag RecordDecl::ParamDestroyedInCallee to true in MSVC mode and
remove ASTContext::isParamDestroyedInCallee, which is no longer needed.
- Use the same type (unsigned) for RecordDecl's bit-field members.
For more background, see the following discussions that took place on
cfe-commits.
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-
20180326/223498.html
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-
20180402/223688.html
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-
20180409/224754.html
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-
20180423/226494.html
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-
20180507/227647.html
llvm-svn: 332397
Jake Ehrlich [Tue, 15 May 2018 20:53:53 +0000 (20:53 +0000)]
[llvm-objcopy] Add --only-keep-debug as a noop
This option just keeps being a problem and really needs to be implemented
in some fashion. Implementing it properly requires some kind of
"replaceSectionReference" method because all the existing links need to be
maintained. The desired behavior is just for allocated sections to become
NOBITS but actually implementing that is rather tricky due to the current
design of llvm-objcopy. However converting allocated sections to NOBITS is
just an optimization and not something debuggers need. Debuggers can debug
a stripped executable and take an unstripped executable for that stripped
executable as input. Additionally allocated sections account for a very
small part of debug binaries so this optimization is quite small. I propose
that for the time being we implement this as a NOP so that people can use
llvm-objcopy where they need to, just in a sub-optimal way.
This option has already blocked a lot of people and its currently blocking me.
llvm-svn: 332396
Evandro Menezes [Tue, 15 May 2018 20:41:12 +0000 (20:41 +0000)]
[AArch64] Improve single vector lane unscaled stores
When storing the 0th lane of a vector, use a simpler and usually more
efficient scalar store instead. In this case, also using the unscaled
offset.
Differential revision: https://reviews.llvm.org/D46762
llvm-svn: 332394
Sanjay Patel [Tue, 15 May 2018 20:34:09 +0000 (20:34 +0000)]
[InstCombine] add more tests for binop-shuffle; NFC
The splat pattern is part of PR37463:
https://bugs.llvm.org/show_bug.cgi?id=37463
llvm-svn: 332393
Nirav Dave [Tue, 15 May 2018 20:31:53 +0000 (20:31 +0000)]
[DAGCombine] Move load checks on store of loads into candidate
search. NFCI.
Migrate single-use and non-volatility, non-indexed requirements on
stores of immediate store values to candidate collection pass from
later stage.
llvm-svn: 332392
Peter Collingbourne [Tue, 15 May 2018 20:21:58 +0000 (20:21 +0000)]
Nios2: Unbreak build.
llvm-svn: 332391
Matt Davis [Tue, 15 May 2018 20:21:04 +0000 (20:21 +0000)]
[llvm-mca] Introduce a pipeline Stage class and FetchStage.
Summary:
This is just an idea, really two ideas. I expect some push-back,
but I realize that posting a diff is the most comprehensive way to express
these concepts.
This patch introduces a Stage class which represents the
various stages of an instruction pipeline. As a start, I have created a simple
FetchStage that is based on existing logic for how MCA produces
instructions, but now encapsulated in a Stage. The idea should become more concrete
once we introduce additional stages. The idea being, that when a stage completes,
the next stage in the pipeline will be executed. Stages are chained together
as a singly linked list to closely model a real pipeline. For now there is only one stage,
so the stage-to-stage flow of instructions isn't immediately obvious.
Eventually, Stage will also handle event notifications, but that functionality
is not complete, and not destined for this patch. Ideally, an interested party
can register for notifications from a particular stage. Callbacks will be issued to
these listeners at various points in the execution of the stage.
For now, eventing functionality remains similar to what it has been in mca::Backend.
We will be building-up the Stage class as we move on, such as adding debug output.
This patch also removes the unique_ptr<Instruction> return value from
InstrBuilder::createInstruction. An Instruction pointer is still produced,
but now it's up to the caller to decide how that item should be managed post-allocation
(e.g., smart pointer). This allows the Fetch stage to create instructions and
manage the lifetime of those instructions as it wishes, and not have to be bound to any
specific managed pointer type. Other callers of createInstruction might have different
requirements, and thus can manage the pointer to fit their needs. Another idea would be to push the
ownership to the RCU.
Currently, the FetchStage will wrap the Instruction
pointer in a shared_ptr. This allows us to remove the Instruction container in
Backend, which was probably going to disappear, or move, at some point anyways.
Note that I did run these changes through valgrind, to make sure we are not leaking
memory. While the shared_ptr comes with some additional overhead it relieves us
from having to manage a list of generated instructions, and/or make lookup calls
to remove the instructions.
I realize that both the Stage class and the Instruction pointer management
(mentioned directly above) are separate but related ideas, and probably should
land as separate patches; I am happy to do that if either idea is decent.
The main reason these two ideas are together is that
Stage::execute() can mutate an InstRef. For the fetch stage, the InstRef is populated
as the primary action of that stage (execute()). I didn't want to change the Stage interface
to support the idea of generating an instruction. Ideally, instructions are to
be pushed through the pipeline. I didn't want to draw too much of a
specialization just for the fetch stage. Excuse the word-salad.
Reviewers: andreadb, courbet, RKSimon
Reviewed By: andreadb
Subscribers: llvm-commits, mgorny, javed.absar, tschuett, gbedwell
Differential Revision: https://reviews.llvm.org/D46741
llvm-svn: 332390
Chandler Carruth [Tue, 15 May 2018 20:16:57 +0000 (20:16 +0000)]
[x86][eflags] Fix PR37431 by teaching the EFLAGS copy lowering to
specially handle SETB_C* pseudo instructions.
Summary:
While the logic here is somewhat similar to the arithmetic lowering, it
is different enough that it made sense to have its own function.
I actually tried a bunch of different optimizations here and none worked
well so I gave up and just always do the arithmetic based lowering.
Looking at code from the PR test case, we actually pessimize a bunch of
code when generating these. Because SETB_C* pseudo instructions clobber
EFLAGS, we end up creating a bunch of copies of EFLAGS to feed multiple
SETB_C* pseudos from a single set of EFLAGS. This in turn causes the
lowering code to ruin all the clever code generation that SETB_C* was
hoping to achieve. None of this is needed. Whenever we're generating
multiple SETB_C* instructions from a single set of EFLAGS we should
instead generate a single maximally wide one and extract subregs for all
the different desired widths. That would result in substantially better
code generation. But this patch doesn't attempt to address that.
The test case from the PR is included as well as more directed testing
of the specific lowering pattern used for these pseudos.
Reviewers: craig.topper
Subscribers: sanjoy, mcrosier, llvm-commits, hiraditya
Differential Revision: https://reviews.llvm.org/D46799
llvm-svn: 332389
Benjamin Kramer [Tue, 15 May 2018 20:08:15 +0000 (20:08 +0000)]
Use perfect forwarding to deduplicate code in unit test. NFC.
llvm-svn: 332388
Konstantin Zhuravlyov [Tue, 15 May 2018 19:32:47 +0000 (19:32 +0000)]
AMDGPU: Fix v_dot{4, 8}* instruction encoding
Differential Revision: https://reviews.llvm.org/D46848
llvm-svn: 332387
Martin Storsjo [Tue, 15 May 2018 19:21:28 +0000 (19:21 +0000)]
[llvm-rc] Add support for the optional CLASS statement for dialogs
Differential Revision: https://reviews.llvm.org/D46875
llvm-svn: 332386
Michael Zolotukhin [Tue, 15 May 2018 18:40:29 +0000 (18:40 +0000)]
[MemorySSA] Don't sort IDF blocks.
Summary:
After r332167 we started to sort the IDF blocks inside IDF calculation, so
there is no need to re-sort them on the user site. The test changes are due to
a slightly different order we're using now (originally we used DFSInNumber and
now the blocks are sorted by a pair (LevelFromRoot, DFSInNumber)).
Reviewers: dberlin, mgrang
Subscribers: Prazek, hiraditya, george.burgess.iv, llvm-commits
Differential Revision: https://reviews.llvm.org/D46899
llvm-svn: 332385
Sunil Srivastava [Tue, 15 May 2018 18:28:42 +0000 (18:28 +0000)]
Fixed some rtti-options tests.
Certain tests in rtti-options.cpp are not really testing anything because they are testing for the absence of -frtti option to the cc1 process. Since the cc1 process does not take -frtti option, these tests are passing tautologically.
The RTTI mode is enabled by default in cc1, and -fno-rtti disables it. Therefore the correct way to check for enabling of RTTI is to check for the absence of -fno-rtti to cc1, and the correct way to check for disabling of RTTI is to check for the presence of -fno-rtti to cc1.
This patch fixes those tests.
Differential Revision: https://reviews.llvm.org/D46836
llvm-svn: 332384
Krzysztof Parzyszek [Tue, 15 May 2018 18:15:59 +0000 (18:15 +0000)]
[Hexagon] Add driver options for subtarget features
llvm-svn: 332383
Yan Zhang [Tue, 15 May 2018 18:13:51 +0000 (18:13 +0000)]
add AR to acronyms of clang-tidy property check
Reviewers: hokein, benhamilton
Reviewed By: benhamilton
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D46895
llvm-svn: 332382
Andrea Di Biagio [Tue, 15 May 2018 18:11:45 +0000 (18:11 +0000)]
[llvm-mca] use a formatted_raw_ostream to insert padding and get rid of tabs. NFC
llvm-svn: 332381
Alexey Bataev [Tue, 15 May 2018 18:01:01 +0000 (18:01 +0000)]
[OPENMP, NVPTX] Do not globalize variables with reference/pointer types.
In generic data-sharing mode we do not need to globalize
variables/parameters of reference/pointer types. They already are placed
in the global memory.
llvm-svn: 332380
Tom Stellard [Tue, 15 May 2018 17:57:09 +0000 (17:57 +0000)]
AMDGPU/GlobalISel: Implement select() for G_FCONSTANT
Summary: Also clean up G_CONSTANT selection.
Reviewers: arsenm, nhaehnle
Subscribers: kzhuravl, wdng, yaxunl, rovka, kristof.beyls, dstuttard, tpr, t-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D46170
llvm-svn: 332379
Sam McCall [Tue, 15 May 2018 17:43:27 +0000 (17:43 +0000)]
[clangd] Extract scoring/ranking logic, and shave yaks.
Summary:
Code completion scoring was embedded in CodeComplete.cpp, which is bad:
- awkward to test. The mechanisms (extracting info from index/sema) can be
unit-tested well, the policy (scoring) should be quantitatively measured.
Neither was easily possible, and debugging was hard.
The intermediate signal struct makes this easier.
- hard to reuse. This is a bug in workspaceSymbols: it just presents the
results in the index order, which is not sorted in practice, it needs to rank
them!
Also, index implementations care about scoring (both query-dependent and
independent) in order to truncate result lists appropriately.
The main yak shaved here is the build() function that had 3 variants across
unit tests is unified in TestTU.h (rather than adding a 4th variant).
Reviewers: ilya-biryukov
Subscribers: klimek, mgorny, ioeric, MaskRay, jkorous, mgrang, cfe-commits
Differential Revision: https://reviews.llvm.org/D46524
llvm-svn: 332378
Konstantin Zhuravlyov [Tue, 15 May 2018 17:39:13 +0000 (17:39 +0000)]
AMDGPU: Add disasm tests for deep learning instructions + fix v_fmac_f32 disasm
Differential Revision: https://reviews.llvm.org/D46853
llvm-svn: 332377
Simon Pilgrim [Tue, 15 May 2018 17:36:49 +0000 (17:36 +0000)]
[X86] Split WriteCvtF2F into F32->F64 and F64->F32 scheduler classes
BtVer2 - Fixes schedules for (V)CVTPS2PD instructions
A lot of the Intel models still have too many InstRW overrides for these new classes - this needs cleaning up but I wanted to get the classes in first
llvm-svn: 332376
Sanjay Patel [Tue, 15 May 2018 17:14:23 +0000 (17:14 +0000)]
[InstCombine] fix binop-of-shuffles to check uses
llvm-svn: 332375
Han Shen [Tue, 15 May 2018 17:02:35 +0000 (17:02 +0000)]
[lld] Mitigate relocation overflow [part 1 of 2].
This CL places .dynsym and .dynstr at the beginning of SHF_ALLOC
sections. We do this to mitigate the possibility that huge .dynsym and
.dynstr sections placed between ro-data and text sections cause
relocation overflow.
Differential Revision: https://reviews.llvm.org/D45788
llvm-svn: 332374
Sanjay Patel [Tue, 15 May 2018 16:47:47 +0000 (16:47 +0000)]
[InstCombine] add multi-use shuffle tests and regenerate checks; NFC
llvm-svn: 332373
Fangrui Song [Tue, 15 May 2018 16:40:54 +0000 (16:40 +0000)]
Remove \brief commands from doxygen comments.
Summary: This is similar to D46290 D46320.
Reviewers: ruiu, grimar
Subscribers: mehdi_amini, llvm-commits
Differential Revision: https://reviews.llvm.org/D46861
llvm-svn: 332372
Nicola Zaghen [Tue, 15 May 2018 16:37:45 +0000 (16:37 +0000)]
[clang-tools-extra] Update uses of DEBUG macro to LLVM_DEBUG.
The DEBUG() macro is very generic so it might clash with other projects.
The renaming was done as follows:
- git grep -l 'DEBUG' | xargs sed -i 's/\bDEBUG\s\?(/LLVM_DEBUG(/g'
- git diff -U0 master | ../clang/tools/clang-format/clang-format-diff.py -i -p1 -style LLVM
Differential Revision: https://reviews.llvm.org/D44976
llvm-svn: 332371
Nico Weber [Tue, 15 May 2018 16:37:00 +0000 (16:37 +0000)]
update two comments as suggested on https://reviews.llvm.org/D46843
llvm-svn: 332370
Krzysztof Parzyszek [Tue, 15 May 2018 16:32:24 +0000 (16:32 +0000)]
[Hexagon] Remove unused function from subtarget
llvm-svn: 332369
Nico Weber [Tue, 15 May 2018 16:30:30 +0000 (16:30 +0000)]
Rename three cxx files in unittests to cpp.
LLVM uses cpp as its C++ file extension, these are the only three cxx file in
the monorepo. These files apparently were called to escape a CMake check -- use
the LLVM_OPTIONAL_SOURCES mechanism that's meant as an escape for this case
instead.
No intended behavior change.
https://reviews.llvm.org/D46843
llvm-svn: 332368
Geoff Berry [Tue, 15 May 2018 16:27:34 +0000 (16:27 +0000)]
[AArch64] Fix mir test case liveins info.
The test case added in r332265 had incomplete livein information which
was caught by the EXPENSIVE_CHECKS bot. Fix the livein information and
add -verify-machineinstrs to the test case.
llvm-svn: 332367
Eric Liu [Tue, 15 May 2018 16:22:43 +0000 (16:22 +0000)]
[clangd] Log error message instead write to errs(). NFC
llvm-svn: 332366
Krzysztof Parzyszek [Tue, 15 May 2018 16:13:52 +0000 (16:13 +0000)]
[Hexagon] Remove unused flag from subtarget and (non)corresponding test
llvm-svn: 332365
Simon Dardis [Tue, 15 May 2018 16:05:04 +0000 (16:05 +0000)]
[mips] Mark select instructions correctly
Reviewers: atanasyan, abeserminji, smaksimovic
Differential Revision: https://reviews.llvm.org/D46702
llvm-svn: 332364
Eric Liu [Tue, 15 May 2018 15:29:32 +0000 (15:29 +0000)]
[clangd] Populate #include insertions as additional edits in completion items.
Summary:
o Remove IncludeInsertion LSP command.
o Populate include insertion edits synchromously in completion items.
o Share the code completion compiler instance and precompiled preamble to get existing inclusions in main file.
o Include insertion logic lives only in CodeComplete now.
o Use tooling::HeaderIncludes for inserting new includes.
o Refactored tests.
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: klimek, ilya-biryukov, MaskRay, jkorous, cfe-commits
Differential Revision: https://reviews.llvm.org/D46497
llvm-svn: 332363
Eric Liu [Tue, 15 May 2018 15:23:53 +0000 (15:23 +0000)]
[clangd] Remove LSP command-based #include insertion.
Summary:
clangd will populate #include insertions as addtionalEdits in completion items.
The code completion tests in ClangdServerTest will be added back in D46497.
Reviewers: ilya-biryukov, sammccall
Reviewed By: ilya-biryukov
Subscribers: klimek, MaskRay, jkorous, cfe-commits
Differential Revision: https://reviews.llvm.org/D46676
llvm-svn: 332362
Andrea Di Biagio [Tue, 15 May 2018 15:18:05 +0000 (15:18 +0000)]
[llvm-mca] Strip leading tabs and spaces from instruction strings before printing. NFC
llvm-svn: 332361
Gheorghe-Teodor Bercea [Tue, 15 May 2018 15:16:43 +0000 (15:16 +0000)]
[OpenMP][libomptarget] Add function for checking SPMD mode
Summary: Add function to the NVPTX libomptarget library that will return true if the current target region is being executed in SPMD mode.
Reviewers: ABataev, grokos, carlo.bertolli, caomhin
Reviewed By: grokos
Subscribers: guansong, openmp-commits
Differential Revision: https://reviews.llvm.org/D46840
llvm-svn: 332360
Philip Pfaffe [Tue, 15 May 2018 14:53:25 +0000 (14:53 +0000)]
[SI] Create Scop Name lazily
Summary: Creating the Scop name is expensive, because creating the
Region name it's derived from is expensive. So create the name lazily,
because getName() is actually called rarely.
This is a reiteration of r328666, which introduced a use-after-free and
got reverted in r331363.
Differential Revision: https://reviews.llvm.org/D46868
llvm-svn: 332359
Sanjay Patel [Tue, 15 May 2018 14:16:24 +0000 (14:16 +0000)]
[DAG] propagate FMF for all FPMathOperators
This is a simple hack based on what's proposed in D37686, but we can extend it if needed in follow-ups.
It gets us most of the FMF functionality that we want without adding any state bits to the flags. It
also intentionally leaves out non-FMF flags (nsw, etc) to minimize the patch.
It should provide a superset of the functionality from D46563 - the extra tests show propagation and
codegen diffs for fcmp, vecreduce, and FP libcalls.
The PPC log2() test shows the limits of this most basic approach - we only applied 'afn' to the last
node created for the call. AFAIK, there aren't any libcall optimizations based on the flags currently,
so that shouldn't make any difference.
Differential Revision: https://reviews.llvm.org/D46854
llvm-svn: 332358
Simon Pilgrim [Tue, 15 May 2018 14:12:32 +0000 (14:12 +0000)]
[X86] Split off F16C WriteCvtPH2PS/WriteCvtPS2PH scheduler classes
Btver2 - VCVTPH2PSYrm needs to double pump the AGU
Broadwell - missing VCVTPS2PH*mr stores extra latency
Allows us to remove the WriteCvtF2FSt conversion store class
llvm-svn: 332357
Paul Semel [Tue, 15 May 2018 14:09:37 +0000 (14:09 +0000)]
[llvm-objcopy] Add --keep-symbol (-K) option
This option permits to explicitly keep the specified
symbol so that it doesn't get removed.
Differential Revision: https://reviews.llvm.org/D46819
llvm-svn: 332356
Philip Pfaffe [Tue, 15 May 2018 13:43:42 +0000 (13:43 +0000)]
[arc] Remove unittesting from arcconfig
Summary:
Unittests aren't working, and I don't think they ever were. Just remove
them, so that we don't have to write `arc --nounit` all the time.
Reviewers: grosser, Meinersbur, bollu
Subscribers: bollu, pollydev, llvm-commits
Differential Revision: https://reviews.llvm.org/D46869
llvm-svn: 332355
Eric Liu [Tue, 15 May 2018 13:43:20 +0000 (13:43 +0000)]
Fix broken asan Support tests
The asan failures were caught in google internal asan tests after r332311
o Make StackOption support cl::list
o Rememeber to removeArguments for cl::alias in tests.
llvm-svn: 332354
Pavel Labath [Tue, 15 May 2018 13:42:26 +0000 (13:42 +0000)]
Reapply "Remove Process references from the Host module"
This re-lands r332250/D46395, after fixing Mac build errors.
llvm-svn: 332353
Nicola Zaghen [Tue, 15 May 2018 13:37:17 +0000 (13:37 +0000)]
[polly] Update uses of DEBUG macro to LLVM_DEBUG.
The DEBUG() macro is very generic so it might clash with other projects.
The renaming was done as follows:
- git grep -l 'DEBUG' | xargs sed -i 's/\bDEBUG\s\?(/LLVM_DEBUG(/g'
- git diff -U0 master | ../clang/tools/clang-format/clang-format-diff.py -i -p1 -style LLVM
Differential Revision: https://reviews.llvm.org/D44978
llvm-svn: 332352
Nicola Zaghen [Tue, 15 May 2018 13:36:20 +0000 (13:36 +0000)]
[lld] Update uses of DEBUG macro to LLVM_DEBUG.
The DEBUG() macro is very generic so it might clash with other projects.
The renaming was done as follows:
- git grep -l 'DEBUG' | xargs sed -i 's/\bDEBUG\s\?(/LLVM_DEBUG(/g'
- git diff -U0 master | ../clang/tools/clang-format/clang-format-diff.py -i -p1 -style LLVM
Differential Revision: https://reviews.llvm.org/D44977
llvm-svn: 332351
Nicola Zaghen [Tue, 15 May 2018 13:30:56 +0000 (13:30 +0000)]
[clang] Update uses of DEBUG macro to LLVM_DEBUG.
The DEBUG() macro is very generic so it might clash with other projects.
The renaming was done as follows:
- git grep -l 'DEBUG' | xargs sed -i 's/\bDEBUG\s\?(/LLVM_DEBUG(/g'
- git diff -U0 master | ../clang/tools/clang-format/clang-format-diff.py -i -p1 -style LLVM
Explicitly avoided changing the strings in the clang-format tests.
Differential Revision: https://reviews.llvm.org/D44975
llvm-svn: 332350
Pavel Labath [Tue, 15 May 2018 13:24:10 +0000 (13:24 +0000)]
Reapply "DWARFVerifier: Check "completeness" of .debug_names section"
This is a resubmit of r331868 (D46583), which was reverted due to
failures on the PS4 bot.
These have been resolved with r332246/D46748.
llvm-svn: 332349
Clement Courbet [Tue, 15 May 2018 13:07:05 +0000 (13:07 +0000)]
[llvm-exegesis] Split AsmTemplate.Name into components.
Summary:
AsmTemplate becomes IntructionBenchmarkKey, which has three components.
This allows retreiving the opcode for analysis.
Reviewers: gchatelet
Subscribers: tschuett, llvm-commits
Differential Revision: https://reviews.llvm.org/D46873
llvm-svn: 332348
Simon Pilgrim [Tue, 15 May 2018 12:50:06 +0000 (12:50 +0000)]
[llvm-mca][x86] Add F16C instruction tests
llvm-svn: 332347
Clement Courbet [Tue, 15 May 2018 12:38:06 +0000 (12:38 +0000)]
Fix compilation under pre-c++14 gccs.
llvm-svn: 332346
Clement Courbet [Tue, 15 May 2018 12:27:36 +0000 (12:27 +0000)]
Fix r332344: only the native target is linked.
llvm-svn: 332345
Clement Courbet [Tue, 15 May 2018 12:08:00 +0000 (12:08 +0000)]
[llvm-exegesis] Add an analysis mode.
Summary:
The analysis mode gives the user a clustered view of the measurement results.
Next steps are (requires the split ok AsmTemplate.Name into {mnemonic, mode}):
- Show the sched class.
- Highlight any inconsistencies with the checked-in data.
Reviewers: gchatelet
Subscribers: mgorny, llvm-commits, tschuett
Differential Revision: https://reviews.llvm.org/D46865
llvm-svn: 332344
Rainer Orth [Tue, 15 May 2018 11:36:00 +0000 (11:36 +0000)]
[Solaris] Only define _REENTRANT if -pthread
When looking at lib/Basic/Targets/OSTargets.h, I noticed that _REENTRANT is defined
unconditionally on Solaris, unlike all other targets and what either Studio cc (only define
it with -mt) or gcc (only define it with -pthread) do.
This patch follows that lead.
Differential Revision: https://reviews.llvm.org/D41241
llvm-svn: 332343
whitequark [Tue, 15 May 2018 11:31:07 +0000 (11:31 +0000)]
[MergeFunctions] Fix merging of small weak functions
When two interposable functions are merged, we cannot replace
uses and have to emit calls to a common internal function. However,
writeThunk() will not actually emit a thunk if the function is too
small. This leaves us in a broken state where mergeTwoFunctions
already rewired the functions, but writeThunk doesn't do anything.
This patch changes the implementation so that:
* writeThunk() does just that.
* The direct replacement of calls is moved into mergeTwoFunctions()
into the non-interposable case only.
* isThunkProfitable() is extracted and will be called for
the non-iterposable case always, and in the interposable case
only if uses are still left after replacement.
This issue has been introduced in https://reviews.llvm.org/D34806,
where the code for checking thunk profitability has been moved.
Differential Revision: https://reviews.llvm.org/D46804
Reviewed By: whitequark
llvm-svn: 332342
Simon Dardis [Tue, 15 May 2018 11:21:07 +0000 (11:21 +0000)]
[mips] Fix formatting of floating point conversion patterns
llvm-svn: 332341
Simon Dardis [Tue, 15 May 2018 11:18:24 +0000 (11:18 +0000)]
[mips] Add disassembly support for comparison instructions
llvm-svn: 332340
Simon Dardis [Tue, 15 May 2018 11:10:30 +0000 (11:10 +0000)]
[mips] Fix predicates of mfc1, mtc1 instructions
Reviewers: atanasyan, abeserminji, smaksimovic
Differential Revision: https://reviews.llvm.org/D46692
llvm-svn: 332339
Aleksei Sidorin [Tue, 15 May 2018 11:09:07 +0000 (11:09 +0000)]
[ASTImporter] Extend lookup logic in class templates
During import of a class template, lookup may find a forward
declaration and structural match falsely reports equivalency
between a forward decl and a definition. The result is that
some definitions are not imported if we had imported a forward
decl previously. This patch gives a fix.
Patch by Gabor Marton!
Differential Revision: https://reviews.llvm.org/D46353
llvm-svn: 332338
Andrea Di Biagio [Tue, 15 May 2018 10:30:39 +0000 (10:30 +0000)]
[llvm-mca] Remove unused include header files. NFC
Also, run clang-format on RetireControlUnit.cpp.
llvm-svn: 332337
Artur Gainullin [Tue, 15 May 2018 10:24:12 +0000 (10:24 +0000)]
[X86] Improve unsigned saturation downconvert detection.
Summary:
New unsigned saturation downconvert patterns detection was implemented in
X86 Codegen:
(truncate (smin (smax (x, C1), C2)) to dest_type),
where C1 >= 0 and C2 is unsigned max of destination type.
(truncate (smax (smin (x, C2), C1)) to dest_type)
where C1 >= 0, C2 is unsigned max of destination type and C1 <= C2.
These two patterns are equivalent to:
(truncate (umin (smax(x, C1), unsigned_max_of_dest_type)) to dest_type)
Reviewers: RKSimon
Subscribers: llvm-commits, a.elovikov
Differential Revision: https://reviews.llvm.org/D45315
llvm-svn: 332336
Hans Wennborg [Tue, 15 May 2018 10:19:24 +0000 (10:19 +0000)]
Make ast-print-record-decl.c pass on Windows after r332314
It was failing because on Windows, -ast-print prints
__single_inheritance(1) before T1.
Adding a triple is a stop-gap fix until it can be fixed properly.
llvm-svn: 332335