Commit Graph

332973 Commits

Author SHA1 Message Date
Sam McCall 93f77617ab Revert "[clangd] repair mac tests for 88bccded8fa1"
Revert "[clangd] Try harder to find a plausible `clang` as argv0, particularly on Mac."
2019-12-02 22:13:29 +01:00
Francis Visoiu Mistrih 7902d6cc80 [Remarks][ThinLTO] Use the correct file extension based on the format
Since we now have multiple formats, the ThinLTO remark files should also
respect that.
2019-12-02 13:04:43 -08:00
Jonas Devlieghere 8f2c100f6f [lldb/CMake] Add in_call_stack to the utilities package
A subset of the examples are shipped as python packages. Include the
in_call_stack utility.
2019-12-02 13:03:24 -08:00
Jonas Devlieghere e5290a06d6 [lldb/CMake] Simplify logic for adding example Python packages (NFC)
This simplifies the CMake logic for adding the Python examples to the
Python package. It unifies the use of create_python_package by adding
the NOINIT option and removes the `target` argument, which is always
`finish_swig`.
2019-12-02 13:03:24 -08:00
Sam McCall 82039cbc8d [clangd] repair mac tests for 88bccded8f 2019-12-02 21:55:54 +01:00
Florian Hahn 5154b0253d [MIBundles] Move analyzePhysReg out of MIBundleOperands iterator (NFC).
analyzePhysReg does not really fit into the iterator and moving it
makes it easier to change the base iterator.

Reviewers: evandro, t.p.northover, paquette, MatzeB, arsenm, qcolombet

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D70559
2019-12-02 20:47:08 +00:00
Martin Storsjö 7d019d1a3b [LLDB] Set the right address size on output DataExtractors from ObjectFile
If filling in a DataExtractor from an ObjectFile, e.g. via the
ReadSectionData method, the output DataExtractor gets the address
size from the m_data member.

