Commit Graph

3685 Commits

Author SHA1 Message Date
Sam Parker c108e2cef7 [ARM] Add missing patterns for DSP muls
Using a PatLeaf for sext_16_node allowed matching smulbb and smlabb
instructions once the operands had been sign extended. But we also
need to use sext_inreg operands along with sext_16_node to catch a
few more cases that enable use to remove the unnecessary sxth.

Differential Revision: https://reviews.llvm.org/D55992


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350613 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-08 10:12:36 +00:00
Diogo N. Sampaio 08d38f01b3 [ARM] ComputeKnownBits to handle extract vectors
This patch adds the sign/zero extension done by
vgetlane to ARM computeKnownBitsForTargetNode.

Differential revision: https://reviews.llvm.org/D56098


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350553 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-07 19:01:47 +00:00
Simon Pilgrim 493c470215 Regenerate test.
Prep work towards enabling SimplifyDemandedBits vector support for TRUNCATE as discussed on D56118.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350514 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-07 12:21:13 +00:00
Florian Hahn 8688ce4f76 [ARM] Set Defs = [CPSR] for COPY_STRUCT_BYVAL, as it clobbers CPSR.
Fixes PR35023.

Reviewers: MatzeB, t.p.northover, sunfish, qcolombet, efriedma

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D55909


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349935 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-21 18:07:10 +00:00
Diana Picus 331ffd31b3 [ARM GlobalISel] Support G_CONSTANT for Thumb2
All we have to do is mark it as legal.

This allows us to select a lot of new patterns handled by TableGen. This
patch adds tests for them and splits up the existing test file for
binary operators into 2 files, one for arithmetic ops and one for
logical ones.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349610 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-19 09:55:10 +00:00
Tim Northover e2e53c456d ARM: use acquire/release instruction variants when available.
These features (fairly) recently got split out into their own feature, so we
should make CodeGen use them when available. The main change here is that the
check used to be based on the triple, but now it's based on CPU features.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349355 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-17 15:05:32 +00:00
Sanjay Patel c5f4a842ff [DAGCombiner] allow hoisting vector bitwise logic ahead of truncates
The transform performs a bitwise logic op in a wider type followed by
truncate when both inputs are truncated from the same source type:
logic_op (truncate x), (truncate y) --> truncate (logic_op x, y)

There are a bunch of other checks that should prevent doing this when 
it might be harmful.

We already do this transform for scalars in this spot. The vector 
limitation was shared with a check for the case when the operands are 
extended. I'm not sure if that limit is needed either, but that would 
be a separate patch.

Differential Revision: https://reviews.llvm.org/D55448


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349303 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-16 14:57:04 +00:00
Sanjay Patel b8a683696f [ARM] make test immune to scalarization improvements; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349177 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-14 18:47:04 +00:00
Diana Picus 5e8ab56369 [ARM GlobalISel] Thumb2: casts between int and ptr
Mark as legal and add tests. Nothing special to do.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349147 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-14 13:45:38 +00:00
Diana Picus bbcda06d82 [ARM GlobalISel] Remove duplicate test. NFCI
Fixup for r349026. I forgot to delete these test functions from the
original file when I moved them to arm-legalize-exts.mir.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349146 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-14 13:28:34 +00:00
Diana Picus f4f855ccc7 [ARM GlobalISel] Allow simple binary ops in Thumb2
Mark G_ADD, G_SUB, G_MUL, G_AND, G_OR and G_XOR as legal for both ARM
and Thumb2.

Extract the legalizer tests for these opcodes into another file.

Add tests for the instruction selector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349142 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-14 11:58:14 +00:00
Diana Picus 69dfdcbfa7 [ARM GlobalISel] Support exts and truncs for Thumb2
Mark G_SEXT, G_ZEXT and G_ANYEXT to 32 bits as legal and add support for
them in the instruction selector. This uses handwritten code again
because the patterns that are generated with TableGen are tuned for what
the DAG combiner would produce and not for simple sext/zext nodes.
Luckily, we only need to update the opcodes to use the Thumb2 variants,
everything else can be reused from ARM.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349026 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-13 12:06:54 +00:00
Clement Courbet cd253afe6f [CodeGen] Allow mempcy/memset to generate small overlapping stores.
Summary:
All targets either just return false here or properly model `Fast`, so I
don't think there is any reason to prevent CodeGen from doing the right
thing here.

Subscribers: nemanjai, javed.absar, eraman, jsji, llvm-commits

