Craig Topper [Fri, 4 May 2018 01:04:26 +0000 (01:04 +0000)]
[LoopIdiomRecognize] Use a regular array instead of a SmallVector and explicit ArrayRef.
llvm-svn: 331499
Craig Topper [Fri, 4 May 2018 01:04:24 +0000 (01:04 +0000)]
[LoopIdiomRecognize] Turn two uncheck dyn_casts into regular casts.
These are casts on users of a PHINode to Instruction. I think since PHINode is an Instruction any users would also be Instructions. At least a cast will give us an assertion if its wrong.
llvm-svn: 331498
Jason Molenda [Fri, 4 May 2018 00:59:37 +0000 (00:59 +0000)]
The on-ios-device command line lldb has an optimization where
when it and the inferior process both have the same shared cache
(a conglomeration of all libraries at the same fixed address for
all processes), lldb will read data out of its own memory to speed
things up. The shared cache has a UUID, so lldb currently checks
that the UUID of its own shared cache matches that of the inferior.
This change adds one refinement to that -- it checks that the UUID
is the same and that the base address of the shared cache is the
same. And only uses its local shared cache if they are both identical.
This involved using a different style of SPI with dyld to get lldb's
shared cache load address, but it's not especially difficult.
One unattractive part of the change is that I'm using the real
underlying types of task_t and kern_return_t instead of picking
them up from mach/mach.h. The defines that get picked up there (a
lot from machine.h but others too) conflict with llvm/Support/MachO.h
even when I have mach.h included before our SafeMachO.h which
undefines most of the defines before including llvm/Support/MachO.h.
I'll need to augment the #undefs in SafeMachO.h to get this to
compile cleanly, but that'll be another day.
<rdar://problem/
39868238>
llvm-svn: 331497
Artem Dergachev [Fri, 4 May 2018 00:53:41 +0000 (00:53 +0000)]
[analyzer] NFC: Remove unused parameteer of StoreManager::CastRetrievedVal().
llvm-svn: 331496
Craig Topper [Thu, 3 May 2018 23:50:29 +0000 (23:50 +0000)]
[LoopIdiomRecognize] Add a test case to show incorrect transformation of an infinite loop with side effets into a countable loop using ctlz.
We currently recognize this idiom where x is signed and thus the shift in an ashr.
int cnt = 0;
while (x) {
x >>= 1; // arithmetic shift right
++cnt;
}
and turn it into (bitwidth - ctlz(x)). And if there is anything else in the loop we will create a new loop that runs that many times.
If x is initially negative, the shift result will never be 0 and thus the loop is infinite. If you put something with side effects in the loop, that side effect will now only happen bitwidth times instead of an infinite number of times.
So this transform is only safe for logical shift right (which we don't currently recognize) or if we can prove that x cannot be negative before the loop.
llvm-svn: 331493
Adrian Prantl [Thu, 3 May 2018 23:32:47 +0000 (23:32 +0000)]
DWARFExpression: Convert file addresses to load addresses early on.
This is a change that only affects Swift and is NFC for the language
plugins on llvm.org. In Swift, we can have global variables with a
location such as DW_OP_addr <addr> DW_OP_deref. The DWARF expression
evaluator doesn't know how to apply a DW_OP_deref to a file address,
but at the very end we convert the file address into a load address.
This patch moves the file->load address conversion to right after the
result of the DW_OP_addr is pushed onto the stack so that a subsequent
DW_OP_deref (and potentially other operations) can be interpreted.
rdar://problem/
39767528
Differential revision: https://reviews.llvm.org/D46362
llvm-svn: 331492
Volodymyr Sapsai [Thu, 3 May 2018 23:06:37 +0000 (23:06 +0000)]
Revert "Follow-up to r331378. Update tests to allow to use C atomics in C++."
It reverts commit r331484 because it caused test failures
ThreadSanitizer-x86_64 :: Darwin/gcd-groups-destructor.mm
ThreadSanitizer-x86_64 :: Darwin/libcxx-shared-ptr-stress.mm
ThreadSanitizer-x86_64 :: Darwin/xpc-race.mm
Foundation.h transitively includes <atomic>, so we have a case of benign mixing
<stdatomic.h> and <atomic>.
llvm-svn: 331491
Tom Stellard [Thu, 3 May 2018 22:38:06 +0000 (22:38 +0000)]
AMDGPU: Make getSubRegFromChannel a static member of AMDGPURegisterInfo
Summary:
This makes is possible to have R600RegisterInfo and SIRegisterInfo
not inherit from AMDGPURegisterInfo.
Reviewers: arsenm, nhaehnle
Reviewed By: arsenm
Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, llvm-commits, t-tye
Differential Revision: https://reviews.llvm.org/D46280
llvm-svn: 331490
Simon Pilgrim [Thu, 3 May 2018 22:31:19 +0000 (22:31 +0000)]
[X86] Add WriteDPPD/WriteDPPS dot product scheduler classes
llvm-svn: 331489
Simon Pilgrim [Thu, 3 May 2018 22:12:23 +0000 (22:12 +0000)]
[X86][Znver1] Use SchedAlias to tag microcoded scheduler classes
Avoids extra entries in the class tables.
Found a typo that missed the MMX_PHSUBSW instruction.
llvm-svn: 331488
Justin Bogner [Thu, 3 May 2018 21:59:13 +0000 (21:59 +0000)]
Fix include of config.h that was incorrectly changed in r331184
The RWMutex implementation depends on config.h macros (specifically
HAVE_PTHREAD_H and HAVE_PTHREAD_RWLOCK_INIT), so we need to be
including it and not just llvm-config.h here or we fall back to a much
slower implementation.
llvm-svn: 331487
Sanjay Patel [Thu, 3 May 2018 21:58:44 +0000 (21:58 +0000)]
[InstCombine] refine select-of-constants to bitwise ops
Add logic for the special case when a cmp+select can clearly be
reduced to just a bitwise logic instruction, and remove an
over-reaching chunk of general purpose bit magic. The primary goal
is to remove cases where we are not improving the IR instruction
count when doing these select transforms, and in all cases here that
is true.
In the motivating 3-way compare tests, there are further improvements
because we can combine/propagate select values (not sure if that
belongs in instcombine, but it's there for now).
DAGCombiner has folds to turn some of these selects into bit magic,
so there should be no difference in the end result in those cases.
Not all constant combinations are handled there yet, however, so it
is possible that some targets will see more cmov/csel codegen with
this change in IR canonicalization.
Ideally, we'll go further to *not* turn selects into multiple
logic/math ops in instcombine, and we'll canonicalize to selects.
But we should make sure that this step does not result in regressions
first (and if it does, we should fix those in the backend).
The general direction for this change was discussed here:
http://lists.llvm.org/pipermail/llvm-dev/2016-September/105373.html
http://lists.llvm.org/pipermail/llvm-dev/2017-July/114885.html
Alive proofs for the new bit magic:
https://rise4fun.com/Alive/XG7
Differential Revision: https://reviews.llvm.org/D46086
llvm-svn: 331486
Tom Stellard [Thu, 3 May 2018 21:44:16 +0000 (21:44 +0000)]
GlobalISel: Use a callback to compute constrained reg class for unallocatble registers
Summary:
constrainOperandRegClass() currently fails if it tries to constrain the
register class of an operand that is defeined with an unallocatable register
class. This patch resolves this by adding a target callback to compute
register constriants in this case.
This is required by the AMDGPU because many of its instructions have source opreands
defined with the unallocatable register classe VS_32 which is a union of two allocatable
register classes VGPR_32 and SReg_32.
Reviewers: dsanders, aditya_nandakumar
Reviewed By: aditya_nandakumar
Subscribers: rovka, kristof.beyls, tpr, llvm-commits
Differential Revision: https://reviews.llvm.org/D45991
llvm-svn: 331485
Volodymyr Sapsai [Thu, 3 May 2018 21:30:47 +0000 (21:30 +0000)]
Follow-up to r331378. Update tests to allow to use C atomics in C++.
Reviewers: kubamracek
Reviewed By: kubamracek
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D46363
llvm-svn: 331484
Craig Topper [Thu, 3 May 2018 21:01:35 +0000 (21:01 +0000)]
[X86] Make __builtin_ia32_directstore_u32 and __builtin_ia32_movdir64b 'nothrow'
These builtins snuck in while I was in the middle of adding nothrow to the other builtins in my local clone and I guess I missed them.
llvm-svn: 331483
Craig Topper [Thu, 3 May 2018 21:01:33 +0000 (21:01 +0000)]
[CodeGenFunction] Use the StringRef::split function that takes a char separator instead of StringRef separator. NFC
The char separator version should be a little better optimized.
llvm-svn: 331482
Teresa Johnson [Thu, 3 May 2018 20:24:12 +0000 (20:24 +0000)]
[ThinLTO] Add support for optimization remarks to thinBackend
Summary:
Support was added to the regular LTO backend, but not thinBackend.
This patch adds that support.
Reviewers: pcc, davide
Subscribers: mehdi_amini, inglorion, llvm-commits
Differential Revision: https://reviews.llvm.org/D46376
llvm-svn: 331481
Adrian Prantl [Thu, 3 May 2018 20:19:39 +0000 (20:19 +0000)]
Revert "DWARFExpression: Convert file addresses to load addresses early on."
This reverts commit 331462 while investigating bot breakage.
llvm-svn: 331480
Adrian Prantl [Thu, 3 May 2018 20:13:58 +0000 (20:13 +0000)]
Add back condition that was accidentally removed in r331462.
This should make the bots much happier.
llvm-svn: 331479
Rumeet Dhindsa [Thu, 3 May 2018 20:13:38 +0000 (20:13 +0000)]
Added ThinLTO test to verify that index files are not generated if thinlto-index-only is not enabled.
Differential Revision: https://reviews.llvm.org/D46405
llvm-svn: 331478
Kostya Kortchinsky [Thu, 3 May 2018 19:14:07 +0000 (19:14 +0000)]
[sanitizer] Remove unused 32-bit allocator TransferBatch parameter
Summary:
NFC. Remove an unused parameter in
`SizeClassAllocator32::TransferBatch::SetFromArray`, and thus get rid of the
compilation warning.
Reviewers: alekseyshl, vitalybuka
Reviewed By: vitalybuka
Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits
Differential Revision: https://reviews.llvm.org/D46397
llvm-svn: 331477
Sanjay Patel [Thu, 3 May 2018 18:49:35 +0000 (18:49 +0000)]
[PowerPC] add more FMF debug output; NFC
We can't see all of the problems currently unless
we look at debug output when the global 'unsafe' is
on. It's a mess. This is another attempt to make
sure that D45710 is not making changes unintentionally.
llvm-svn: 331476
Zinovy Nis [Thu, 3 May 2018 18:31:39 +0000 (18:31 +0000)]
Simplify test clang-tidy-__clang_analyzer__macro.cpp
llvm-svn: 331475
Zinovy Nis [Thu, 3 May 2018 18:26:39 +0000 (18:26 +0000)]
[clang-tidy] Define __clang_analyzer__ macro for clang-tidy for compatibility with clang static analyzer
This macro is widely used in many well-known projects, ex. Chromium.
But it's not set for clang-tidy, so for ex. DCHECK in Chromium is not considered
as [[no-return]], and a lot of false-positive warnings about nullptr
dereferenced are emitted.
Differential Revision: https://reviews.llvm.org/D46325
llvm-svn: 331474
Simon Pilgrim [Thu, 3 May 2018 18:22:49 +0000 (18:22 +0000)]
[X86][AVX512] VPLZCNT instructions match SchedWriteVecIMul scheduling class not SchedWriteVecALU.
llvm-svn: 331473
Simon Pilgrim [Thu, 3 May 2018 17:56:43 +0000 (17:56 +0000)]
[X86] Split WriteVecShift/WriteVarVecShift into MMX, XMM and YMM/ZMM scheduler classes
This took a bit of extra work as on Intel targets the old (V)PSLLDrr/(V)PSLLDrm style instructions act differently - I ended up creating WriteVecShiftImm classes for XMM/YMM/ZMM vector shift by immediate and retaining WriteVecShift as the default (used only by MMX) plus WriteVecShiftX/WriteVecShiftY. X86SchedWriteWidths hides most of this thank goodness.
llvm-svn: 331472
Sanjay Patel [Thu, 3 May 2018 17:41:37 +0000 (17:41 +0000)]
[PowerPC] add tests for FMF propagation; NFC
I'm choosing PPC out of convenience because it does
all of the transforms of interest in these tests by
default. There are multiple FMF problems shown in the
current checks. D45710 is proposing to fix part of
that.
llvm-svn: 331471
Simon Atanasyan [Thu, 3 May 2018 17:33:10 +0000 (17:33 +0000)]
[ELF][MIPS] Check that a section has a valid reference to a file in the isMipsPIC routine
llvm-svn: 331470
Joel E. Denny [Thu, 3 May 2018 17:22:04 +0000 (17:22 +0000)]
[OPENMP] Fix test typos: CHECK-DAG-N -> CHECK-N-DAG
Reviewed by: ABataev
Differential Revision: https://reviews.llvm.org/D46370
llvm-svn: 331469
Joel E. Denny [Thu, 3 May 2018 17:22:01 +0000 (17:22 +0000)]
Revert r331466: [OPENMP] Fix test typos: CHECK-DAG-N -> CHECK-N-DAG"
Sorry, forgot to add commit log attributes.
llvm-svn: 331468
Sam Clegg [Thu, 3 May 2018 17:21:53 +0000 (17:21 +0000)]
[WebAssembly] Add --stack-first option which places the shadow stack at start of linear memory
Fixes https://bugs.llvm.org/show_bug.cgi?id=37181
Differential Revision: https://reviews.llvm.org/D46141
llvm-svn: 331467
Joel E. Denny [Thu, 3 May 2018 17:15:44 +0000 (17:15 +0000)]
[OPENMP] Fix test typos: CHECK-DAG-N -> CHECK-N-DAG
llvm-svn: 331466
Bjorn Pettersson [Thu, 3 May 2018 17:04:21 +0000 (17:04 +0000)]
[DebugInfo] Correction for an assert in DIExpression::createFragmentExpression
Summary:
When we create a fragment expression, and there already is an
old fragment expression, we assert that the new fragment is
within the range for the old fragment.
If for example the old fragment expression says that we
describe bit 10-16 of a variable (Offset=10, Size=6),
and we now want to create a new fragment expression only
describing bit 3-6 of the original value, then the resulting
fragment expression should have Offset=13, Size=3.
The assert is supposed to catch if the resulting fragment
expression is outside the range for the old fragment. However,
it used to verify that the Offset+Size of the new fragment was
smaller or equal than Offset+Size for the old fragment. What
we really want to check is that Offset+Size of the new fragment
is smaller than the Size of the old fragment.
Reviewers: aprantl, vsk
Reviewed By: aprantl
Subscribers: davide, llvm-commits, JDevlieghere
Differential Revision: https://reviews.llvm.org/D46391
llvm-svn: 331465
Bjorn Pettersson [Thu, 3 May 2018 17:04:16 +0000 (17:04 +0000)]
Reapply "[SelectionDAG] Selection of DBG_VALUE using a PHI node result (pt 2)"
Summary:
This reverts SVN r331441 (reapplies r331337), together with a fix
in to handle an already existing fragment expression in the
dbg.value that must be fragmented due to a split PHI node.
This should solve the problem seen in PR37321, which was the
reason for the revert of r331337.
The situation in PR37321 is that we have a PHI node like this
%u.sroa = phi i80 [ %u.sroa.x, %if.x ],
[ %u.sroa.y, %if.y ],
[ %u.sroa.z, %if.z ]
and a dbg.value like this
call void @llvm.dbg.value(metadata i80 %u.sroa,
metadata !13,
metadata !DIExpression(DW_OP_LLVM_fragment, 0, 80))
The phi node is split into three 32-bit PHI nodes
%30:gr32 = PHI %11:gr32, %bb.4, %14:gr32, %bb.5, %27:gr32, %bb.8
%31:gr32 = PHI %12:gr32, %bb.4, %15:gr32, %bb.5, %28:gr32, %bb.8
%32:gr32 = PHI %13:gr32, %bb.4, %16:gr32, %bb.5, %29:gr32, %bb.8
but since the original value only is 80 bits we need to adjust the size
of the last fragment expression, and with this patch we get
DBG_VALUE debug-use %30:gr32, debug-use $noreg, !"u", !DIExpression(DW_OP_LLVM_fragment, 0, 32)
DBG_VALUE debug-use %31:gr32, debug-use $noreg, !"u", !DIExpression(DW_OP_LLVM_fragment, 32, 32)
DBG_VALUE debug-use %32:gr32, debug-use $noreg, !"u", !DIExpression(DW_OP_LLVM_fragment, 64, 16)
Reviewers: vsk, aprantl, mstorsjo
Reviewed By: aprantl
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D46384
llvm-svn: 331464
Jonas Devlieghere [Thu, 3 May 2018 16:54:10 +0000 (16:54 +0000)]
[CMake] Unify and relayer testing
This patch restructures part of LLDB's testing configuration:
1. I moved the test dependencies up the chain so every dotest dependency
becomes a lit dependency as well. It wouldn't make sense for dotest to
have other dependencies when it's being run by lit. Lit on the other
hand can still specify extra dependencies.
2. I replaced as much generator expressions with variables as possible.
This is consistent with the rest of LLVM and doesn't break generators
that support multiple targets (MSVC, Xcode). This wasn't a problem
before, but now we need to expand the dotest arguments in the lit
configuration and there's only one test suite even with multiple
targets.
3. I moved lldb-dotest into it's own directory under utils since there's
no need anymore for it to located under `test/`.
Differential revision: https://reviews.llvm.org/D46334
llvm-svn: 331463
Adrian Prantl [Thu, 3 May 2018 16:51:37 +0000 (16:51 +0000)]
DWARFExpression: Convert file addresses to load addresses early on.
This is a change that only affects Swift and is NFC for the language
plugins on llvm.org. In Swift, we can have global variables with a
location such as DW_OP_addr <addr> DW_OP_deref. The DWARF expression
evaluator doesn't know how to apply a DW_OP_deref to a file address,
but at the very end we convert the file address into a load address.
This patch moves the file->load address conversion to right after the
result of the DW_OP_addr is pushed onto the stack so that a subsequent
DW_OP_deref (and potentially other operations) can be interpreted.
rdar://problem/
39767528
Differential revision: https://reviews.llvm.org/D46362
llvm-svn: 331462
Alexander Kornienko [Thu, 3 May 2018 16:01:49 +0000 (16:01 +0000)]
Added trailing periods.
llvm-svn: 331461
Alexander Kornienko [Thu, 3 May 2018 15:59:39 +0000 (15:59 +0000)]
Add a trailing period in release notes.
llvm-svn: 331460
Aaron Ballman [Thu, 3 May 2018 15:33:50 +0000 (15:33 +0000)]
Allow writing calling convention attributes on function types.
Calling convention attributes notionally appertain to the function type -- they modify the mangling of the function, change the behavior of assignment operations, etc. This commit allows the calling convention attributes to be written in the type position as well as the declaration position.
llvm-svn: 331459
Pavel Labath [Thu, 3 May 2018 15:33:41 +0000 (15:33 +0000)]
Remove the timed_out out-argument from Predicate::WaitForValueEqualTo
The function can only return in one of two ways: the Predicate value is
successfully set within the allotted time, or it isn't (the wait times
out). These states can be represented in the return value, and the extra
arg adds no value.
llvm-svn: 331458
Sam McCall [Thu, 3 May 2018 14:53:02 +0000 (14:53 +0000)]
[clangd] Incorporate #occurrences in scoring code complete results.
Summary: needs tests
Reviewers: ilya-biryukov
Subscribers: klimek, ioeric, MaskRay, jkorous, cfe-commits
Differential Revision: https://reviews.llvm.org/D46183
llvm-svn: 331457
Alexander Kornienko [Thu, 3 May 2018 14:40:37 +0000 (14:40 +0000)]
[clang-tidy] Remove AnalyzeTemporaryDtors option.
Remove the `AnalyzeTemporaryDtors` option, since the corresponding
`cfg-temporary-dtors` option of the Static Analyzer defaults to `true` since
r326461.
llvm-svn: 331456
Nico Weber [Thu, 3 May 2018 14:25:57 +0000 (14:25 +0000)]
use LLVM's standard CMakeLists.txt layout for llvm-xray
llvm-svn: 331455
Roman Lebedev [Thu, 3 May 2018 13:33:07 +0000 (13:33 +0000)]
[CodeGen][X86][NFC] Copy two selectcc tests from AArch64.
These tests are for DAGCombiner::foldSelectCCToShiftAnd().
Right now, they were only tested for AArch64,
but given the upcoming X86 changes to the hasAndNot(),
the test coverage needs to be added.
These tests originated from D27489 / rL289738
llvm-svn: 331454
Simon Pilgrim [Thu, 3 May 2018 13:27:10 +0000 (13:27 +0000)]
[X86] Split WriteVecALU/WritePHAdd into XMM and YMM/ZMM scheduler classes
llvm-svn: 331453
Peter Smith [Thu, 3 May 2018 12:59:52 +0000 (12:59 +0000)]
[LLD][AArch64] Simplify relocations sharing same encoding [NFC]
The code to encode the result in relocateOne for the relocations:
R_AARCH64_LD64_GOT_LO12_NC
R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC
R_AARCH64_TLSDESC_LD64_LO12
is equivalent to that for R_AARCH64_LDST64_ABS_LO12_NC. This is described
in the ABI as "Set the LD/ST immediate field bits [11:3] of X. No overflow
check; check that X&7 =0.
Differential Revision: https://reviews.llvm.org/D46247
llvm-svn: 331452
Tim Northover [Thu, 3 May 2018 12:54:25 +0000 (12:54 +0000)]
ARM: don't try to over-align large vectors as arguments.
By default LLVM thinks very large vectors get aligned to their size when
passed across functions. Unfortunately no-one told the ARM backend so it
doesn't trigger stack realignment and so accesses can cause the usual
misalignment issues (e.g. a data abort).
This changes the ABI alignment to the stack alignment, which in practice
(and as a bonus) also coincides with the alignment "natural" vectors get.
llvm-svn: 331451
Nico Weber [Thu, 3 May 2018 12:44:27 +0000 (12:44 +0000)]
Fix test failure for missing _LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS
This is a follow-up change to r331150. The CL moved the macro from individual
file to build file, but the macro is missed in a test config file.
https://reviews.llvm.org/D46385
Patch from Taiju Tsuiki <tzik@chromium.org>!
llvm-svn: 331450
Piotr Padlewski [Thu, 3 May 2018 11:03:53 +0000 (11:03 +0000)]
perform DSE through launder.invariant.group
Summary:
Alias Analysis knows that llvm.launder.invariant.group
returns pointer that mustalias argument, but this information
wasn't used, therefor we didn't DSE through launder.invariant.group
Reviewers: chandlerc, dberlin, bogner, hfinkel, efriedma
Reviewed By: dberlin
Subscribers: amharc, llvm-commits, nlewycky, rsmith
Differential Revision: https://reviews.llvm.org/D31581
llvm-svn: 331449
Piotr Padlewski [Thu, 3 May 2018 11:03:01 +0000 (11:03 +0000)]
Rename invariant.group.barrier to launder.invariant.group
Summary:
This is one of the initial commit of "RFC: Devirtualization v2" proposal:
https://docs.google.com/document/d/16GVtCpzK8sIHNc2qZz6RN8amICNBtvjWUod2SujZVEo/edit?usp=sharing
Reviewers: rsmith, amharc, kuhar, sanjoy
Subscribers: arsenm, nhaehnle, javed.absar, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D45111
llvm-svn: 331448
Pavel Labath [Thu, 3 May 2018 10:57:16 +0000 (10:57 +0000)]
lldb-test symbols: Add ability to do name-based lookup
Summary:
lldb-test already had the ability to dump all symbol information in a
module. This is interesting, but it can be too verbose, and it also does
not use the same APIs that lldb uses to query symbol information. The
last part is interesting to me now, because I am about to add DWARF v5
debug_names support, which needs to implement these APIs.
This patch adds a set of arguments to lldb-test, which modify it's
behavior from dumping all symbols to dumping only the requested
information:
- --find={function,namespace,type,variable} - search for the given
kind of objects.
- --name - the name to search for.
- --regex - whether to treat the "name" as a regular expression. This is
not available for all lookup types (we do not have the required APIs
for namespaces and types).
- --context - specifies the context, which can be used to restrict the
search. This argument takes a variable name (which must be defined and
be unique), and we then use the context that this variable is defined
in as the search context.
- --function-flags={auto,full,base,method,selector} - a set of flags to
further restrict the search for function symbols.
Together, these flags and their combinations cover the main SymbolFile
entry points which I will need to modify for the accelerator table
support, and so I plan to do most of the regression testing this way.
(I've also found this a useful tool for exploration of what the given
APIs are supposed to do.)
I add a couple of tests to demonstrate the usage of the usage of the
various options, and also an xfailed test which demonstrates a bug I
found while playing with this. The only requirement for these tests is
the presence of lld -- the should run on any platform which is able to
build lldb.
These tests use c++ code as input, but this isn't a requirement. It is also
possible to use IR, assembly or json to create the test module.
Reviewers: davide, zturner, asmith, JDevlieghere, clayborg, alexshap
Subscribers: mgorny, aprantl, lldb-commits
Differential Revision: https://reviews.llvm.org/D46318
llvm-svn: 331447
Simon Pilgrim [Thu, 3 May 2018 10:53:17 +0000 (10:53 +0000)]
[X86][AVX512] VPAVG instructions should be tagged as SchedWriteVecALU
llvm-svn: 331446
Simon Pilgrim [Thu, 3 May 2018 10:31:20 +0000 (10:31 +0000)]
[X86] Split WriteVecIMul/WriteVecPMULLD/WriteMPSAD/WritePSADBW into XMM and YMM/ZMM scheduler classes
Also retagged VDBPSADBW instructions as SchedWritePSADBW instead of SchedWriteVecIMul which matches the behaviour on SkylakeServer (the only thing that supports it...)
llvm-svn: 331445
David Zarzycki [Thu, 3 May 2018 10:03:45 +0000 (10:03 +0000)]
[CMake] Fix BUILD_SHARED_LIBS regression due to r331405
llvm-svn: 331444
Simon Pilgrim [Thu, 3 May 2018 09:11:32 +0000 (09:11 +0000)]
[X86] Update MMX instructions to be tagged with X86SchedWriteWidths types
llvm-svn: 331443
Benjamin Kramer [Thu, 3 May 2018 08:25:14 +0000 (08:25 +0000)]
[WebAssembly] MC: Don't litter test directory.
llvm-svn: 331442
Martin Storsjo [Thu, 3 May 2018 07:09:33 +0000 (07:09 +0000)]
Revert "[SelectionDAG] Selection of DBG_VALUE using a PHI node result (pt 2)"
This reverts SVN r331337, see PR37321 for details on the regression
it introduced.
llvm-svn: 331441
Fangrui Song [Thu, 3 May 2018 06:37:47 +0000 (06:37 +0000)]
Enable -fsanitize=function on FreeBSD.
llvm-svn: 331440
Clement Courbet [Thu, 3 May 2018 06:08:47 +0000 (06:08 +0000)]
[TableGen][NFC] Make ResourceCycles definitions more explicit.
https://reviews.llvm.org/D46356
llvm-svn: 331439
Karl-Johan Karlsson [Thu, 3 May 2018 05:53:29 +0000 (05:53 +0000)]
Fix -Wunused-variable warning in Clang.cpp
llvm-svn: 331438
Craig Topper [Thu, 3 May 2018 05:48:49 +0000 (05:48 +0000)]
[LoopIdiomRecognize] When looking for 'x & (x -1)' for popcnt, make sure the left hand side of the 'and' matches the left hand side of the 'subtract'
llvm-svn: 331437
Craig Topper [Thu, 3 May 2018 05:48:48 +0000 (05:48 +0000)]
[LoopIdiomRecognize] Add a test case showing that we transform to ctpop without fully checking the 'x & (x-1)' part.
The code fails to check that the same value is used twice. We only make sure the left hand side of the and is part of the loop recurrence. The 'x' in the subtract can be any value.
llvm-svn: 331436
Jan Vesely [Thu, 3 May 2018 05:44:28 +0000 (05:44 +0000)]
remquo: Flush denormals if not supported
It's OK to either flush to 0 or return denormal result if the device
does not support denormals. See sec 7.2 and 7.5.3 of OCL specs.
Fixes CTS on carrizo and turks.
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewer: Aaron Watry <awatry@gmail.com>
llvm-svn: 331435
Jan Vesely [Thu, 3 May 2018 05:44:26 +0000 (05:44 +0000)]
remquo: Port from amd builtins
double version passes on carrizo. float version fails on denormals.
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewer: Aaron Watry <awatry@gmail.com>
llvm-svn: 331434
Jan Vesely [Thu, 3 May 2018 05:44:22 +0000 (05:44 +0000)]
math: Add helper function to flush denormals if not supported.
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewer: Aaron Watry <awatry@gmail.com>
llvm-svn: 331433
Craig Topper [Thu, 3 May 2018 05:00:18 +0000 (05:00 +0000)]
[LoopIdiomRecognize] Remove unnecessary cast from BinaryOperator to Instruction. NFC
BinaryOperator is a sub class of Instruction. We don't need an explicit cast back to Instruction.
llvm-svn: 331432
Saleem Abdulrasool [Thu, 3 May 2018 04:45:43 +0000 (04:45 +0000)]
lit: flesh out `SubsituteCaptures` further
Add overloads for `__len__` and `__getitem__` to allow use of this class
on Linux as well as Windows. With these overloads, lit can be used on
both hosts for the swift testsuite.
llvm-svn: 331431
Richard Smith [Thu, 3 May 2018 03:59:50 +0000 (03:59 +0000)]
Update to match clang r331428.
llvm-svn: 331429
Richard Smith [Thu, 3 May 2018 03:58:32 +0000 (03:58 +0000)]
Track the result of evaluating a computed noexcept specification on the
FunctionProtoType.
We previously re-evaluated the expression each time we wanted to know whether
the type is noexcept or not. We now evaluate the expression exactly once.
This is not quite "no functional change": it fixes a crasher bug during AST
deserialization where we would try to evaluate the noexcept specification in a
situation where we have not deserialized sufficient portions of the AST to
permit such evaluation.
llvm-svn: 331428
Max Kazantsev [Thu, 3 May 2018 02:37:55 +0000 (02:37 +0000)]
Re-enable "[SCEV] Make computeExitLimit more simple and more powerful"
This patch was temporarily reverted because it has exposed bug 37229 on
PowerPC platform. The bug is unrelated to the patch and was just a general
bug in the optimization done for PowerPC platform only. The bug was fixed
by the patch rL331410.
This patch returns the disabled commit since the bug was fixed.
llvm-svn: 331427
Rumeet Dhindsa [Thu, 3 May 2018 01:54:14 +0000 (01:54 +0000)]
Update Error Message
https://reviews.llvm.org/D46375
llvm-svn: 331426
Petr Hosek [Thu, 3 May 2018 01:44:03 +0000 (01:44 +0000)]
[CMake][Cache] Stop pretending that Fuchsia is UNIX
This changes some aspects of the build that are not relevant or useful
for Fuchsia like setting the RPATH/RUNPATH.
Differential Revision: https://reviews.llvm.org/D46361
llvm-svn: 331425
Lei Liu [Thu, 3 May 2018 01:43:23 +0000 (01:43 +0000)]
[Sema] Do not match function type with const T in template argument deduction
From http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1584,
function type should not match cv-qualified type in template argument
deduction. This also matches what GCC and EDG do in template argument
deduction.
Differential Revision: https://reviews.llvm.org/D45755
llvm-svn: 331424
Petr Hosek [Thu, 3 May 2018 01:38:49 +0000 (01:38 +0000)]
[Support] Support building LLVM for Fuchsia
These are necessary changes to support building LLVM for Fuchsia.
While these are not sufficient to run on Fuchsia, they are still
useful when cross-compiling LLVM libraries and runtimes for Fuchsia.
Differential Revision: https://reviews.llvm.org/D46345
llvm-svn: 331423
Shoaib Meenai [Thu, 3 May 2018 01:20:36 +0000 (01:20 +0000)]
[ObjCARC] Convert an if to an early continue. NFC
This reduces nesting and makes the logic slightly easier to follow.
Differential Revision: https://reviews.llvm.org/D46371
llvm-svn: 331422
Alex Lorenz [Thu, 3 May 2018 01:12:06 +0000 (01:12 +0000)]
[ObjC] Supress the 'implementing unavailable method' warning when
the method declaration is unavailable for an app extension platform
Rationale:
Classes are often shared between an app extension code and
non-app extension code. There's no way to remove the implementation
using preprocessor when building the app extension, so we should not warn here.
rdar://
38150617
llvm-svn: 331421
Nemanja Ivanovic [Thu, 3 May 2018 01:04:13 +0000 (01:04 +0000)]
Commit r331416 breaks the big-endian PPC bot. On the big endian build, we
actually encounter constants wider than 64-bits. Add the guard to prevent
tripping the assert.
llvm-svn: 331420
Rumeet Dhindsa [Thu, 3 May 2018 00:28:51 +0000 (00:28 +0000)]
Updated ThinLTO test to not include forward or backward slash for testing
Differential Revision: https://reviews.llvm.org/D46372
llvm-svn: 331419
Chandler Carruth [Thu, 3 May 2018 00:11:03 +0000 (00:11 +0000)]
[gcov] Switch to an explicit if clunky array to satisfy some compilers
on various build bots that are unhappy with using makeArrayRef with an
initializer list.
llvm-svn: 331418
Michael Berg [Thu, 3 May 2018 00:07:56 +0000 (00:07 +0000)]
MachineInst support mapping SDNode fast math flags for support in Back End code generation
Summary:
Machine Instruction flags for fast math support and MIR print support
Reviewers: spatel, arsenm
Reviewed By: arsenm
Subscribers: wdng
Differential Revision: https://reviews.llvm.org/D45781
llvm-svn: 331417
Nemanja Ivanovic [Wed, 2 May 2018 23:55:23 +0000 (23:55 +0000)]
[PowerPC] Implement isMaskAndCmp0FoldingBeneficial
Sinking the and closer to a compare against zero is beneficial on PPC as it
allows us to emit record-form instructions. In the future, we may expand this
to a larger set of operations that feed compares against zero since PPC has
lots of record-form instructions.
Differential revision: https://reviews.llvm.org/D46060
llvm-svn: 331416
Davide Italiano [Wed, 2 May 2018 23:36:07 +0000 (23:36 +0000)]
[NSDictionary] Simplify the formatter. NFCI.
llvm-svn: 331415
Sam Clegg [Wed, 2 May 2018 23:11:38 +0000 (23:11 +0000)]
[WebAssembly] MC: Create and use first class section symbols
Differential Revision: https://reviews.llvm.org/D46335
llvm-svn: 331413
Sam Clegg [Wed, 2 May 2018 23:01:10 +0000 (23:01 +0000)]
[MC] Factor MCObjectStreamer::addFragmentAtoms out of MachO streamer.
This code previously existed only in MCMachOStreamer but is
useful for WebAssembly too. See: D46335
Differential Revision: https://reviews.llvm.org/D46297
llvm-svn: 331412
Chandler Carruth [Wed, 2 May 2018 22:57:20 +0000 (22:57 +0000)]
[gcov] Make the CLang side coverage test work with the new
instrumentation codegeneration strategy of using a data structure and
a loop. Required some finesse to get the critical things being tested to
surface in a nice way for FileCheck but I think this preserves the
original intent of the test.
llvm-svn: 331411
Nemanja Ivanovic [Wed, 2 May 2018 22:56:04 +0000 (22:56 +0000)]
[PowerPC] No CTR loop if the candidate exiting block is in a different loop
The CTR loops pass will insert the decrementing branch instruction in an exiting
block for the loop being transformed. However if that block is part of another
loop as well (whether a nested loop or with irreducible CFG), it is not valid
to use that exiting block. In fact, if the loop hass irreducible CFG, we don't
bother analyzing it and we just bail on the transformation. In practice, this
doesn't lead to a noticeable reduction in the number of loops transformed by
this pass.
Fixes https://bugs.llvm.org/show_bug.cgi?id=37229
Differential Revision: https://reviews.llvm.org/D46162
llvm-svn: 331410
Alex Lorenz [Wed, 2 May 2018 22:40:19 +0000 (22:40 +0000)]
[ObjC] The absence of ownership qualifiers on an ambiguous property leads
to synthesis of a valid property even when the selected protocol property
has ownership qualifiers
rdar://
39024725
llvm-svn: 331409
Chandler Carruth [Wed, 2 May 2018 22:24:39 +0000 (22:24 +0000)]
[GCOV] Emit the writeout function as nested loops of global data.
Summary:
Prior to this change, LLVM would in some cases emit *massive* writeout
functions with many 10s of 1000s of function calls in straight-line
code. This is a very wasteful way to represent what are fundamentally
loops and creates a number of scalability issues. Among other things,
register allocating these calls is extremely expensive. While D46127 makes this
less severe, we'll still run into scaling issues with this eventually. If not
in the compile time, just from the code size.
Now the pass builds up global data structures modeling the inputs to
these functions, and simply loops over the data structures calling the
relevant functions with those values. This ensures that the code size is
a fixed and only data size grows with larger amounts of coverage data.
A trivial change to IRBuilder is included to make it easier to build
the constants that make up the global data.
Reviewers: wmi, echristo
Subscribers: sanjoy, mcrosier, llvm-commits, hiraditya
Differential Revision: https://reviews.llvm.org/D46357
llvm-svn: 331407
Richard Smith [Wed, 2 May 2018 22:21:11 +0000 (22:21 +0000)]
Use conventional spelling of always-failing assert.
Fixes -Wstring-conversion warning that was breaking -Werror builds.
llvm-svn: 331406
Rumeet Dhindsa [Wed, 2 May 2018 21:40:07 +0000 (21:40 +0000)]
Added support for ThinLTO plugin options : thinlto-index-only and thinlto-prefix-replace
Differential Revision: https://reviews.llvm.org/D46034
llvm-svn: 331405
Martin Storsjo [Wed, 2 May 2018 21:15:24 +0000 (21:15 +0000)]
[llvm-rc] Default to writing the output next to the input, if no output is specified
This matches what rc.exe does if no output is specified.
Differential Revision: https://reviews.llvm.org/D46239
llvm-svn: 331403
Martin Storsjo [Wed, 2 May 2018 21:15:13 +0000 (21:15 +0000)]
[llvm-cvtres] Allow parameters preceded by '-' in addition to '/'
The real cvtres.exe also allows parameters in either form.
Differential Revision: https://reviews.llvm.org/D46358
llvm-svn: 331402
Artem Dergachev [Wed, 2 May 2018 20:33:17 +0000 (20:33 +0000)]
[analyzer] Revert r331096 "CStringChecker: Add support for BSD strlcpy()...".
The return values of the newly supported functions were not handled correctly:
strlcpy()/strlcat() return string sizes rather than pointers.
Differential Revision: https://reviews.llvm.org/D45177
llvm-svn: 331401
Paul Semel [Wed, 2 May 2018 20:19:22 +0000 (20:19 +0000)]
[llvm-objcopy] Add --discard-all (-x) option
llvm-svn: 331400
Craig Topper [Wed, 2 May 2018 20:18:57 +0000 (20:18 +0000)]
[X86] Mark all x86 specific builtins as nothrow.
I believe all of the x86 builtins should be considered nothrow.
I've left the incssp builtins alone because I think its current attributes are wrong and I'm following up with the contributor for that.
I plan to start adding const as well, but that requires more careful auditing.
Differential Revision: https://reviews.llvm.org/D46328
llvm-svn: 331399
Roman Tereshin [Wed, 2 May 2018 20:15:11 +0000 (20:15 +0000)]
[GlobalISel][InstructionSelect] Making Coverage Info generation optional on per-match table basis
to make sure that Testgen always has access to coverage info even if
the match table used by the selector itself is stripped off that
information for performance reasons.
Reviewers: dsanders, aemerson
Reviewed By: dsanders
Subscribers: rovka, kristof.beyls, llvm-commits, dsanders
Differential Revision: https://reviews.llvm.org/D46098
llvm-svn: 331398
Paul Semel [Wed, 2 May 2018 20:14:49 +0000 (20:14 +0000)]
[llvm-objcopy] Add --weaken option
llvm-svn: 331397
Roman Tereshin [Wed, 2 May 2018 20:08:14 +0000 (20:08 +0000)]
[GlobalISel][InstructionSelect] Refactoring buildMatchTable out, NFC
to share it between the Instruction Selector in optimized and
non-optimized modes both and the Testgen.
Reviewers: dsanders, aemerson
Reviewed By: dsanders
Subscribers: rovka, kristof.beyls, llvm-commits, dsanders
Differential Revision: https://reviews.llvm.org/D46097
llvm-svn: 331396
Roman Tereshin [Wed, 2 May 2018 20:07:15 +0000 (20:07 +0000)]
[GlobalISel][InstructionSelect] Refactoring out a getMatchTable virtual method + other small NFC's
The main goal is to share getMatchTable between the Instruction
Selector and the Testgen.
The commit also contains some NFC only loosely related to refactoring
out the getMatchTable, but strongly related to the initial Testgen
patch (see https://reviews.llvm.org/D43962)
Reviewers: dsanders, aemerson
Reviewed By: dsanders
Subscribers: rovka, kristof.beyls, llvm-commits, dsanders
Differential Revision: https://reviews.llvm.org/D46096
llvm-svn: 331395
Leonard Mosescu [Wed, 2 May 2018 20:06:17 +0000 (20:06 +0000)]
Use the UUID from the minidump's CodeView Record for placeholder modules
This change adds support for two types of Minidump CodeView records:
PDB70 (reference: https://crashpad.chromium.org/doxygen/structcrashpad_1_1CodeViewRecordPDB70.html)
This is by far the most common record type.
ELF BuildID (found in Breakpad/Crashpad generated minidumps)
This would set a proper UUID for placeholder modules, in turn enabling
an accurate match with local module images.
Differential Revision: https://reviews.llvm.org/D46292
llvm-svn: 331394