ObjectFile's m_data member is initialized without knowledge about
the address size (so the address size is set based on the host's
sizeof(void*), and at that point within ObjectFile's constructor,
virtual methods implemented in subclasses (like GetAddressByteSize())
can't be called, therefore fix it up when filling in external
DataExtractors.

This makes sure that line tables from executables with a different
address size are parsed properly; previously this tripped up
DWARFDebugLine::LineTable::parse for 32 bit executables on a 64 bit
host, as the address size in the line table (4) didn't match the
one set in the DWARFDataExtractor.

Differential Revision: https://reviews.llvm.org/D70848
2019-12-02 22:42:00 +02:00
António Afonso afd5d91281 [lldb] Fix TestFormattersSBAPI test
Summary:
This test was broken in two ways:
* Using the wrong API (e.g.: format = instead of SetFormat)
* The hex checker was only checking "01" which will pass with 0x0000001

Reviewers: clayborg, lanza, wallace

Reviewed By: clayborg

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D70884
2019-12-02 12:24:11 -08:00
Volkan Keles 3d02fa6da7 [GlobalISel] CombinerHelper: Fix a bug in matchCombineCopy
Summary:
When combining COPY instructions, we were replacing the destination registers
with the source register without checking register constraints. This patch adds
a simple logic to check if the constraints match before replacing registers.

Reviewers: qcolombet, aditya_nandakumar, aemerson, paquette, dsanders, Petar.Avramovic

Reviewed By: aditya_nandakumar

Subscribers: rovka, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70616
2019-12-02 12:05:09 -08:00
David Green 469ee617a0 [ARM] Add ARMVCCThen to tablegen and make use of it. NFC
Similar to the parent, this adds some constants to tablegen to replace
the existing magic values.

Differential Revision: https://reviews.llvm.org/D70825
2019-12-02 19:57:12 +00:00
David Green a223a4d66f [ARM] Add ARMCC constants to tablegen. NFC
I got tired of looking at magic constants in tablegen files. This adds
condition codes like ARMCCeq and makes use of them.

I also removed the extra patterns for reverse condition codes from
D70296, they should now be covered by the parent commit.

Differential Revision: https://reviews.llvm.org/D70824
2019-12-02 19:57:12 +00:00
David Green 57d96ab593 [ARM] Add some VCMP folding and canonicalisation
The VCMP instructions in MVE can accept a register or ZR, but only as
the right hand operator. Most of the time this will already be correct
because the icmp will have been canonicalised that way already. There
are some cases in the lowering of float conditions that this will not
apply to though. This code should fix up those cases.

Differential Revision: https://reviews.llvm.org/D70822
2019-12-02 19:57:12 +00:00
David Green 63aff5cd3c [ARM] More reversed vcmp tests. NFC 2019-12-02 19:57:12 +00:00
Florian Hahn 5d0625664b [MIBundles] Move analyzeVirtReg out of MIBundleOperands iterator (NFC).
analyzeVirtReg does not really fit into the iterator and moving it
makes it easier to change the base iterator.

Reviewers: evandro, t.p.northover, paquette, MatzeB, arsenm, qcolombet

Reviewed By: qcolombet

Differential Revision: https://reviews.llvm.org/D70558
2019-12-02 19:50:33 +00:00
Dan Gohman 8f1e2151b8 [WebAssembly] Find wasm-opt with GetProgramPath
Instead of just searching for wasm-opt in PATH, use GetProgramPath, which
checks the `COMPILER_PATH` environment variable, -B paths, and `PATH`.

Differential Revision: https://reviews.llvm.org/D70780
2019-12-02 11:48:36 -08:00
David Green 1d4587346f [AArch64] Attempt to fixup test line. NFC
The test is complaining on some of the builders. This attempts to
adjust the run line to be more line the others in the same folder, using
clang_cc1 as opposed to the driver.
2019-12-02 19:30:54 +00:00
Alexey Bataev f17a1d8b28 [OPENMP]Use cast instead dyn_cast, NFC.
Here the expression is always a DeclRefExpr, no need to use dyn_cast.
2019-12-02 14:16:52 -05:00
Alexey Bataev 478541a6da [OPENMP]Fix PR44133: Emit definitions of used constructors/functions.
Need to fully rebuild the initializer/combiner when instatiating the
declare reduction constrcut to properly emit used functions.
2019-12-02 14:07:29 -05:00
Tyker 9ec6d71211 [clang][modules] Add support for merging lifetime-extended temporaries
Summary: Add support for merging lifetime-extended temporaries

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: xbolva00, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D70190
2019-12-02 19:55:13 +01:00
Taewook Oh 2da205d43e Reland "b19ec1eb3d0c [BPI] Improve unreachable/ColdCall heurstics to handle loops."
Summary: b19ec1eb3d has been reverted because of the test failures
with PowerPC targets. This patch addresses the issues from the previous
commit.

Test Plan: ninja check-all. Confirmed that CodeGen/PowerPC/pr36292.ll
and CodeGen/PowerPC/sms-cpy-1.ll pass

Subscribers: llvm-commits
2019-12-02 10:28:40 -08:00
Florian Hahn fe459ce65a [VPlan] Move graph traits (NFC).
By defining the graph traits right after the VPBlockBase definitions, we
can make use of them earlier in the file.

Reviewers: hsaito, Ayal, gilr

Reviewed By: gilr

Differential Revision: https://reviews.llvm.org/D70733
2019-12-02 18:23:11 +00:00
Alex Richardson 3b55eebd23 [update_cc_test_checks.py] Use CHECK_RE from common
Summary:
This change modifies the common.CHECK_RE regex to also handle '//'
comment prefixes which allows us to share it between clang and IR tests.
Using the regex from common means that *-SAME lines are also stripped
now. Before this change using the --function-signature flag would result
in -SAME: lines from previous runs not being removed.

Reviewers: MaskRay, jdoerfert

Reviewed By: jdoerfert

Subscribers: jdoerfert, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70890
2019-12-02 18:18:47 +00:00
Julian Lettner 62ab949248 [lit] Be more explicit about the state of tests
Tests go through the following stages:
  *) discovered
  *) filtered
  *) executed

Only executed tests have a result (e.g., PASS, FAIL, XFAIL, etc.).  See
"result codes" in Test.py.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D70612
2019-12-02 10:16:54 -08:00
Amaury Séchet c594d14d40 [DAGCombine] Factor oplist operations. NFC 2019-12-02 19:12:03 +01:00
Fangrui Song bf535ac4a2 [ELF][AArch64] Support R_AARCH64_{CALL26,JUMP26} range extension thunks with addends
Fixes AArch64 part of PR40438

The current range extension thunk framework does not handle a relocation
relative to a STT_SECTION symbol with a non-zero addend, which may be
used by jumps/calls to local functions on some RELA targets (AArch64,
powerpc ELFv1, powerpc64 ELFv2, etc).  See PR40438 and the following
code for examples:

  // clang -target $target a.cc
  // .text.cold may be placed in a separate output section.
  // The distance between bar in .text.cold and foo in .text may be larger than 128MiB.
  static void foo() {}
  __attribute__((section(".text.cold"))) static int bar() { foo(); return
  0; }
  __attribute__((used)) static int dummy = bar();