Differential Revision: https://reviews.llvm.org/D55365

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349016 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-13 09:56:19 +00:00
Diana Picus 041c1c53bb [ARM GlobalISel] Select load/store for Thumb2
Unfortunately we can't use TableGen for this because it doesn't yet
support predicates on the source pattern root. Therefore, add a bit of
handwritten code to the instruction selector to handle the most basic
cases.

Also mark them as legal and extract their legalizer test cases to a new
test file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348920 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-12 10:32:15 +00:00
Amara Emerson e7dca1ec05 [GlobalISel] Restrict G_MERGE_VALUES capability and replace with new opcodes.
This patch restricts the capability of G_MERGE_VALUES, and uses the new
G_BUILD_VECTOR and G_CONCAT_VECTORS opcodes instead in the appropriate places.

This patch also includes AArch64 support for selecting G_BUILD_VECTOR of <4 x s32>
and <2 x s64> vectors.

Differential Revisions: https://reviews.llvm.org/D53629

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348788 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-10 18:44:58 +00:00
Tim Northover 2ae30c46b8 ARM: use correct offset from base pointer (r6) in call frame regions.
When we had dynamic call frames (i.e. sp adjustment around each call) we
were including that adjustment into offsets calculated based on r6, even
though it's only sp that changes. This led to incorrect stack slot
accesses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348591 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-07 13:43:55 +00:00
David Green 7135d8b482 [Targets] Add errors for tiny and kernel codemodel on targets that don't support them
Adds fatal errors for any target that does not support the Tiny or Kernel
codemodels by rejigging the getEffectiveCodeModel calls.

Differential Revision: https://reviews.llvm.org/D50141


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348585 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-07 12:10:23 +00:00
Sam Parker 8c303c35b7 [ARM][NFC] Adding another test for armcgp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348489 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-06 15:13:44 +00:00
Sam Parker 2036102c28 [ARM][NFC] Added extra arm-cgp test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348482 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-06 12:58:58 +00:00
Diana Picus 1dd5a04a66 [ARM GlobalISel] Implement call lowering for Thumb2
The only things that are different from arm are:
* different opcodes for calls and returns
* Thumb calls take predicate operands

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348347 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-05 10:35:28 +00:00
Tim Northover 0487bd8f42 ARM: use target-specific SUBS node when combining cmp with cmov.
This has two positive effects. First, using a custom node prevents
recombination leading to an infinite loop since the output DAG is notionally a
little more complex than the input one. Using a flag-setting instruction also
allows the subtraction to be folded with the related comparison more easily.

https://reviews.llvm.org/D53190

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348122 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-03 11:16:21 +00:00
Sjoerd Meijer dbd65c8e9d [ARM] FP16: support vld1.16 for vector loads with post-increment
Differential Revision: https://reviews.llvm.org/D55112


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348110 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-03 08:26:34 +00:00
Sjoerd Meijer b6be32f152 [ARM] Don't expand sdiv when optimising for minsize
Don't expand SDIV with an immediate that is a power of 2 if we optimise for
minimum code size. For example:

sdiv %1, i32 4

gets expanded to a sequence of 3 instructions, but this is suboptimal for
minimum code size so instead we just generate a MOV and a SDIV if integer
division is supported.

Differential Revision: https://reviews.llvm.org/D54546


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347965 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-30 08:14:28 +00:00
Craig Topper 689482be85 [LegalizeVectorTypes][X86][ARM][AArch64][PowerPC] Don't use SplitVecOp_TruncateHelper for FP_TO_SINT/UINT.
SplitVecOp_TruncateHelper tries to promote the result type while splitting FP_TO_SINT/UINT. It then concatenates the result and introduces a truncate to the original result type. But it does this without inserting the AssertZExt/AssertSExt that the regular result type promotion would insert. Nor does it turn FP_TO_UINT into FP_TO_SINT the way normal result type promotion for these operations does. This is bad on X86 which doesn't support FP_TO_SINT until AVX512.

This patch disables the use of SplitVecOp_TruncateHelper for these operations and just lets normal promotion handle it. I've tweaked a couple things in X86ISelLowering to avoid a few obvious regressions there. I believe all the changes on X86 are improvements. The other targets look neutral.

Differential Revision: https://reviews.llvm.org/D54906

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347593 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-26 21:12:39 +00:00
Diana Picus 2de9fad1ee [ARM GlobalISel] Support G_CTLZ and G_CTLZ_ZERO_UNDEF
We can now select CLZ via the TableGen'erated code, so support G_CTLZ
and G_CTLZ_ZERO_UNDEF throughout the pipeline for types <= s32.

