Commit Graph

199011 Commits

Author SHA1 Message Date
Guillaume Chatelet
71e4df2c3b [Alignment][NFC] Use Align for TargetCallingConv::OrigAlign
This patch replaces D69249.

This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Differential Revision: https://reviews.llvm.org/D82307
2020-06-25 13:21:22 +00:00
Florian Hahn
d5068f51ec [DSE,MSSA] Check if Def is removable only wen we try to remove it.
Non-removable MemoryDefs can still eliminate other defs. Update the
isRemovable checks to only candidates for removal.
2020-06-25 14:01:10 +01:00
David Green
6927c576ff [ARM] Split cast cost tests, and add masked load/store tests. NFC
This file has grown quite large and could do with being split up. This
splits away the load/store + cast tests into a separate file. Some
masked load/store + cast tests have been added too, along with some
extra load/store + fpcast tests.
2020-06-25 13:24:17 +01:00
Georgii Rymar
e7aef285a1 [llvm-readelf] - Report a warning instead of an error when dumping a broken section header.
There is no reason to report an error in `printSectionHeaders()`, we can report
a warning and continue dumping. This is what the patch does.

Differential revision: https://reviews.llvm.org/D82462
2020-06-25 14:38:06 +03:00
Tyker
e767fc4f7e [AssumeBundles] Use operand bundles to encode alignment assumptions
Summary:
NOTE: There is a mailing list discussion on this: http://lists.llvm.org/pipermail/llvm-dev/2019-December/137632.html

Complemantary to the assumption outliner prototype in D71692, this patch
shows how we could simplify the code emitted for an alignemnt
assumption. The generated code is smaller, less fragile, and it makes it
easier to recognize the additional use as a "assumption use".

As mentioned in D71692 and on the mailing list, we could adopt this
scheme, and similar schemes for other patterns, without adopting the
assumption outlining.

Reviewers: hfinkel, xbolva00, lebedev.ri, nikic, rjmccall, spatel, jdoerfert, sstefan1

Reviewed By: jdoerfert

Subscribers: yamauchi, kuter, fhahn, merge_guards_bot, hiraditya, bollu, rkruppe, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D71739
2020-06-25 12:59:44 +02:00
Tyker
b0ad27afc0 [NFC] update test to make diff of the following commit clear 2020-06-25 12:59:44 +02:00
Sam Tebbs
2aff9bba46 [ARM] Allow tail predication on sadd_sat and uadd_sat intrinsics
This patch stops the sadd_sat and uadd_sat intrinsics from blocking tail predication.

Differential revision: https://reviews.llvm.org/D82377
2020-06-25 11:54:29 +01:00
Simon Pilgrim
2c44c49003 FPEnv.h - reduce includes to forward declarations. NFC.
Ensure FPEnv.cpp includes FPEnv.h first to check for hidden dependencies.
2020-06-25 11:40:45 +01:00
Simon Pilgrim
c51eeee6b8 MachineScheduler.h - reduce AliasAnalysis.h include to forward declaration. NFC.
Replace legacy AliasAnalysis typedef with AAResults where necessary.
2020-06-25 11:40:44 +01:00
Guillaume Chatelet
ea4d44ea3b Use concrete natural type alignment for masked load/store operations instead of 0.
Summary: Alignment needs to be resolved at this point so we replace the
0 value with the ABI Type Alignment.
2020-06-25 09:19:12 +00:00
Djordje Todorovic
c0e9a51908 [docs][llvm-dwarfdump] Fix the warnings during docs-llvm-html buil
Before the fix the build of docs-llvm-html would fail.
The D80959 introduced options that are not recognized, so we have
warning as:

  llvm-project/llvm/docs/CommandGuide/llvm-dwarfdump.rst:40\
  :unknown option: --debug-info

Differential Revision: https://reviews.llvm.org/D82460
2020-06-25 11:04:28 +02:00
Djordje Todorovic
b1db73813a [docs][GlobalISel] Fix the warnings during docs-llvm-html build
Before the fix the build of docs-llvm-html would fail.
The rG8bc03d216824 introduced a reference to an undefined label,
so we have warning as:

  llvm-project/llvm/docs/GlobalISel/GenericOpcode.rst:295:\
  undefined label: i_intr_llvm_ptrmask (if the link has no\
  caption the label must precede a section header)