This patch makes such thunks with addends work for AArch64. The target
independent part can be reused by PPC in the future.

On REL targets (ARM, MIPS), jumps/calls are not represented as
STT_SECTION + non-zero addend (see
MCELFObjectTargetWriter::needsRelocateWithSymbol), so they don't need
this feature, but we need to make sure this patch does not affect them.

Reviewed By: peter.smith

Differential Revision: https://reviews.llvm.org/D70637
2019-12-02 10:07:24 -08:00
Sanjay Patel af4e59949c [InstCombine] fix undef propagation for vector urem transform (PR44186)
As described here:
https://bugs.llvm.org/show_bug.cgi?id=44186

The match() code safely allows undef values, but we can't safely
propagate a vector constant that contains an undef to the new
compare instruction.
2019-12-02 12:17:38 -05:00
Amaury Séchet d8d5106225 [SelectionDAG] Reduce assumptions made about levels. NFC 2019-12-02 17:43:13 +01:00
stevewan 3ebfab7095 Add AIX assembler support
Summary:
A skeleton of AIX toolchain and system linker support has been introduced in D68340, and this is a follow on patch to it.
This patch adds support to system assembler invocation to the AIX toolchain.

Reviewers: daltenty, hubert.reinterpretcast, jasonliu, Xiangling_L, dlj

Reviewed By: daltenty, hubert.reinterpretcast

Subscribers: wuzish, nemanjai, kbarton, jfb, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D69620
2019-12-02 11:29:36 -05:00
Simon Tatham d173fb5d28 [ARM,MVE] Add intrinsics to deal with predicates.
Summary:
This commit adds the `vpselq` intrinsics which take an MVE predicate
word and select lanes from two vectors; the `vctp` intrinsics which
create a tail predicate word suitable for processing the first m
elements of a vector (e.g. in the last iteration of a loop); and
`vpnot`, which simply complements a predicate word and is just
syntactic sugar for the `~` operator.

The `vctp` ACLE intrinsics are lowered to the IR intrinsics we've
already added (and which D70592 just reorganized). I've filled in the
missing isel rule for VCTP64, and added another set of rules to
generate the predicated forms.

I needed one small tweak in MveEmitter to allow the `unpromoted` type
modifier to apply to predicates as well as integers, so that `vpnot`
doesn't pointlessly convert its input integer to an `<n x i1>` before
complementing it.

Reviewers: ostannard, MarkMurrayARM, dmgreen

Reviewed By: dmgreen

Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D70485
2019-12-02 16:20:30 +00:00
Simon Tatham 48cce077ef [ARM,MVE] Rename and clean up VCTP IR intrinsics.
Summary:
D65884 added a set of Arm IR intrinsics for the MVE VCTP instruction,
to use in tail predication. But the 64-bit one doesn't work properly:
its predicate type is `<2 x i1>` / `v2i1`, which isn't a legal MVE
type (due to not having a full set of instructions that manipulate it
usefully). The test of `vctp64` in `basic-tail-pred.ll` goes through
`opt` fine, as the test expects, but if you then feed it to `llc` it
causes a type legality failure at isel time.

The usual workaround we've been using in the rest of the MVE
intrinsics family is to bodge `v2i1` into `v4i1`. So I've adjusted the
`vctp64` IR intrinsic to do that, and completely removed the code (and
test) that uses that intrinsic for 64-bit tail predication. That will
allow me to add isel rules (upcoming in D70485) that actually generate
the VCTP64 instruction.

Also renamed all four of these IR intrinsics so that they have `mve`
in the name, since its absence was confusing.

Reviewers: ostannard, MarkMurrayARM, dmgreen

Reviewed By: MarkMurrayARM

Subscribers: samparker, kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70592
2019-12-02 16:20:30 +00:00
Simon Tatham 01aefae4a1 [ARM,MVE] Add an InstCombine rule permitting VPNOT.
Summary:
If a user writing C code using the ACLE MVE intrinsics generates a
predicate and then complements it, then the resulting IR will use the
`pred_v2i` IR intrinsic to turn some `<n x i1>` vector into a 16-bit
integer; complement that integer; and convert back. This will generate
machine code that moves the predicate out of the `P0` register,
complements it in an integer GPR, and moves it back in again.

This InstCombine rule replaces `i2v(~v2i(x))` with a direct complement
of the original predicate vector, which we can already instruction-
select as the VPNOT instruction which complements P0 in place.

Reviewers: ostannard, MarkMurrayARM, dmgreen

Reviewed By: dmgreen