Legalizer:
If the CLZ instruction is available, use it for both G_CTLZ and
G_CTLZ_ZERO_UNDEF. Otherwise, use a libcall for G_CTLZ_ZERO_UNDEF and
lower G_CTLZ in terms of it.

In order to achieve this we need to add support to the LegalizerHelper
for the legalization of G_CTLZ_ZERO_UNDEF for s32 as a libcall (__clzsi2).

We also need to allow lowering of G_CTLZ in terms of G_CTLZ_ZERO_UNDEF
if that is supported as a libcall, as opposed to just if it is Legal or
Custom. Due to a minor refactoring of the helper function in charge of
this, we will also allow the same behaviour for G_CTTZ and G_CTPOP.
This is not going to be a problem in practice since we don't yet have
support for treating G_CTTZ and G_CTPOP as libcalls (not even in
DAGISel).

Reg bank select:
Map G_CTLZ to GPR. G_CTLZ_ZERO_UNDEF should not make it to this point.

Instruction select:
Nothing to do.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347545 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-26 11:07:02 +00:00
Sam Parker c9c05bde23 [ARM] Prevent parallel macs for unsigned values
Both zext and sext are currently allowed during the search for narrow
sequences and sexts operands are later added to the mac candidates.
But operands of muls are also added, without checking whether they're
sext or zext, which means we can generate a signed smlad when we
shouldn't.

Differential Revision: https://reviews.llvm.org/D54790


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347542 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-26 10:22:55 +00:00
Sjoerd Meijer 5fc62830a6 [ARM][NFC] codegen tests cleanup: remove dangling check prefixes
I am working on making FileCheck stricter (in D54769 and D53710) so that it
issues diagnostics when there's something wrong with tests.

This is a cleanup for dangling prefixes in the ARM codegen tests, e.g.:

--check-prefixes=A,B

where A occurs in the check file, but B doesn't. This can be innocent if A does
all the required checking, but can also be a bug in that test if it results in
the test actually not checking anything (if A for example only checks a common
label). Test CodeGen/ARM/smml.ll is such an example.

Differential Revision: https://reviews.llvm.org/D54842


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347487 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-23 10:08:39 +00:00
Craig Topper 5a2d06490c [LegalizeVectorTypes] Don't use SplitVecOp_TruncateHelper if we're heading towards scalarizing the type.
This code takes a truncate, fp_to_int, or int_to_fp with a legal result type and an input type that needs to be split and enlarges the elements in the result type before doing the split. Then inserts a follow up truncate or fp_round after concatenating the two halves back together.

But if the input type of the original op is being split on its way to ultimately being scalarized we're just going to end up building a vector from scalars and then truncating or rounding it in the vector register. Seems kind of silly to enlarge the result element type of the operation only to end up with scalar code and then building a vector with large elements only to make the elements smaller again in the vector register. Seems better to just try to get away producing smaller result types in the scalarized code.

The X86 test case that changes is a pretty contrived test case that exists because of a bug we used to have in our AVG matching code. I think the code is better now, but its not realistic anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347482 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-23 02:32:13 +00:00
Sanjay Patel c93c84c762 [DAGCombiner] form 'not' ops ahead of shifts (PR39657)
We fail to canonicalize IR this way (prefer 'not' ops to arbitrary 'xor'),
but that would not matter without this patch because DAGCombiner was 
reversing that transform. I think we need this transform in the backend 
regardless of what happens in IR to catch cases where the shift-xor 
is formed late from GEP or other ops.

https://rise4fun.com/Alive/NC1

  Name: shl
  Pre: (-1 << C2) == C1
  %shl = shl i8 %x, C2
  %r = xor i8 %shl, C1
  =>
  %not = xor i8 %x, -1
  %r = shl i8 %not, C2
  
  Name: shr
  Pre: (-1 u>> C2) == C1
  %sh = lshr i8 %x, C2
  %r = xor i8 %sh, C1
  =>
  %not = xor i8 %x, -1
  %r = lshr i8 %not, C2

https://bugs.llvm.org/show_bug.cgi?id=39657


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347478 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-22 19:24:10 +00:00
Diana Picus f6259516db [ARM GlobalISel] Add test for BFC. NFCI
r334871 has made it possible for TableGen'erated code to select BFC, but
it has not added a test for it on the ARM side. Add it now to make sure
we don't introduce regressions if we ever change anything about that
rule.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347447 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-22 09:54:14 +00:00
Sam Parker 7ca11331eb [ARM] Attempt to fix arm selfhost bots after rL347191
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347238 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-19 18:08:46 +00:00
Sam Parker 1412721733 [ARM] Remove trunc sinks in ARM CGP
Truncs are treated as sources if their produce a value of the same
type as the one we currently trying to promote. Truncs used to be
considered as a sink if their operand was the same value type.
    
