Francis Visoiu Mistrih [Wed, 19 Feb 2020 00:39:05 +0000 (16:39 -0800)]
[macho][NFC] Extract all CPU_(SUB_)TYPE logic to libObject
This moves all the logic of converting LLVM Triples to
MachO::CPU_(SUB_)TYPE from the specific target (Target)AsmBackend to
more convenient functions in libObject.
This also gets rid of the separate two X86AsmBackend classes.
Differential Revision: https://reviews.llvm.org/D74808
Simon Pilgrim [Thu, 20 Feb 2020 18:22:45 +0000 (18:22 +0000)]
[DAGCombiner] Use SDValue::getConstantOperandAPInt helper where possible. NFC.
Jordan Rupprecht [Wed, 19 Feb 2020 20:01:09 +0000 (12:01 -0800)]
[lldb] Fix version string when using LLDB_REVISION but not LLDB_REPOSITORY
Summary:
lldb's format string (line one) is:
`lldb version $clang_version ($lldb_repo revision $lldb_revision)`
When only using $lldb_revision and not $lldb_repo, this might look like:
`lldb version 11 ( revision 12345)`
which looks pretty ugly.
Aside: I'm not sure we really need all the different versions since we've moved to the monorepo layout -- I don't think anyone is using different llvm/clang/lldb revisions, are they? We could likely tidy this up further if we knew how people consumed the output of lldb --version.
Reviewers: labath, JDevlieghere, friss
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D74859
Muhammad Omair Javaid [Thu, 20 Feb 2020 17:15:37 +0000 (22:15 +0500)]
Add target.xml support for qXfer request.
Summary:
Requesting registers one by one takes a while in our project.
We want to get rid of it by using target.xml.
Reviewers: jarin, labath, omjavaid
Reviewed By: labath, omjavaid
Subscribers: omjavaid, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D74217
Louis Dionne [Thu, 20 Feb 2020 17:33:17 +0000 (12:33 -0500)]
[clang] Fix search path logic for C_INCLUDE_DIRS
For each absolute path given to C_INCLUDE_DIRS, we want it to be added
as-is to the include search path. Relative paths should be prefixed
with the sysroot.
Thanks to Marco Hinz for the patch.
Differential Revision: https://reviews.llvm.org/D69221
Craig Topper [Thu, 20 Feb 2020 17:27:18 +0000 (09:27 -0800)]
[X86] Fix a -Wparentheses warning. NFC
Eugene Zelenko [Thu, 20 Feb 2020 17:30:11 +0000 (17:30 +0000)]
[clang-tidy] rename_check.py: maintain alphabetical order in Renamed checks section
Summary:
Also use //check// in add_new_check.py for terminology consistency.
PS
My GitHub ID is [[ https://github.com/EugeneZelenko | EugeneZelenko ]], if it's necessary for attribution.
Reviewers: alexfh, hokein, aaron.ballman, njames93, MyDeveloperDay
Reviewed By: njames93
Subscribers: Andi, xazax.hun, cfe-commits
Tags: #clang-tools-extra, #clang
Differential Revision: https://reviews.llvm.org/D73580
Logan Smith [Thu, 20 Feb 2020 17:23:36 +0000 (12:23 -0500)]
[libc++] Fix unqualified call to 'ref' inside shared_ptr(unique_ptr<U, D>)
This prevents unintended ADL: https://gcc.godbolt.org/z/EHw3Gy
This issue was mentioned as an addendum in PR44398.
Differential Revision: https://reviews.llvm.org/D74289
Logan Smith [Thu, 20 Feb 2020 17:20:21 +0000 (12:20 -0500)]
[libc++] Fix unintended ADL inside ref(reference_wrapper<T>) and cref(reference_wrapper<T>)
This patch qualifies calls to ref and cref inside ref(reference_wrapper<T>)
and cref(reference_wrapper<T>), respectively. These previously unqualified
calls could break in the presence of user functions called ref/cref inside
associated namespaces: https://gcc.godbolt.org/z/8VfprT
Fixes PR44398.
Differential Revision: https://reviews.llvm.org/D74287
Craig Topper [Thu, 20 Feb 2020 16:49:09 +0000 (08:49 -0800)]
[X86] Rewrite LowerBRCOND to remove dead code and handle ISD::SETCC and overflow ops directly.
There's a lot of old leftover code in LowerBRCOND. Especially
the detecting or AND or OR of X86ISD::SETCC nodes. Those were
needed before LegalizeDAG was changed to visit nodes before
their operands.
It also relied on reversing the output of LowerSETCC to find the
flags producing node to use for the X86ISD::BRCOND node.
Rather than using LowerSETCC this patch uses emitFlagsForSetcc to
handle the integer ISD::SETCC case. This gives the flag producer
and the comparison code to use directly. I've removed the addTest
flag and just produce a X86ISD::BRCOND and return immediately.
Floating point ISD::SETCC case is just an X86ISD::FCMP with special
care for OEQ and UNE derived from the previous code. I've left
f128 out so it will emit a test. And LowerSETCC will be called
later to produce a libcall and X86ISD::SETCC. We have combines
that can merge the test and X86ISD::SETCC.
We need to handle two cases for overflow ops. Either they are used
directly or they have a seteq 0 or setne 1 to invert the overflow.
The old code did not handle the setne 1 case, but I think some
other combines were making up for it.
If we fail to find a condition, we'll wrap an AND with 1 on the
original condition and tell emitFlagsForSetcc to emit a compare
with 0. This will pickup the LowerAndToBT and or the EmitTest case.
I kept the isTruncWithZeroHighBitsInput call, but we might be able
to fold that in to emitFlagsForSetcc.
Differential Revision: https://reviews.llvm.org/D74750
Craig Topper [Thu, 20 Feb 2020 16:30:22 +0000 (08:30 -0800)]
[AArch64] Move isOverflowIntrOpRes help function to the ISD namespace in SelectionDAG.h. NFC
Enables sharing with an upcoming X86 change.
Sanjay Patel [Thu, 20 Feb 2020 16:29:47 +0000 (11:29 -0500)]
[x86] add vector tests for splatted memory ops; NFC
These correspond to patterns seen in PR42024:
https://bugs.llvm.org/show_bug.cgi?id=42024
Danilo Carvalho Grael [Thu, 20 Feb 2020 16:24:50 +0000 (11:24 -0500)]
[AArch64][SVE] Add intrinsics for SVE2 bitwise ternary operations
Summary:
Add intrinsics for the following operations:
- eor3, bcax
- bsl, bsl1n, bsl2n, nbsl
Reviewers: kmclaughlin, c-rhodes, sdesmalen, efriedma, rengolin
Reviewed By: efriedma
Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74785
Craig Topper [Thu, 20 Feb 2020 16:09:58 +0000 (08:09 -0800)]
[X86] Add DAG combines to form CVTPH2PS/CVTPS2PH from vXf16->vXf32/vXf64 fp_extends and vXf32->vXf16 fp_round.
Only handle power of 2 element count for simplicity. Not sure what to do with vXf64->vXf16 fp_round to avoid double rounding
Differential Revision: https://reviews.llvm.org/D74886
Utkarsh Saxena [Thu, 20 Feb 2020 16:09:58 +0000 (17:09 +0100)]
[clang][analyzer] Modify include AllocationState.h in PutenvWithAutoChecker.cpp
Summary:
PutenvWithAutoChecker.cpp used to include "AllocationState.h" that is present in project root.
This makes build systems like blaze unhappy. Made it include the header relative to source file.
Reviewers: kadircet
Subscribers: xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, Charusso, martong, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D74906
Simon Pilgrim [Thu, 20 Feb 2020 15:49:22 +0000 (15:49 +0000)]
[DAGCombine] visitEXTRACT_VECTOR_ELT - add SimplifyDemandedBits multi use support
Similar to what we already do with SimplifyDemandedVectorElts, call SimplifyDemandedBits across all the extracted elements of the source vector, treating it as single use.
There's a minor regression in store-weird-sizes.ll which will be addressed in an upcoming SimplifyDemandedBits patch.
Hans Wennborg [Thu, 20 Feb 2020 15:35:30 +0000 (16:35 +0100)]
Add #include <condition_variable> to fix build after
85fb997659b5
See https://reviews.llvm.org/D74300#
1884614
Sanjay Patel [Thu, 20 Feb 2020 15:32:18 +0000 (10:32 -0500)]
[x86] regenerate test checks with less shuffle scrubbing; NFC
For shuffles with memory operands, we generally don't want to
hide the asm because we want to verify that the address offsets
are as expected.
Sean Fertile [Thu, 20 Feb 2020 14:52:11 +0000 (09:52 -0500)]
[PowerPC][NFC] We do not save/restore vrsave for any remaining subtargets.
Extend lit test to show that we don't save or restore vrsave register
when expanding @llvm.eh.unwind.init().
Sam Parker [Thu, 20 Feb 2020 14:58:08 +0000 (14:58 +0000)]
[NFC][RDA] Break-up initialization code
Separate out the initialization code from the loop traversal so
that the analysis can be reset and re-run by a user.
Matt Arsenault [Thu, 20 Feb 2020 14:42:32 +0000 (09:42 -0500)]
AMDGPU: Fix v2i64<->v4f32 bitcast
I'm not sure how to test the v2i64->v4f32 case since I can't think of
any v2i64 cases that won't legalize to v4i32.
Sanjay Patel [Thu, 20 Feb 2020 14:22:56 +0000 (09:22 -0500)]
[Utils][x86] add an option to reduce scrubbing of shuffles with memops
I was drafting a patch that would increase broadcast load usage,
but our shuffle scrubbing makes it impossible to see if the memory
operand offset was getting created correctly. I'm proposing to make
that an option (defaulted to 'off' for now to reduce regression
test churn).
The updated files provide examples of tests where we can now verify
that the pointer offset for a loaded memory operand is correct. We
still have stack and constant scrubbing that can obscure the operand
even if we don't scrub the entire instruction.
Differential Revision: https://reviews.llvm.org/D74775
Sebastian Neubauer [Thu, 13 Feb 2020 08:43:08 +0000 (09:43 +0100)]
[AMDGPU] Don’t marke the .note section as ALLOC
Marking a section as ALLOC tells the ELF loader to load the section into memory.
As we do not want to load the notes into VRAM, the flag should not be there.
Differential Revision: https://reviews.llvm.org/D74600
Simon Pilgrim [Thu, 20 Feb 2020 13:54:20 +0000 (13:54 +0000)]
Regenerate rotate test. NFC.
Haojian Wu [Wed, 19 Feb 2020 11:27:12 +0000 (12:27 +0100)]
[clang][Index] Fix the incomplete instantiations in libindex.
Summary:
libindex will canonicalize references to template instantiations:
- 1) reference to an explicit template specialization, report the specializatiion
- 2) otherwise, report the primary template
but 2) is not true for incomplete instantiations, this patch fixes this.
Fixes https://github.com/clangd/clangd/issues/287
Reviewers: kadircet
Subscribers: ilya-biryukov, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D74830
Djordje Todorovic [Thu, 20 Feb 2020 12:43:01 +0000 (13:43 +0100)]
Revert "Reland "[DebugInfo] Enable the debug entry values feature by default""
This reverts commit rGfaff707db82d.
A failure found on an ARM 2-stage buildbot.
The investigation is needed.
Roman Lebedev [Thu, 20 Feb 2020 13:39:26 +0000 (16:39 +0300)]
[Sema] Demote call-site-based 'alignment is a power of two' check for AllocAlignAttr into a warning
Summary:
As @rsmith notes in https://reviews.llvm.org/D73020#inline-672219
while that is certainly UB land, it may not be actually reachable at runtime, e.g.:
```
template<int N> void *make() {
if ((N & (N-1)) == 0)
return operator new(N, std::align_val_t(N));
else
return operator new(N);
}
void *p = make<7>();
```
and we shouldn't really error-out there.
That being said, i'm not really following the logic here.
Which ones of these cases should remain being an error?
Reviewers: rsmith, erichkeane
Reviewed By: erichkeane
Subscribers: cfe-commits, rsmith
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73996
Konrad Kleine [Thu, 20 Feb 2020 13:20:41 +0000 (08:20 -0500)]
[lldb]: fix typo in lldb-gdb-remote.txt
Summary: The logic of the sentence made more sense when "with" is replaced with "without".
Reviewers: labath
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D74895
Pavel Labath [Thu, 20 Feb 2020 12:42:52 +0000 (13:42 +0100)]
[lldb] Add boilerplate to recognize the .debug_tu_index section
It's just like debug_cu_index, only for type units.
Andrzej Warzynski [Thu, 20 Feb 2020 10:40:39 +0000 (10:40 +0000)]
[AArch64][SVE] Re-arrange definitions in AArch64SVEInstrInfo.td (NFC)
Re-arrange definitions related to loads and stores so that they are
grouped together.
This patch implements only non-functional changes.
Simon Pilgrim [Thu, 20 Feb 2020 11:10:56 +0000 (11:10 +0000)]
[AMDGPU] simplifyI24 - replace GetDemandedBits with SimplifyMultipleUseDemandedBits
GetDemandedBits mostly just calls SimplifyMultipleUseDemandedBits now, but it does a very blunt constant simplification that SimplifyMultipleUseDemandedBits avoids.
If we need to demand bits from constants we should handle this through ShrinkDemandedConstant/targetShrinkDemandedConstant.
@arsenm confirmed that the sign extended immediates are better for code size.
Differential Revision: https://reviews.llvm.org/D74857
dfukalov [Wed, 19 Feb 2020 11:05:33 +0000 (14:05 +0300)]
SpeculativeExecution: fixed ingoring free execution
Summary:
After updating cost model in AMDGPU target (
47a5c36b37f0) the pass started to
ignore some BBs since they got all instructions estimated as free.
Reviewers: arsenm, chandlerc, nhaehnle
Reviewed By: nhaehnle
Subscribers: jvesely, wdng, nhaehnle, tpr, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74825
Roman Lebedev [Thu, 20 Feb 2020 11:06:40 +0000 (14:06 +0300)]
[clang-tidy] misc-no-recursion: point to the function defs, not decls
Results in slightly better UX.
This actually was the initial intent, but it kinda got lost along the way.
Mikhail Maltsev [Thu, 20 Feb 2020 10:51:19 +0000 (10:51 +0000)]
[ARM,MVE] Add vqdmull[b,t]q intrinsic families
Summary:
This patch adds two families of ACLE intrinsics: vqdmullbq and
vqdmulltq (including vector-vector and vector-scalar variants) and the
corresponding LLVM IR intrinsics llvm.arm.mve.vqdmull and
llvm.arm.mve.vqdmull.predicated.
Reviewers: simon_tatham, MarkMurrayARM, dmgreen, ostannard
Reviewed By: MarkMurrayARM
Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D74845
serge-sans-paille [Thu, 20 Feb 2020 10:22:35 +0000 (11:22 +0100)]
[NFC] Remove ar/ranlib test noise during cmake step
At least on RHEL, ar outputs on stderr a message similar to
.../bin/ar: creating t.a
Which creates noise during the cmake step. Get rid of it.
Luís Marques [Thu, 20 Feb 2020 10:12:31 +0000 (10:12 +0000)]
[compiler-rt] [builtins] Fix logb / logbl tests
Like was done before in D67999 for `logbf`, this patch fixes the tests for
the internal compiler-rt implementations of `logb` and `logbl` to consider
all NaNs equivalent. Not doing so was resulting in test failures for
riscv64, since the the NaNs had different signs, but the spec doesn't
specify the NaN signedness or payload.
Fixes bug 44244.
Reviewers: rupprecht, delcypher
Reviewed By: rupprecht, delcypher
Differential Revision: https://reviews.llvm.org/D74826
Pavel Labath [Thu, 20 Feb 2020 09:36:11 +0000 (10:36 +0100)]
[lldb/DWARF] Always construct a DWARFDebugInfo object
Change the return value of SymbolFileDWARF::DebugInfo from a pointer to
a reference, and remove all null checks.
Previously, we were not constructing the DebugInfo object when the
debug_info section was empty. Now we always construct the object but
it will return an empty list of dwarf units (a thing which it already
supported).
Tamas Petz [Thu, 20 Feb 2020 08:59:10 +0000 (09:59 +0100)]
[LLD][ELF][ARM] Add test cases for R_ARM_THM_MOV*-type relocs
Summary: This patch adds missing tests cases for R_ARM_THM_MOVW/MOVT* relocations for the sake of completeness.
Reviewers: peter.smith, MaskRay, espindola, psmith
Reviewed By: MaskRay, psmith
Subscribers: psmith, danielkiss, emaste, kristof.beyls, llvm-commits
Tags: #llvm, #lld
Differential Revision: https://reviews.llvm.org/D74827
Johannes Doerfert [Thu, 20 Feb 2020 08:03:32 +0000 (02:03 -0600)]
[Attributor] Make sure abstract attributes are properly initialized
Johannes Doerfert [Thu, 20 Feb 2020 08:02:57 +0000 (02:02 -0600)]
[Attributor][NFC] Refactor interface
Johannes Doerfert [Thu, 20 Feb 2020 08:06:14 +0000 (02:06 -0600)]
[Attributor][NFC] Prepare some tests to be used with update test script
Raphael Isemann [Thu, 20 Feb 2020 07:13:52 +0000 (08:13 +0100)]
[lldb] Remove license headers from all test source files
Summary:
Around a third of our test sources have LLVM license headers. This patch removes those headers from all test
sources and also fixes any tests that depended on the length of the license header.
The reasons for this are:
* A few tests verify line numbers and will start failing if the number of lines in the LLVM license header changes. Once I landed my patch for valid SourceLocations in debug info we will probably have even more tests that verify line numbers.
* No other LLVM project is putting license headers in its test files to my knowledge.
* They make the test sources much more verbose than they have to be. Several tests have longer license headers than the actual test source.
For the record, the following tests had their line numbers changed to pass with the removal of the license header:
lldb-api :: functionalities/breakpoint/breakpoint_by_line_and_column/TestBreakpointByLineAndColumn.py
lldb-shell :: Reproducer/TestGDBRemoteRepro.test
lldb-shell :: Reproducer/TestMultipleTargets.test
lldb-shell :: Reproducer/TestReuseDirectory.test
lldb-shell :: ExecControl/StopHook/stop-hook-threads.test
lldb-shell :: ExecControl/StopHook/stop-hook.test
lldb-api :: lang/objc/exceptions/TestObjCExceptions.py
Reviewers: #lldb, espindola, JDevlieghere
Reviewed By: #lldb, JDevlieghere
Subscribers: emaste, aprantl, arphaman, JDevlieghere, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D74839
Alexander Belyaev [Thu, 20 Feb 2020 07:29:39 +0000 (08:29 +0100)]
Remove debugging artefact.
serge-sans-paille [Sun, 16 Feb 2020 08:31:16 +0000 (09:31 +0100)]
Fix compiler extension in standalone mode
Use a dedicated cmake file to store the extension configured within LLVM. That
way, a standalone build of clang can load this cmake file and get all the
configured standalone extensions.
This patch is related to https://reviews.llvm.org/D74602
Differential Revision: https://reviews.llvm.org/D74757
Fangrui Song [Thu, 20 Feb 2020 05:27:13 +0000 (21:27 -0800)]
[ELF][test] Fix section sh_type and sh_flags
A future MC change may add a warning/error when a .section directive
specifies incorrect sh_flags/sh_type.
Hideto Ueno [Thu, 20 Feb 2020 04:00:43 +0000 (13:00 +0900)]
[MustExecute] Add backward exploration for must-be-executed-context
Summary:
As mentioned in D71974, it is useful for must-be-executed-context to explore CFG backwardly.
This patch is ported from parts of D64975. We use a dominator tree to find the previous context if
a dominator tree is available.
Reviewers: jdoerfert, hfinkel, baziotis, sstefan1
Reviewed By: jdoerfert
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74817
Johannes Doerfert [Sun, 16 Feb 2020 23:37:50 +0000 (17:37 -0600)]
[Attributor][NFC] Improve the debug output & add a TODO
Johannes Doerfert [Wed, 19 Feb 2020 22:53:56 +0000 (16:53 -0600)]
[Attributor][NFC] Add more memory_location tests
Johannes Doerfert [Thu, 20 Feb 2020 05:39:57 +0000 (23:39 -0600)]
[Attributor] Use existing `returned` information better
We can look through calls with `returned` argument attributes when we
collect subsuming positions. This allows us to get existing attributes
from more places.
Johannes Doerfert [Wed, 19 Feb 2020 22:52:16 +0000 (16:52 -0600)]
[Attributor][FIX] Avoid setting wrong load/store alignments
Matt Arsenault [Tue, 18 Feb 2020 17:58:02 +0000 (12:58 -0500)]
TableGen: Fix logic for default operands
This was checking for default operands in the current DAG instruction,
rather than the correct result operand list. I'm not entirly sure how
this managed to work before, but was failing for me when multiple
default operands were overridden.
Johannes Doerfert [Sun, 16 Feb 2020 22:45:28 +0000 (16:45 -0600)]
[Attributor] Generalize `getAssumedConstantInt` interface
We are often interested in an assumed constant and sometimes it has to
be an integer constant. Before we only looked for the latter, now we can
ask for either.
Johannes Doerfert [Mon, 17 Feb 2020 05:04:25 +0000 (23:04 -0600)]
[Attributor][FIX] Do not create new calls edge we cannot handle
If we propagate function pointers across function boundaries we can
create new call edges. These need to be represented in the CG if we run
as a CGSCC pass. In the new pass manager that is currently not handled
by the CallGraphUpdater so we need to prevent the situation for now.
Jonas Devlieghere [Thu, 20 Feb 2020 04:19:08 +0000 (20:19 -0800)]
[lldb/Test] s/skipIfDarwinEmbedded/skipIfRemote/ in VSCode tests.
As pointed out on lldb-commits this skipIfRemote is the better fit for
the decorator.
Johannes Doerfert [Sun, 16 Feb 2020 22:42:47 +0000 (16:42 -0600)]
[Attributor] Add initial AAIsDead for arguments
We usually will ask for liveness of an argument anyway so we ended up
lazily creating the attribute anyway. However, that is not always the
case and even if it is we should go the eager route here. Various tests
show how this can improve the outcome. One test exposed a problem with
type mismatches between argument and call site argument, a fix is
included. For liveness various more tests were added as well.
Lang Hames [Thu, 20 Feb 2020 03:06:15 +0000 (19:06 -0800)]
[examples] Fix the SpeculativeJIT example for
85fb997659b.
Lang Hames [Thu, 20 Feb 2020 03:00:35 +0000 (19:00 -0800)]
[examples] Fix the clang-interpreter example for changes in
85fb997659b.
Johannes Doerfert [Sun, 26 Jan 2020 02:24:38 +0000 (20:24 -0600)]
[Attributor] Allow multiple uses of a casted function pointer
If a function pointer is casted into a different type the resulting
expression can be a constant. If so, it can be used multiple times which
cannot be handled by the AbstractCallSite constructor alone. Instead, we
follow the cast expression uses now explicitly during the call site
traversal.
Douglas Yung [Thu, 20 Feb 2020 02:39:54 +0000 (18:39 -0800)]
Fixup test after changes made in
709fd989.
The change added a test that required exceptions, so enable that explicitly
so that it works on platforms that default to having exceptions disabled
(like the PS4).
Sourabh Singh Tomar [Thu, 20 Feb 2020 01:55:40 +0000 (07:25 +0530)]
[DebugInfo][NFCI]: Removed an exclamation mark from error message.
Igor Kudrin [Tue, 18 Feb 2020 13:34:33 +0000 (20:34 +0700)]
[DebugInfo] Remove a misleading comment for llvm::dwarf::FDE.
The comment described a linked CIE to be acquired lazily.
That is not true and looks like it was never true.
Differential Revision: https://reviews.llvm.org/D74761
Igor Kudrin [Thu, 13 Feb 2020 14:05:38 +0000 (21:05 +0700)]
[DebugInfo] Read CIE pointer as a relocatable value.
The CIE pointer field of an FDE record contains an offset to
a corresponding CIE record. In object files, this value comes with
relocation because the value has to be fixed when a linker combines
the final section from multiple sources. In most object files there is
only one CIE record at offset 0 of the .debug_frame section, so reading
a relocated or a raw value makes no difference. However, in partially
linked object files there are multiple CIE records and the relocations
should be applied to recover the right offset value.
Differential Revision: https://reviews.llvm.org/D74612
Nico Weber [Thu, 20 Feb 2020 02:09:36 +0000 (21:09 -0500)]
[gn build] (manually) partially (?) merge
7ff1f55a1219
Sam Clegg [Thu, 20 Feb 2020 01:27:09 +0000 (17:27 -0800)]
[lld][WebAssembly] Allow symbols with explict import names to be undefined at link time.
Differential Revision: https://reviews.llvm.org/D74110
Jonas Devlieghere [Thu, 20 Feb 2020 01:33:35 +0000 (17:33 -0800)]
[lldb/Test] Skip VSCode test on embedded Darwin
These tests are not configured to run on the device.
River Riddle [Thu, 20 Feb 2020 00:46:16 +0000 (16:46 -0800)]
[mlir] Update usage of createJITDylib to createBareJITDylib after LLVM change
A few tests are broken, but this allows for MLIR to build.
Sam Clegg [Thu, 6 Feb 2020 05:18:55 +0000 (21:18 -0800)]
[WebAssembly] Use llvm::Optional to store optional symbol attributes. NFC.
The changes the in-memory representation of wasm symbols such that their
optional ImportName and ImportModule use llvm::Optional.
ImportName is set whenever WASM_SYMBOL_EXPLICIT_NAME flag is set.
ImportModule (for imports) is currently always set since it defaults to
"env".
In the future we can possibly extent to binary format distingish
import which have explit module names.
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74109
Fangrui Song [Thu, 20 Feb 2020 01:13:06 +0000 (17:13 -0800)]
[ELF][test] Fix --symbol-ordering-file tests of shuffle_sections.s
Fangrui Song [Thu, 20 Feb 2020 01:09:47 +0000 (17:09 -0800)]
[ELF][test] Fix shuffle_sections.s
C++ standard libraries have different random function implementations.
We cannot expect a particular order.
Reid Kleckner [Wed, 12 Feb 2020 01:09:06 +0000 (17:09 -0800)]
[MS] Mark vectorcall FP and vector args inreg
This has no effect on how LLVM passes the arguments, but it prevents
rewriteWithInAlloca from thinking that these parameters should be part
of the inalloca pack.
Follow-up to D72114
Reviewed By: erichkeane
Differential Revision: https://reviews.llvm.org/D74452
Hanhan Wang [Wed, 19 Feb 2020 23:03:01 +0000 (18:03 -0500)]
[mlir][Linalg] Allow specifiying zero-rank shaped type operands to linalg.indexed_generic ops.
Patch D74638 allows linalg.generic ops to use zero-rank shaped type operands,
this also can be applied to linalg.indexed_generic ops.
Greg Clayton [Sun, 16 Feb 2020 05:28:36 +0000 (21:28 -0800)]
Add an Offset field to the SourceLocation for LookupResult objects.
Summary:
The Offset provides the offset within the function in a SourceLocation struct. This allows us to show the byte offset within a function. We also track offsets within inline functions as well. Updated the lookup tests to verify the offset for functions and inline functions.
0x1000: main + 32 @ /tmp/main.cpp:45
Reviewers: labath, aadsm, serhiy.redko, jankratochvil, xiaobai, wallace, aprantl, JDevlieghere
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74680
Dan Liew [Tue, 18 Feb 2020 23:43:25 +0000 (15:43 -0800)]
Add a `%darwin_min_target_with_tls_support` lit substitution.
Summary:
This substitution expands to the appropriate minimum deployment target
flag where thread local storage (TLS) was first introduced on Darwin
platforms. For all other platforms the substitution expands to an empty
string.
E.g. for macOS the substitution expands to `-mmacosx-version-min=10.12`
This patch adds support for the substitution (and future substitutions)
by doing a minor refactor and then uses the substitution in the relevant
TSan tests.
rdar://problem/
59568956
Reviewers: yln, kubamracek, dvyukov, vitalybuka
Subscribers: #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D74802
Nathan James [Wed, 19 Feb 2020 23:19:09 +0000 (23:19 +0000)]
[NFC] Fix issues with clang-tidy checks list.rst
Added FixItHint comments to ReservedIdentifierCheck and IdentifierNamingCheck to trick the python scripts into detecting a fix it is provided as it can't see the FixItHints in RenamerClangTidyCheck.cpp
Thomas Lively [Wed, 19 Feb 2020 23:01:47 +0000 (15:01 -0800)]
[WebAssembly] Fix memory bug introduced in
52861809994c
Summary:
The instruction at `DefI` can sometimes be destroyed by
`rematerializeCheapDef`, so it should not be used after calling that
function. The fix is to use `Insert` instead when examining additional
multivalue stackifications. `Insert` is the address of the new
defining instruction after all moves and rematerializations have taken
place.
Reviewers: aheejin
Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74875
Alexander Lanin [Wed, 19 Feb 2020 22:58:54 +0000 (22:58 +0000)]
[clang-tidy] fix readability-redundant-member-init auto-fix of Function-try-block
Summary: This fixes https://bugs.llvm.org/show_bug.cgi?id=39310
Reviewers: malcolm.parsons, ioeric
Reviewed By: malcolm.parsons
Subscribers: xazax.hun
Tags: #clang-format, #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D74800
LLVM GN Syncbot [Wed, 19 Feb 2020 22:58:29 +0000 (22:58 +0000)]
[gn build] Port
85fb997659b
Lang Hames [Wed, 19 Feb 2020 22:57:04 +0000 (14:57 -0800)]
[JITLink] Fix testcase for main JITDylib rename in
85fb997659b.
Matt Arsenault [Mon, 17 Feb 2020 23:16:59 +0000 (18:16 -0500)]
AMDGPU: Enable integer division bypass
We probably want this, and I've meant to turn this on for a long
time. SC actually emits a special case to early-out for a 1
denominator, which perhaps should also be considered.
Yaxun (Sam) Liu [Wed, 19 Feb 2020 00:34:15 +0000 (19:34 -0500)]
Add cl_khr_mipmap_image_writes as supported to AMDGPU
Differential Revision: https://reviews.llvm.org/D74807
Matt Arsenault [Tue, 18 Feb 2020 13:53:44 +0000 (08:53 -0500)]
AMDGPU/GlobalISel: Remove outdated comment
Matt Arsenault [Wed, 19 Feb 2020 20:03:15 +0000 (15:03 -0500)]
AMDGPU/GlobalISel: Cleanup min/max RegBankSelect tests
Use common check prefix, although update_mir_test_checks makes this
unnecessarily annoying. Also make sure to have uses in case that ever
ends up mattering.
Lang Hames [Wed, 19 Feb 2020 22:27:31 +0000 (14:27 -0800)]
[ORC] Fix a missing move.
Lang Hames [Wed, 19 Feb 2020 22:25:38 +0000 (14:25 -0800)]
[ORC] Qualify nullptr_t.
David Goldman [Wed, 19 Feb 2020 22:12:12 +0000 (17:12 -0500)]
Another fix for
7d91633a2b9b1f563dc14c632cc0c461c3651f76
Forgot to update lines for RUNs
Martijn Vels [Thu, 30 Jan 2020 21:02:22 +0000 (16:02 -0500)]
Add benchmarks for basic_string::erase
Reviewers: EricWF
Subscribers: christof, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D73740
Cristian Adam [Wed, 19 Feb 2020 21:42:31 +0000 (23:42 +0200)]
libclang: Add static build support for Windows
Differential Revision: https://reviews.llvm.org/D74564
Lang Hames [Mon, 16 Dec 2019 10:50:40 +0000 (02:50 -0800)]
[ORC] Add generic initializer/deinitializer support.
Initializers and deinitializers are used to implement C++ static constructors
and destructors, runtime registration for some languages (e.g. with the
Objective-C runtime for Objective-C/C++ code) and other tasks that would
typically be performed when a shared-object/dylib is loaded or unloaded by a
statically compiled program.
MCJIT and ORC have historically provided limited support for discovering and
running initializers/deinitializers by scanning the llvm.global_ctors and
llvm.global_dtors variables and recording the functions to be run. This approach
suffers from several drawbacks: (1) It only works for IR inputs, not for object
files (including cached JIT'd objects). (2) It only works for initializers
described by llvm.global_ctors and llvm.global_dtors, however not all
initializers are described in this way (Objective-C, for example, describes
initializers via specially named metadata sections). (3) To make the
initializer/deinitializer functions described by llvm.global_ctors and
llvm.global_dtors searchable they must be promoted to extern linkage, polluting
the JIT symbol table (extra care must be taken to ensure this promotion does
not result in symbol name clashes).
This patch introduces several interdependent changes to ORCv2 to support the
construction of new initialization schemes, and includes an implementation of a
backwards-compatible llvm.global_ctor/llvm.global_dtor scanning scheme, and a
MachO specific scheme that handles Objective-C runtime registration (if the
Objective-C runtime is available) enabling execution of LLVM IR compiled from
Objective-C and Swift.
The major changes included in this patch are:
(1) The MaterializationUnit and MaterializationResponsibility classes are
extended to describe an optional "initializer" symbol for the module (see the
getInitializerSymbol method on each class). The presence or absence of this
symbol indicates whether the module contains any initializers or
deinitializers. The initializer symbol otherwise behaves like any other:
searching for it triggers materialization.
(2) A new Platform interface is introduced in llvm/ExecutionEngine/Orc/Core.h
which provides the following callback interface:
- Error setupJITDylib(JITDylib &JD): Can be used to install standard symbols
in JITDylibs upon creation. E.g. __dso_handle.
- Error notifyAdding(JITDylib &JD, const MaterializationUnit &MU): Generally
used to record initializer symbols.
- Error notifyRemoving(JITDylib &JD, VModuleKey K): Used to notify a platform
that a module is being removed.
Platform implementations can use these callbacks to track outstanding
initializers and implement a platform-specific approach for executing them. For
example, the MachOPlatform installs a plugin in the JIT linker to scan for both
__mod_inits sections (for C++ static constructors) and ObjC metadata sections.
If discovered, these are processed in the usual platform order: Objective-C
registration is carried out first, then static initializers are executed,
ensuring that calls to Objective-C from static initializers will be safe.
This patch updates LLJIT to use the new scheme for initialization. Two
LLJIT::PlatformSupport classes are implemented: A GenericIR platform and a MachO
platform. The GenericIR platform implements a modified version of the previous
llvm.global-ctor scraping scheme to provide support for Windows and
Linux. LLJIT's MachO platform uses the MachOPlatform class to provide MachO
specific initialization as described above.
Reviewers: sgraenitz, dblaikie
Subscribers: mgorny, hiraditya, mgrang, ributzka, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74300
David Goldman [Wed, 19 Feb 2020 21:58:22 +0000 (16:58 -0500)]
Fix broken test on Windows caused by D74790
Rafael Ávila de Espíndola [Wed, 19 Feb 2020 21:19:58 +0000 (13:19 -0800)]
[lld][ELF] Add --shuffle-sections=seed to shuffle input sections
Summary:
This option causes lld to shuffle sections by assigning different
priorities in each run.
The use case for this is to introduce randomization in benchmarks. The
idea is inspired by the paper "Producing Wrong Data Without Doing
Anything Obviously Wrong!"
(https://www.inf.usi.ch/faculty/hauswirth/publications/asplos09.pdf). Unlike
the paper, we shuffle individual sections, not just input files.
Doing this in lld is particularly convenient as the --reproduce option
makes it easy to collect all the necessary bits for relinking the
program being benchmarked. Once that it is done, all that is needed is
to add --shuffle-sections=0 to the response file and relink before each
run of the benchmark.
Differential Revision: https://reviews.llvm.org/D74791
Stanislav Mekhanoshin [Wed, 19 Feb 2020 21:25:37 +0000 (13:25 -0800)]
[AMDGPU] Fix DS_WRITE_B32 patterns
It uses VGPR_32.RegTypes which includes 16 bit types. As a
result DS_WRITE_B32 may be generated for "store i16" which
is a bug. The only reason we do not hit it now is relative
patterns complexity and sorting. Should DS_WRITE_B16 pattern
complexity become higher and the bug appears.
Differential Revision: https://reviews.llvm.org/D74868
Dan Liew [Wed, 19 Feb 2020 21:23:26 +0000 (13:23 -0800)]
[TSan] Fix incorrect expansion of `%deflake` lit substitution.
dadc214e4d9d09a8a7a9f15780c1201c18f93e05 introduced a change to
`%deflake` to support a configurable threshold but the patch forgot
to add a trailing space.
Louis Dionne [Wed, 19 Feb 2020 21:09:41 +0000 (16:09 -0500)]
[libc++] reduce <complex> parsing time
Instead of including <ios> for ios_base::failbit, simply get failbit
member of the template argument. Print directly to a stream instead
of using intermediate ostringstream.
Parsing time: 874ms -> 164ms (-81%)
Thanks to Nikita Kniazev for the patch!
Differential Revision: https://reviews.llvm.org/D71214
Louis Dionne [Wed, 19 Feb 2020 20:56:15 +0000 (15:56 -0500)]
[libc++] Fixes backreferences for extended grammar.
The regex backreferences were not properly parsed and used when using
the extended grammar. This change parses them. The issue was found while
working on PR34297.
Thanks to Mark de Wever for the patch!
Differential Revision: https://reviews.llvm.org/D62451
Tony [Thu, 13 Feb 2020 06:19:25 +0000 (01:19 -0500)]
[AMDGPU] AMDGPUUsage define call convention ABI
Reviewers: scott.linder, arsenm, b-sumner
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74861
Michael Kruse [Wed, 19 Feb 2020 20:20:55 +0000 (14:20 -0600)]
[IndVarSimply] Fix assert/release build difference.
In builds with assertions enabled (!NDEBUG), IndVarSimplify does an
additional query to ScalarEvolution which may change future SCEV queries
since it fills the internal cache differently. The result is actually
only used with the -verify-indvars command line option. We fix the issue
by only calling SE->getBackedgeTakenCount(L) if -verify-indvars is
enabled such that only -verify-indvars shows the behavior, but not debug
builds themselves. Also add a remark to the description of
-verify-indvars about this behavior.
Fixes llvm.org/PR44815
Differential Revision: https://reviews.llvm.org/D74810
Tony [Wed, 19 Feb 2020 04:02:02 +0000 (23:02 -0500)]
[AMDGPU] Update AMDGPUUsage with DWARF proposal
Summary:
- Add AMDGPU DWARF proposal.
- Add references for gfx10 ISA and SemVer.
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, aprantl, dstuttard, tpr, jfb, dmgreen, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70523
Sanjay Patel [Tue, 18 Feb 2020 22:02:50 +0000 (17:02 -0500)]
[x86] add test for uint->fp with unsafe-fp-math (PR43609); NFC
Krzysztof Parzyszek [Fri, 7 Feb 2020 15:33:18 +0000 (09:33 -0600)]
[Hexagon] Change HVX vector predicate types from v512/1024i1 to v64/128i1
This commit removes the artificial types <512 x i1> and <1024 x i1>
from HVX intrinsics, and makes v512i1 and v1024i1 no longer legal on
Hexagon.
It may cause existing bitcode files to become invalid.
* Converting between vector predicates and vector registers must be
done explicitly via vandvrt/vandqrt instructions (their intrinsics),
i.e. (for 64-byte mode):
%Q = call <64 x i1> @llvm.hexagon.V6.vandvrt(<16 x i32> %V, i32 -1)
%V = call <16 x i32> @llvm.hexagon.V6.vandqrt(<64 x i1> %Q, i32 -1)
The conversion intrinsics are:
declare <64 x i1> @llvm.hexagon.V6.vandvrt(<16 x i32>, i32)
declare <128 x i1> @llvm.hexagon.V6.vandvrt.128B(<32 x i32>, i32)
declare <16 x i32> @llvm.hexagon.V6.vandqrt(<64 x i1>, i32)
declare <32 x i32> @llvm.hexagon.V6.vandqrt.128B(<128 x i1>, i32)
They are all pure.
* Vector predicate values cannot be loaded/stored directly. This directly
reflects the architecture restriction. Loading and storing or vector
predicates must be done indirectly via vector registers and explicit
conversions via vandvrt/vandqrt instructions.
Fady Ghanim [Wed, 19 Feb 2020 19:50:26 +0000 (13:50 -0600)]
[OpenMP][OMPIRBuilder] Introducing the `OMPBuilderCBHelpers` helper class
This patch introduces a new helper class `OMPBuilderCBHelpers`,
which will contain all reusable C/C++ language specific function-
alities required by the `OMPIRBuilder`.
Initially, this helper class contains the body and finalization
codegen functionalities implemented using callbacks which were
moved here for reusability among the different directives
implemented in the `OMPIRBuilder`, along with RAIIs for preserving
state prior to emitting outlined and/or inlined OpenMP regions.
In the future this helper class will also contain all the different
call backs required by OpenMP clauses/variable privatization.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D74562