Subscribers: kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70484
2019-12-02 16:20:30 +00:00
Florian Hahn effcdc3a82 Add contributing info to CONTRIBUTING.md and README.md
As discussed on llvm-dev [1], this patch adds a brief CONTRIBUTING.md to
the top-level of the repo, with a pointer to Contributing.html. This
should make it easier to discover the contributing information and also
be highlighted in the Github UI.

It also updates README.md to link to Contributing.html.

[1] http://lists.llvm.org/pipermail/llvm-dev/2019-November/137141.html

Reviewers: tonic, rnk, jhenderson, meikeb

Reviewed By: rnk, jhenderson, meikeb

Differential Revision: https://reviews.llvm.org/D70743
2019-12-02 15:47:15 +00:00
Florian Hahn aca7aab90d [PatternMatch] Add support for matching intrinsics with 5 operands.
Summary: Also adds a test to the pattern matching unit tests.

Reviewers: spatel, craig.topper, RKSimon, majnemer, lebedev.ri

Reviewed By: spatel

Subscribers: merge_guards_bot, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70892
2019-12-02 15:38:22 +00:00
Hideto Ueno 96552036e3 [Attributor] Copy or port test cases related to Attributor to` Attributor` test folder
Summary:
This patch moves the test cases related to Attributor to `Transforms/Attributor` folder.
We have used `Transforms/FunctionAttrs` as the primary folder for Attributor test but we need to change testing way now.

For the test cases which I think functionattrs doesn't infer anything something like (willreturn, nosync, value-simplify, h2s ..etc), I moved them with the command `git mv`.

For the test cases in which functoinattrs and attributor are tested, I copied the test to the folder and remove the check only used by functoinattrs.

Reviewers: jdoerfert, sstefan1

Reviewed By: jdoerfert

Subscribers: jfb, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70843
2019-12-02 15:36:29 +00:00
Roman Lebedev ec7436f299
Autogenerate test/Analysis/ValueTracking/non-negative-phi-bits.ll test
Forgot to stage this change into 0f22e783a0 commit.
2019-12-02 18:28:41 +03:00
Sam McCall 88bccded8f [clangd] Try harder to find a plausible `clang` as argv0, particularly on Mac.
Summary:
Fixes https://github.com/clangd/clangd/issues/211
Fixes https://github.com/clangd/clangd/issues/178

No tests - this is hard to test, and basically impossible to verify what we want
(this produces compile commands that work on a real mac with recent toolchain)

(Need someone on mac to verify it actually fixes these!)

Reviewers: kbobyrev, ilya-biryukov

Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D70863
2019-12-02 16:17:40 +01:00
Clement Courbet 3540b80fe4 [llvm-exegesis] Fix 44b9942898.
Summary:
Add missing stack release instructions in
loadImplicitRegAndFinalize.

Reviewers: pengfei, gchatelet

Subscribers: tschuett, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70903
2019-12-02 16:13:27 +01:00
Roman Lebedev 0f22e783a0
[InstCombine] Revert rL341831: relax one-use check in foldICmpAddConstant() (PR44100)
rL341831 moved one-use check higher up, restricting a few folds
that produced a single instruction from two instructions to the case
where the inner instruction would go away.

Original commit message:
> InstCombine: move hasOneUse check to the top of foldICmpAddConstant
>
> There were two combines not covered by the check before now,
> neither of which actually differed from normal in the benefit analysis.
>
> The most recent seems to be because it was just added at the top of the
> function (naturally). The older is from way back in 2008 (r46687)
> when we just didn't put those checks in so routinely, and has been
> diligently maintained since.

From the commit message alone, there doesn't seem to be a
deeper motivation, deeper problem that was trying to solve,
other than 'fixing the wrong one-use check'.

As i have briefly discusses in IRC with Tim, the original motivation
can no longer be recovered, too much time has passed.

However i believe that the original fold was doing the right thing,
we should be performing such a transformation even if the inner `add`
will not go away - that will still unchain the comparison from `add`,
it will no longer need to wait for `add` to compute.

Doing so doesn't seem to break any particular idioms,
as least as far as i can see.

References https://bugs.llvm.org/show_bug.cgi?id=44100
2019-12-02 18:06:15 +03:00
Nemanja Ivanovic 241cbf201a [PowerPC] Fix crash in peephole optimization
When converting reg+reg shifts to reg+imm rotates, we neglect to consider the
CodeGenOnly versions of the 32-bit shift mnemonics. This means we produce a
rotate with missing operands which causes a crash.

Committing this fix without review since it is non-controversial that the list
of mnemonics to consider should include the 64-bit aliases for the exact
mnemonics.