We now allow smaller types in the search, so we should search through
truncs that produce a smaller value. These truncs can then be
converted to an AND mask.
    
This leaves sinks as being:
  - points where the value in the register is being observed, such as
    an icmp, switch or store.
  - points where value types have to match, such as calls and returns.
  - zext are included to ease the transformation and are generally
    removed later on.
    
During this change, it also became apart from truncating sinks was
broken: if a sink used a source, its type information had already
been lost by the time the truncation happens. So I've changed the
method of caching the type information.

Differential Revision: https://reviews.llvm.org/D54515


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347191 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-19 11:34:40 +00:00
Sanjay Patel cebaa36137 [ARM] make test immune to improvements in undef simplification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347164 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-18 16:49:42 +00:00
Stanislav Mekhanoshin fbe3eeb333 DAG combiner: fold (select, C, X, undef) -> X
Differential Revision: https://reviews.llvm.org/D54646

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347110 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-16 23:13:38 +00:00
Eli Friedman 7a45551030 [CodeGen] Fix forward scan in MachineBasicBlock::computeRegisterLiveness.
The scan was incorrectly skipping the first instruction, so a register
could appear to be dead when it was actually live. This eventually leads
to a machine verifier failure and miscompile in arm-ldst-opt.

Differential Revision: https://reviews.llvm.org/D54491



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346821 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-14 00:39:29 +00:00
Nirav Dave c5dba22c1d [DAGCombiner] Fix load-store forwarding of indexed loads.
Summary:
Handle extra output from index loads in cases where we wish to
forward a load value directly from a preceeding store.

Fixes PR39571.

Reviewers: peter.smith, rengolin

Subscribers: javed.absar, hiraditya, arphaman, llvm-commits

Differential Revision: https://reviews.llvm.org/D54265

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346654 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-12 14:05:40 +00:00
Eli Friedman 35ef1bd84b [ARM] Add MemOperand to LDRcp to enable DCE.
LDRcp should be deleted when the dest register is dead in register
coalescing. Without MemOp, dead LDRcp will cause dead constant pool
value which references to non-existing label.

Patch by Yin Ma.

Differential Revision: https://reviews.llvm.org/D54173



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346563 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-09 23:09:17 +00:00
Sam Parker 72e06ac443 [ARM] Don't promote i1 types in ARM CGP
Now that we have mixed type sizes, i1 values need to be explicitly
handled as we want to avoid promoting these values.

Differential Revision: https://reviews.llvm.org/D54308


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346499 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-09 15:06:33 +00:00
Sam Parker 8e070ff595 [ARM] Enable mixed types in ARM CGP
Previously, during the search, all values had to have the same
'TypeSize', which is equal to number of bits of the integer type of
the icmp operand. All values in the tree had to match this size;
meaning that, if we searched from i16, we wouldn't accept i8s. A
change in type size requires zext and truncs to perform the casts so,
to allow mixed narrow types, the handling of these instructions is
now slightly different:

- we allow casts if their result or operand is <= TypeSize.
- zexts are sinks if their result > TypeSize.
- truncs are still sinks if their operand == TypeSize.
- truncs are still sources if their result == TypeSize.

The transformation bails on finding an icmp that operates on data
smaller than the current TypeSize.

Differential Revision: https://reviews.llvm.org/D54108



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346480 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-09 09:28:27 +00:00
Nirav Dave e2baccfd07 [DAGCombine] Improve alias analysis for chain of independent stores.
FindBetterNeighborChains simulateanously improves the chain
dependencies of a chain of related stores avoiding the generation of
extra token factors. For chains longer than the GatherAllAliasDepths,
stores further down in the chain will necessarily fail, a potentially
significant waste and preventing otherwise trivial parallelization.

This patch directly parallelize the chains of stores before improving
each store. This generally improves DAG-level parallelism.

Reviewers: courbet, spatel, RKSimon, bogner, efriedma, craig.topper, rnk

Subscribers: sdardis, javed.absar, hiraditya, jrtc27, atanasyan, llvm-commits