2020-06-25 10:53:39 +02:00
Shawn Landden
df770f665c [PowerPC] add popcount CodeGen test; NFC 2020-06-25 12:41:33 +04:00
Piotr Sobczak
b2cdcb043a [AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.

Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.

Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits

Tags: #llvm

Re-commit D81925 with a bugfix D82370.

Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-06-25 10:38:23 +02:00
Aleksandr Urakov
9a59a59244 [lldb][PDB] Constexpr static member values as AST literals
Summary:
When evaluating an expression referencing a constexpr static member variable, an
error is issued because the PDB does not specify a symbol with an address that
can be relocated against.

Rather than attempt to resolve the variable's value within the IR execution, the
values of all constants can be looked up and incorporated into the AST of the
record type as a literal, mirroring the original compiler AST.

This change applies to DIA and native PDB loaders.

Patch By: jackoalan

Reviewers: aleksandr.urakov, jasonmolenda, zturner, jdoerfert, teemperor

Reviewed By: aleksandr.urakov

Subscribers: sstefan1, lldb-commits, llvm-commits, #lldb

Tags: #lldb, #llvm

Differential Revision: https://reviews.llvm.org/D82160
2020-06-25 11:27:16 +03:00
David Sherwood
92662d71cb [SVE] Make ConstantFoldGetElementPtr work for scalable vectors of indices
This patch fixes a compiler crash that was hit when trying to simplify
the following code:

getelementptr [2 x i64], [2 x i64]* null, i64 0, <vscale x 2 x i64> zeroinitializer

For the case where we have a null pointer value like above, we just
need to ensure we don't assume the indices are always fixed width.

Differential Revision: https://reviews.llvm.org/D82183
2020-06-25 07:28:19 +01:00
Max Kazantsev
dde06ce03d [Test] Add more tests for selects & phis 2020-06-25 10:54:07 +07:00
Max Kazantsev
6f268d411a [InstCombine] Combine select & Phi by same condition
This patch transforms
```
p = phi [x, y]
s = select cond, z, p
```
with
```
s = phi[x, z]
```
if we can prove that the Phi node takes values basing on select's condition.

Differential Revision: https://reviews.llvm.org/D82072
Reviewed By: nikic
2020-06-25 10:44:10 +07:00
Craig Topper
a4615b0a89 [X86] Emit a reg-reg copy for fast isel of vector bitcasts.
Previously we just updated a map and moved on. But it possible
we cached known bits information with the vreg that can be used by
another basic block. If the other basic block has a different view
of the VT these known bits won't make sense.

By emitting a copy we ensure we have different vregs before and
after the bitcast. This prevents the known bits from being used
with the wrong type.

Differential Revision: https://reviews.llvm.org/D82517
2020-06-24 20:15:21 -07:00
Wang, Pengfei
a5dbdf7807 [X86] Fix a typo error.
Summary: This will result opcode MULX32Hrm been emitted to MULX32Hrr.

Reviewed by: craig.topper

Differential Revision: https://reviews.llvm.org/D82472
2020-06-25 10:06:27 +08:00
Pengfei Wang
3beff269e6 [X86][NFC] Pre-commit test case for the following patch. 2020-06-24 18:37:01 -07:00
Arthur Eubanks
4cd332044f [NewPM][opt] Assert PassPipeline and Passes don't both contain passes
Reviewers: asbirlea

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82512
2020-06-24 18:00:22 -07:00
Sid Manning
9e71156d6d [Hexagon][llvm-objcopy] Add missing check for SHN_HEXAGON_SCOMMON_1
Differential Revision: https://reviews.llvm.org/D82484
2020-06-24 19:56:01 -05:00
Michele Scandale
80fcca7787 [Inliner] Handle 'no-signed-zeros-fp-math' function attribute.
All other floating point math optimization related attribute are merged
in a conservative way during function inlining. This commit adds the
merge rule for the 'no-signed-zeros-fp-math' attribute.

Differential Revision: https://reviews.llvm.org/D81714
2020-06-24 17:53:59 -07:00
Amara Emerson
e913decb3a Don't inline dynamic allocas that simplify to huge static allocas.
Some sequences of optimizations can generate call sites which may never be
executed during runtime, and through constant propagation result in dynamic
allocas being converted to static allocas with very large allocation amounts.

The inliner tries to move these to the caller's entry block, resulting in the
stack limits being reached/bypassed. Avoid inlining functions if this would
result.

The threshold of 64k currently doesn't get triggered on the test suite with an
-Os LTO build on arm64, care should be taken in changing this in future to avoid
needlessly pessimising inlining behaviour.

Differential Revision: https://reviews.llvm.org/D81765
2020-06-24 17:39:03 -07:00
Xing GUO
cb10895c53 [DWARFYAML][debug_gnu_*] 'Descriptor' field should be 1-byte. NFC.
The 'Descriptor' field of .debug_gnu_pubnames and .debug_gnu_pubtypes
section should be 1-byte rather than 4-byte. This patch helps resolve
this issue.
2020-06-25 08:21:13 +08:00
Kirill Naumov
f6e5cbec4b [InlineCost] PrinterPass prints constants to which instructions are simplified
This patch enables printing of constants to see which instructions were
constant-folded. Needed for tests and better visiual analysis of
inliner's work.

Reviewers: apilipenko, mtrofin, davidxl, fedor.sergeev

Reviewed By: mtrofin

Differential Revision: https://reviews.llvm.org/D81024
2020-06-24 22:52:31 +00:00
Fangrui Song
b24b7c4c54 [llvm-profdata] --hot-func-list: fix some style issues in D81800
Reviewed By: wenlei, hoyFB

Differential Revision: https://reviews.llvm.org/D82500
2020-06-24 15:17:03 -07:00
Scott Linder
0dbcb0ca32 [MIR] Fix CFI_INSTRUCTION escape printing
Summary:
The printer seems to intend to not print the trailing comma but has a
copy-paste error for the last value in the escape, and the parser
enforces having no trailing comma, but somehow a test was never included
to actually confirm it.

Reviewers: thegameg, arsenm

Reviewed By: thegameg, arsenm

Subscribers: wdng, arsenm, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82478
2020-06-24 18:15:28 -04:00
LLVM GN Syncbot
1f4236d82d [gn build] Port 1e2691fe238 2020-06-24 22:11:22 +00:00
Roman Lebedev
a3b34b593f [NFCI][InstSimplify] Add CHECK-LABEL to new icmp.ll test 2020-06-25 01:10:35 +03:00
Roman Lebedev
7de805e824 [SROA] convertValue(): we can have <N x iK*> to <M x iQ> cast
Provided test case crashes otherwise.
Much like to the opposite case.
2020-06-25 00:58:54 +03:00
Roman Lebedev
5bd582e3b4 [SROA] convertValue(): we can have <N x iK> to <M x iQ*> cast
Provided test case crashes otherwise.

If NewTy is already DL.getIntPtrType(NewTy),
CreateBitCast() won't actually create any bitcast,
so we are better off just doing the general thing.
2020-06-25 00:58:53 +03:00
Roman Lebedev
59860824ed [IR] GetUnderlyingObject(), stripPointerCastsAndOffsets(): don't crash on bitcast <1 x i8*> to i8*
I'm not sure how to write standalone tests for each of two changes here.
If either one of these two fixes is missing, the test fill crash.
2020-06-25 00:58:53 +03:00
Roman Lebedev
0a9046a444 [InstCombine] visitBitCast(): do not crash on weird bitcast <1 x i8*> to i8*
Even if we know that RHS of a bitcast is a pointer,
we can't assume LHS is, because it might be
a single-element vector of pointer.
2020-06-25 00:58:53 +03:00
Roman Lebedev
1208cc1611 [NFCI] SCEV: promote ScalarEvolutionDivision into an publicly usable class
This makes it usable from outside of SCEV,
while previously it was internal to the ScalarEvolution.cpp

In particular, i want to use it in an WIP alloca promotion helper pass,
to analyze if some SCEV is a multiple of some other SCEV.
2020-06-25 00:58:53 +03:00
Guillaume Chatelet
c67d339083 Revert "Use concrete natural type alignment for masked load/store operations instead of 0."
This reverts commit 39819ccd36b6dd61c9decd29df64fd4e8a7ee9ad.
2020-06-24 21:53:34 +00:00
Yuanfang Chen
dbdc922af7 Remove Passes dependency on CodeGen
The dependency was introduced in
5134020ea62d1e1e125fdac48d251a26b80e9781. The only functional change
from this removal would be the new PM interface for the two codegen
passes. This is not necessary since we don't have codegen pipeline using
new PM yet. This removal is to break the potential circular dependency between
Passes and CodeGen once the codegen begins to gain new PM support.
2020-06-24 14:52:46 -07:00
Fangrui Song
f99e1eaaed [TextAPI/MachO] Fix style issues. NFC
See https://llvm.org/docs/CodingStandards.html#use-namespace-qualifiers-to-implement-previously-declared-functions
2020-06-24 14:43:45 -07:00
Guillaume Chatelet
ea70cf12c0 Use concrete natural type alignment for masked load/store operations instead of 0. 2020-06-24 21:42:05 +00:00
Mitch Phillips
5ab8005ee3 Revert "[BitcodeReader] Fix DelayedShuffle handling for ConstantExpr shuffles."
Patch has a memory leak bug that broke the ASan buildbots. More info
available at: https://reviews.llvm.org/D80330

This reverts commit b5740105d270a2d76da8812cafb63e4b799ada73.
2020-06-24 14:40:45 -07:00
Stefan Agner
a9ba91c009 [ARM] Make cp10 and cp11 usage a warning
The ARM ARM considers p10/p11 valid arguments for MCR/MRC instructions.
MRC instructions with p10 arguments are also used in kernel code which
is shared for different architectures. Turn usage of p10/p11 to warnings
for ARMv7/ARMv8-M.

Reviewers: rengolin, olista01, t.p.northover, efriedma, psmith, simon_tatham

Reviewed By: simon_tatham

Subscribers: hiraditya, danielkiss, jcai19, tpimh, nickdesaulniers, peter.smith, javed.absar, kristof.beyls, jdoerfert, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D59733
2020-06-24 23:37:54 +02:00
Kirill Naumov
6bb8eae995 [InlineCost] InlineCostAnnotationWriterPass introduced
This class allows to see the inliner's decisions for better
optimization verifications and tests. To use, use flag
"-passes="print<inline-cost>"".

This is the second attempt to integrate the patch.
The problem from the first try has been discussed and
fixed in D82205.

Reviewers: apilipenko, mtrofin, davidxl, fedor.sergeev

Reviewed By: mtrofin

Differential revision: https://reviews.llvm.org/D81743
2020-06-24 21:27:07 +00:00
Mehdi Amini
7c337c9c89 Add a git hook script that can be manually setup to run some checks on every push
Right now it just catches arcanist noisy tags, and include a script to
automatically clean these.

Follow up on http://lists.llvm.org/pipermail/llvm-dev/2019-December/137848.html

Differential Revision: https://reviews.llvm.org/D80978
2020-06-24 21:13:43 +00:00
Amy Kwan
25f513ca38 [PowerPC][Power10] Implement Count Leading/Trailing Zeroes Builtins under bit Mask in LLVM/Clang
This patch implements builtins for the following prototypes:

unsigned long long __builtin_cntlzdm (unsigned long long, unsigned long long)
unsigned long long __builtin_cnttzdm (unsigned long long, unsigned long long)
vector unsigned long long vec_cntlzm (vector unsigned long long, vector unsigned long long)
vector unsigned long long vec_cnttzm (vector unsigned long long, vector unsigned long long)

Differential Revision: https://reviews.llvm.org/D80941
2020-06-24 16:03:45 -05:00
Jinsong Ji
762f7a192e [NFC][PowerPC] Fix some typos in MachineCombiner comments 2020-06-24 20:40:57 +00:00
Christopher Tetreault
2007fa8c08 [SVE] Remove calls to VectorType::getNumElements from IPO
Reviewers: efriedma, jdoerfert, sdesmalen, kmclaughlin

Reviewed By: efriedma, jdoerfert

Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82219
2020-06-24 13:38:51 -07:00
dfukalov
e968fde7cb [NFCI][CostModel] Add const to Value*.
Summary:
Get back `const` partially lost in one of recent changes.
Additionally specify explicit qualifiers in few places.

Reviewers: samparker

Reviewed By: samparker

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82383
2020-06-24 23:16:08 +03:00
Kirill Naumov
9db79a6028 [InlineCost] Added InlineCostCallAnalyzer::print()
For the upcoming changes, we need to have an ability to dump
InlineCostCallAnalyzer info in non-debug builds as well.

Reviewed-By: mtrofin
Differential Revision: https://reviews.llvm.org/D82205
2020-06-24 20:07:27 +00:00
Sanjay Patel
8ccfdd4e5c [x86][AArch64] add tests for fmul-fma combine; NFC
As discussed in D80801, there's a possible overstep in
what is allowed by the 'contract' fast-math-flag.
2020-06-24 15:56:32 -04:00