Fixes PR44183.
2019-12-02 08:56:04 -06:00
Victor Campos dcf11c5e86 [ARM][AArch64] Complex addition Neon intrinsics for Armv8.3-A
Summary:
Add support for vcadd_* family of intrinsics. This set of intrinsics is
available in Armv8.3-A.

The fp16 versions require the FP16 extension, which has been available
(opt-in) since Armv8.2-A.

Reviewers: t.p.northover

Reviewed By: t.p.northover

Subscribers: t.p.northover, kristof.beyls, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D70862
2019-12-02 14:38:39 +00:00
Sanjay Patel af0babc90a [InstCombine] fold copysign with constant sign argument to (fneg+)fabs
If the sign of the sign argument is known (this could be extended to use ValueTracking),
then we can use fneg+fabs to clear/set the sign bit of the magnitude argument.
http://llvm.org/docs/LangRef.html#llvm-copysign-intrinsic

This transform is already done in DAGCombiner, but we can do it sooner in IR as
suggested in PR44153:
https://bugs.llvm.org/show_bug.cgi?id=44153

We have effectively no analysis for copysign in IR, so we are taking the unusual step
of increasing the number of IR instructions for the negative constant case.

Differential Revision: https://reviews.llvm.org/D70792
2019-12-02 09:23:12 -05:00
Sven van Haastregt 6236496561 [OpenCL] Fix address space for implicit conversion (PR43145)
Clang was creating a DerivedToBase ImplicitCastExpr that was also
casting between address spaces as part of the second step in the
standard conversion sequence.  Defer the address space conversion to
the third step in the sequence instead, such that we get a separate
ImplicitCastExpr for the address space conversion.

Differential Revision: https://reviews.llvm.org/D70605
2019-12-02 14:20:15 +00:00
Raphael Isemann d62026e2dd [lldb][NFC] Don't calculate member indices in DWARFASTParserClang::ParseChildMembers
We keep counting members and then don't do anything with the computed result.
2019-12-02 14:43:40 +01:00
Raphael Isemann 4f728bfc13 [lldb][NFC] Use raw_ostream instead of Stream in Baton::GetDescription
Removing raw_ostream here is getting us closer to removing LLDB's Stream
class.
2019-12-02 13:27:21 +01:00
Wang, Pengfei 76b70f6f75 [X86] Add initialization of FPCW in llvm-exegesis
Summary: This is a following up to D70874. It adds the initialization of FPCW in llvm-exegesis.

Reviewers: craig.topper, RKSimon, courbet, gchatelet

Subscribers: tschuett, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70891
2019-12-02 20:18:35 +08:00
Georgii Rymar e19f19b09f [llvm-readobj/llvm-readelf] - Simplify the code that dumps versions.
After changes introduced in D70495 and D70826 its now possible
to significantly simplify the code we have.

This also fixes an issue: previous code assumed that version strings
should always be read from the dynamic string table. While it is
normally true, the string table should be taken from the corresponding
sh_link field.

Differential revision: https://reviews.llvm.org/D70855
2019-12-02 15:14:30 +03:00
Tim Renouf 3d5ba7c60f AMDGPU: Fixed indeterminate map iteration in SIPeepholeSDWA
Differential Revision: https://reviews.llvm.org/D70783

Change-Id: Ic26f915a4acb4c00ecefa9d09d7c24cec370ed06
2019-12-02 12:08:49 +00:00
Raphael Isemann f8fb3729e9 [lldb][NFC] Make Stream's IndentLevel an unsigned integers.
We expect it to be always positive values and LLVM/Clang's IndentLevel
values are already unsigned integers, so we should do the same.
2019-12-02 13:01:26 +01:00
Mark Murray 510792a2e0 [ARM][MVE][Intrinsics] Add VMINQ/VMAXQ/VMINNMQ/VMAXNMQ intrinsics.
Summary: Add VMINQ/VMAXQ/VMINNMQ/VMAXNMQ intrinsics and their predicated versions. Add unit tests.

Subscribers: kristof.beyls, hiraditya, dmgreen, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D70829
2019-12-02 11:18:53 +00:00
Alex Richardson 8ab3b4defd [update_cc_test_checks.py] Handle extern "C" and namespaces
Summary:
My change to use the clang AST JSON dump did not handle functions declared
inside scopes other than the root TranslationUnitDecl. After this change
update_cc_test_checks.py also works for C++ test cases that use extern "C"
and namespaces.

Reviewers: MaskRay

Reviewed By: MaskRay

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70389
2019-12-02 11:06:31 +00:00