Differential Revision: https://reviews.llvm.org/D53552

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346432 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-08 19:14:20 +00:00
Eli Friedman 7c67a1fab1 [ARM] Fix CPSR liveness in tMOVCCr_pseudo lowering.
The lowering was missing live-ins in certain cases, like a sequence of
multiple tMOVCCr_pseudo instructions.  This would lead to a verifier
failure, and on pre-v6 Thumb CPSR would be incorrectly clobbered.

For reasons I don't completely understand, it's hard to get a sequence
of multiple tMOVCCr_pseudo instructions; the issue only seems to show up
with 64-bit comparisons where the result is zero-extended. I added some
extra testcases in case that changes in the future. Probably some
optimization opportunities here if anyone is interested. (@test_slt_not
is the case that was getting miscompiled.)

The code to check the liveness of CPSR was stolen from
X86ISelLowering.cpp; maybe it could be refactored into common helper,
but I have no idea where to put it.

Differential Revision: https://reviews.llvm.org/D54192



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346355 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-07 21:08:13 +00:00
Sam Parker 7051a2ef11 [NFC][ARM] Adding extra test for ARM CGP
Added a reproducer that I received a while ago.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346132 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-05 14:17:27 +00:00
Sam Parker 4bf0a8ee3f [ARM] Turn assert into condition in ARMCGP
Turn the assert in PrepareConstants into a conditon so that we can
handle mul instructions with negative immediates.

Differential Revision: https://reviews.llvm.org/D54094


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346126 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-05 11:26:04 +00:00
Sam Parker 76d01007ee [ARM][ARMCGP] Remove unecessary zexts and truncs
r345840 slightly changed the way promotion happens which could
result in zext and truncs having the same source and destination
types. This fixes that issue.

We can now also remove the zext and trunc in the following case:
(zext (trunc (promoted op)), i32)

This means that we can no longer treat a value, that is only used by
a sink, to be safe to promote.

I've also added in some extra asserts and replaced a cast for a
dyn_cast.

Differential Revision: https://reviews.llvm.org/D54032


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346125 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-05 10:58:37 +00:00
Matthias Braun 7a01cbd4a1 ARMExpandPseudoInsts: Fix CMP_SWAP expansion adding a kill flag to a def
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346026 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-02 18:22:15 +00:00
Simon Pilgrim 44ee005685 [DAGCombiner] Remove reduceBuildVecConvertToConvertBuildVec and rely on the vectorizers instead (PR35732)
reduceBuildVecConvertToConvertBuildVec vectorizes int2float in the DAGCombiner, which means that even if the LV/SLP has decided to keep scalar code using the cost models, this will override this.

While there are cases where vectorization is necessary in the DAG (mainly due to legalization artefacts), I don't think this is the case here, we should assume that the vectorizers know what they are doing.

Differential Revision: https://reviews.llvm.org/D53712

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345964 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-02 11:06:18 +00:00
Sam Parker b74f1454d8 [ARM][CGP] Negative constant operand handling
While mutating instructions, we sign extended negative constant
operands for binary operators that can safely overflow. This was to
allow instructions, such as add nuw i8 %a, -2, to still be able to
perform a subtraction. However, the code to handle constants doesn't
take into consideration that instructions, such as sub nuw i8 -2, %a,
require the i8 -2 to be converted into i32 254.

This is a relatively simple fix, but I've taken the time to
reorganise the code a bit - mainly that instructions that can be
promoted are cached and splitting up the Mutate function.

Differential Revision: https://reviews.llvm.org/D53972


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345840 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-01 15:23:42 +00:00
Eli Friedman 58970cd2b4 [IR] Allow increasing the alignment of dso-local globals.
I think this is the actual important property; the previous visibility
check was an approximation.

Differential Revision: https://reviews.llvm.org/D53852



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345790 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-31 23:03:58 +00:00
Eli Friedman d001dd065e [ARM] Add missing pseudo-instruction for Thumb1 RSBS.
Shows up rarely for 64-bit arithmetic, more frequently for the compare
patterns added in r325323.

Differential Revision: https://reviews.llvm.org/D53848



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345782 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-31 21:45:48 +00:00
Matthias Braun 83c015bd73 MachineOperand/MIParser: Do not print debug-use flag, infer it
The debug-use flag must be set exactly for uses on DBG_VALUEs.  This is
so obvious that it can be trivially inferred while parsing. This will
reduce noise when printing while omitting an information that has little
value to the user.

The parser will keep recognizing the flag for compatibility with old
`.mir` files.

Differential Revision: https://reviews.llvm.org/D53903

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345671 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-30 23:28:27 +00:00