Commit Graph

24861 Commits

Author SHA1 Message Date
Krzysztof Parzyszek
0d5de60cbe [RegisterCoalescer] Ensure that both registers have subranges if one does
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339792 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-15 17:04:58 +00:00
Krzysztof Parzyszek
28f0c7ef0a [RegisterCoalescer] Reset VNInfo def when copying segments over
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339788 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-15 16:21:53 +00:00
Krzysztof Parzyszek
d7a0236f29 [RegAlloc] Check that subreg liveness tracking applies to given virtual reg
Subregister liveness applies selectively to register classes with certain
properties. Make sure that when it's enabled, it applies to a given virtual
register (in virtual register rewriter).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339784 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-15 16:07:47 +00:00
Simon Pilgrim
f965428b0e [TargetLowering] Minor cleanup of TargetLowering::BuildSDIV. NFCI.
Pull out some types to match layout in TargetLowering::BuildUDIV. Early step towards adding non-uniform vector support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339763 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-15 11:11:05 +00:00
Simon Pilgrim
0f7eb9f532 [TargetLowering] Minor refactor to TargetLowering::BuildUDIV to merge scalar/vector magic value collection. NFCI.
Use the same ISD::matchUnaryPredicate pattern that was used in D50392.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339758 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-15 10:11:13 +00:00
Simon Pilgrim
c60b833f83 [DagCombiner] Don't bother adding to the work list if TLI.BuildSDIVPow2 failed. NFCI.
Matches the code in BuildSDIV/BuildUDIV

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339757 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-15 10:02:54 +00:00
Simon Pilgrim
7e6dd0cff7 [TargetLowering] Add support for non-uniform vectors to BuildExactSDIV
This patch refactors the existing BuildExactSDIV implementation to support non-uniform constant vector denominators.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339756 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-15 09:35:12 +00:00
Chandler Carruth
fc187011be [SDAG] Remove the reliance on MI's allocation strategy for
`MachineMemOperand` pointers attached to `MachineSDNodes` and instead
have the `SelectionDAG` fully manage the memory for this array.

Prior to this change, the memory management was deeply confusing here --
The way the MI was built relied on the `SelectionDAG` allocating memory
for these arrays of pointers using the `MachineFunction`'s allocator so
that the raw pointer to the array could be blindly copied into an
eventual `MachineInstr`. This creates a hard coupling between how
`MachineInstr`s allocate their array of `MachineMemOperand` pointers and
how the `MachineSDNode` does.

This change is motivated in large part by a change I am making to how
`MachineFunction` allocates these pointers, but it seems like a layering
improvement as well.

This would run the risk of increasing allocations overall, but I've
implemented an optimization that should avoid that by storing a single
`MachineMemOperand` pointer directly instead of allocating anything.
This is expected to be a net win because the vast majority of uses of
these only need a single pointer.

As a side-effect, this makes the API for updating a `MachineSDNode` and
a `MachineInstr` reasonably different which seems nice to avoid
unexpected coupling of these two layers. We can map between them, but we
shouldn't be *surprised* at where that occurs. =]

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339740 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-14 23:30:32 +00:00
Cameron McInally
ca4f10703e [FPEnv] Scalarize StrictFP vector operations
Add a helper function to scalarize constrained FP operations as needed.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339735 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-14 22:13:11 +00:00
Eli Friedman
1a5e05d070 [ARM] Make PerformSHLSimplify add nodes to the DAG worklist correctly.
Intentionally excluding nodes from the DAGCombine worklist is likely to
lead to weird optimizations and infinite loops, so it's generally a bad
idea.

To avoid the infinite loops, fix DAGCombine to use the
isDesirableToCommuteWithShift target hook before performing the
transforms in question, and implement the target hook in the ARM backend
disable the transforms in question.

Fixes https://bugs.llvm.org/show_bug.cgi?id=38530 . (I don't have a
reduced testcase for that bug. But we should have sufficient test
coverage for PerformSHLSimplify given that we're not playing weird
tricks with the worklist. I can try to bugpoint it if necessary,
though.)

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339734 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-14 22:10:25 +00:00
Adrian Prantl
c4d1909435 [DebugInfoMetadata] Added DIFlags interface in DIBasicType.
Flags in DIBasicType will be used to pass attributes used in
DW_TAG_base_type, such as DW_AT_endianity.

Patch by Chirag Patel!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339714 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-14 19:35:34 +00:00
Bruno Cardoso Lopes
8c444324e7 Revert "[DebugInfo] Generate DWARF debug information for labels. (Fix leak problems)"
This reverts commit cb8c5e417d / r339676.

This causing a test to fail in http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/48406/

    LLVM :: DebugInfo/Generic/debug-label.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339700 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-14 17:54:41 +00:00
Nirav Dave
2f6f2fb76a [DAG] Avoid redundant chain transversal in store merge cycle check. NFCI.
Patch by Henric Karlsson.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339688 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-14 16:20:43 +00:00
Hsiangkai Wang
cb8c5e417d [DebugInfo] Generate DWARF debug information for labels. (Fix leak problems)
There are two forms for label debug information in DWARF format.

1. Labels in a non-inlined function:

DW_TAG_label
  DW_AT_name
  DW_AT_decl_file
  DW_AT_decl_line
  DW_AT_low_pc

2. Labels in an inlined function:

DW_TAG_label
  DW_AT_abstract_origin
  DW_AT_low_pc

We will collect label information from DBG_LABEL. Before every DBG_LABEL,
we will generate a temporary symbol to denote the location of the label.
The symbol could be used to get DW_AT_low_pc afterwards. So, we create a
mapping between 'inlined label' and DBG_LABEL MachineInstr in DebugHandlerBase.
The DBG_LABEL in the mapping is used to query the symbol before it.

The AbstractLabels in DwarfCompileUnit is used to process labels in inlined
functions.

We also keep a mapping between scope and labels in DwarfFile to help to
generate correct tree structure of DIEs.

It also generates label debug information under global isel.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339676 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-14 13:50:59 +00:00
Amara Emerson
0904155b95 [GlobalISel][IRTranslator] Fix a bug in handling repeating struct types during argument lowering.
Differential Revision: https://reviews.llvm.org/D49442

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339674 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-14 12:04:25 +00:00
Scott Linder
7b19ab70e3 [CodeGen] Fix assert in SelectionDAG::computeKnownBits
Fix SelectionDAG::computeKnownBits asserting when handling EXTRACT_SUBVECTOR
when zero extending the demanded elements mask if it is already as long as the
source vector.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339600 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-13 18:44:21 +00:00
Simon Pilgrim
47b52ac4d9 [DAGCombiner] simplifyDivRem - add comment describing divide by undef/zero combine. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339561 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-13 13:12:25 +00:00
Simon Pilgrim
4177d36e03 [CGP] Fix GEP issue with out of range APInt constant values not fitting in int64_t
Test case reduced from https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7173

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339556 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-13 12:10:09 +00:00
Craig Topper
3638207d8f [SelectionDAG] In PromoteFloatOp_BITCAST, insert a bitcast after the fp_to_fp16 in case the result type isn't a scalar integer.
This is another variation of PR38533. In this case, the result type of the bitcast is legal and 16-bits wide, but not a scalar integer. So we need to emit the convert to i16 and then bitcast it to the true result type. This new bitcast will be further type legalized if necessary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339536 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-13 06:53:49 +00:00
Craig Topper
36c59846ae [SelectionDAG] In PromoteIntRes_BITCAST, when the input is TypePromoteFloat, make sure the output type is scalar. For vectors, use a store and load of temporary.
Previously if the result type was a vector, we emitted a FP_TO_FP16 with a vector result type which isn't valid.

This is basically the opposite case of the root cause of PR38533.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339535 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-13 06:53:47 +00:00
Lei Liu
fa3003a783 Restore correct x86_64 EH encodings in kernel code model
Fixes PR37524.

The exception handling encodings for x86_64 in kernel code model
has been changed with r309884.  Restore it to correct ones.  These
encodings include PersonalityEncoding, LSDAEncoding and
TTypeEncoding.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339534 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-13 06:06:53 +00:00
Craig Topper
7bbb4c9b16 [SelectionDAG] In PromoteFloatRes_BITCAST, insert a bitcast before the fp16_to_fp in case the input type isn't an i16.
The bitcast can be further legalized as needed.

Fixes PR38533.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339533 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-13 05:26:49 +00:00
Matt Arsenault
f0912abc34 DAG: Check no-signed-zeros instead of unsafe-fp-math
Addresses fixme, although this should still be checking individual
operand flags.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339525 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-12 19:09:12 +00:00
Craig Topper
a19815f1d9 [TargetLowering] Simplify one of the special cases in SimplifyDemandedBits for XOR. NFCI
We were checking for all bits being Known by checking Known.Zero|Known.One, but if all the bits are known then the value should be a Constant and we can just check for that instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339509 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-12 06:52:03 +00:00
Craig Topper
80ad764eba [TargetLowering] Use APInt::isSubsetOf to simplify some code. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339508 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-12 05:34:15 +00:00
Hans Wennborg
201534e1aa Rename the cfguard module flag to cfguardtable
The previous name sounds like it inserts cfguard implementation, but it
really just emits the table of address-taken functions. Change the name
to better reflect that.

Clang will be updated in the next commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339419 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-10 09:48:53 +00:00
Reid Kleckner
3b9733f095 [MC] Move EH DWARF encodings from MC to CodeGen, NFC
Summary:
The TType encoding, LSDA encoding, and personality encoding are all
passed explicitly by CodeGen to the assembler through .cfi_* directives,
so only the AsmPrinter needs to know about them.

The FDE CFI encoding however, controls the encoding of the label
implicitly created by the .cfi_startproc directive. That directive seems
to be special in that it doesn't take an encoding, so the assembler just
has to know how to encode one DSO-local label reference from .eh_frame
to .text.

As a result, it looks like MC will continue to have to know when the
large code model is in use. Perhaps we could invent a '.cfi_startproc
[large]' flag so that this knowledge doesn't need to pollute the
assembler.

Reviewers: davide, lliu0, JDevlieghere

Subscribers: hiraditya, fedor.sergeev, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339397 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-09 22:24:04 +00:00
Sanjay Patel
3d464de968 [SelectionDAG] try harder to convert funnel shift to rotate
Similar to rL337966 - if the DAGCombiner's rotate matching was 
working as expected, I don't think we'd see any test diffs here.

AArch only goes right, and PPC only goes left. 
x86 has both, so no diffs there.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339359 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-09 17:26:22 +00:00
Michael Berg
5a282e54d0 extend folding fsub/fadd to fneg for FMF
Summary: This change provides a common optimization path for both Unsafe and FMF driven optimization for this fsub fold adding reassociation, as it the flag that most closely represents the translation

Reviewers: spatel, wristow, arsenm

Reviewed By: spatel

Subscribers: wdng

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339357 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-09 17:00:03 +00:00
Bjorn Pettersson
ead8b39fb5 [MC] Remove PhysRegSize from MCRegisterClass
Summary:
The interface to get size and spill size of a register
was moved from MCRegisterInfo to TargetRegisterInfo over
a year ago. Afaik the old interface has bee around
to give out-of-tree targets a chance to adapt to the
new interface.

One problem with the old MCRegisterClass::PhysRegSize was that
it represented the size of a register as "size in bits" / 8.
So a register had to be a multiple of eight bits wide for the
size to be correct (and the byte size for the target needed to
be eight bits).

Reviewers: kparzysz, qcolombet

Reviewed By: kparzysz

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339350 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-09 15:19:07 +00:00
Simon Pilgrim
c5db0e0f7c [TargetLowering] Add BuildSDIVPattern helper to BuildExactSDIV (NFCI).
As requested in D50392, pull the magic constant calculations out into a helper function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339346 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-09 13:56:04 +00:00
Sanjay Patel
a521995ff0 [DAGCombiner] loosen constraints for fsub+fadd fold
isNegatibleForFree() should not matter here (as the test diffs show)
because it's always a win to replace an fsub+fadd with fneg. The
problem in D50195 persists because either (1) we are doing these
folds in the wrong order or (2) we're missing another fold for fadd.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339299 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-08 23:04:43 +00:00
Sanjay Patel
e6de6e2420 [DAGCombiner] move fadd simplification ahead of other folds
I don't know if it's possible to expose this diff in a test,
but we should always try simplifications (no new nodes created)
before more complicated transforms for efficiency (similar to
what we do in IR).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339298 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-08 22:46:30 +00:00
Ties Stuij
26f3bc576f revert '[CodeGen] emit inline asm clobber list warnings for reserved'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339274 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-08 17:11:54 +00:00
Jonas Devlieghere
86e6f59695 [DebugInfo] Fine tune emitting flags as part of the producer
When using APPLE extensions, don't duplicate the compiler invocation's
flags both in AT_producer and AT_APPLE_flags.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339268 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-08 16:33:22 +00:00
Simon Pilgrim
cf105970b5 [DAG] DAGCombiner::visitSDIVLike - remove unnecessary isConstOrConstSplat call. NFCI.
The isConstOrConstSplat result is only used in a ISD::matchUnaryPredicate call which can perform the equivalent iteration just as quickly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339262 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-08 15:37:52 +00:00
Ties Stuij
2235c76a9b [CodeGen] emit inline asm clobber list warnings for reserved
Summary:
Currently, in line with GCC, when specifying reserved registers like sp or pc on an inline asm() clobber list, we don't always preserve the original value across the statement. And in general, overwriting reserved registers can have surprising results.

For example:


```
extern int bar(int[]);

int foo(int i) {
  int a[i]; // VLA
  asm volatile(
      "mov r7, #1"
    :
    :
    : "r7"
  );

  return 1 + bar(a);
}
```

Compiled for thumb, this gives:
```
$ clang --target=arm-arm-none-eabi -march=armv7a -c test.c -o - -S -O1 -mthumb
...
foo:
        .fnstart
@ %bb.0:                                @ %entry
        .save   {r4, r5, r6, r7, lr}
        push    {r4, r5, r6, r7, lr}
        .setfp  r7, sp, #12
        add     r7, sp, #12
        .pad    #4
        sub     sp, #4
        movs    r1, #7
        add.w   r0, r1, r0, lsl #2
        bic     r0, r0, #7
        sub.w   r0, sp, r0
        mov     sp, r0
        @APP
        mov.w   r7, #1
        @NO_APP
        bl      bar
        adds    r0, #1
        sub.w   r4, r7, #12
        mov     sp, r4
        pop     {r4, r5, r6, r7, pc}
...
```

r7 is used as the frame pointer for thumb targets, and this function needs to restore the SP from the FP because of the variable-length stack allocation a. r7 is clobbered by the inline assembly (and r7 is included in the clobber list), but LLVM does not preserve the value of the frame pointer across the assembly block.

This type of behavior is similar to GCC's and has been discussed on the bugtracker: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=11807 . No consensus seemed to have been reached on the way forward.  Clang behavior has briefly been discussed on the CFE mailing (starting here: http://lists.llvm.org/pipermail/cfe-dev/2018-July/058392.html). I've opted for following Eli Friedman's advice to print warnings when there are reserved registers on the clobber list so as not to diverge from GCC behavior for now.

The patch uses MachineRegisterInfo's target-specific knowledge of reserved registers, just before we convert the inline asm string in the AsmPrinter.

If we find a reserved register, we print a warning:
```
repro.c:6:7: warning: inline asm clobber list contains reserved registers: R7 [-Winline-asm]
      "mov r7, #1"
      ^
```

Reviewers: eli.friedman, olista01, javed.absar, efriedma

Reviewed By: efriedma

Subscribers: efriedma, eraman, kristof.beyls, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339257 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-08 15:15:59 +00:00
Simon Pilgrim
8a32574571 [TargetLowering] BuildUDIV - Add support for divide by one (PR38477)
Provide a pass-through of the numerator for divide by one cases - this is the same approach we take in DAGCombiner::visitSDIVLike.

I investigated whether we could achieve this by magic MULHU/SRL values but nothing appeared to work as we don't have a way for MULHU(x,c) -> x

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339254 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-08 14:51:19 +00:00
Simon Pilgrim
98bb3fb630 [TargetLowering] Remove APInt divisor argument from BuildExactSDIV (NFCI).
As requested in D50392, this is a minor refactor to BuildExactSDIV to stop taking the uniform constant APInt divisor and instead extract it locally.

I also cleanup the operands and valuetypes to better match BuildUDiv (and BuildSDIV in the near future).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339246 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-08 13:59:44 +00:00
Ties Stuij
f925727f87 test commit access
Summary: changing a few typos

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339245 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-08 13:51:13 +00:00
Simon Pilgrim
2b9bc063ae [TargetLowering] BuildUDIV - Early out for divide by one (PR38477)
We're not handling the UDIV by one special case properly - for now just early out.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339229 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-08 10:00:54 +00:00
Thomas Preud'homme
ba39c1b56c Support inline asm with multiple 64bit output in 32bit GPR
Summary: Extend fix for PR34170 to support inline assembly with multiple output operands that do not naturally go in the register class it is constrained to (eg. double in a 32-bit GPR as in the PR).

Reviewers: bogner, t.p.northover, lattner, javed.absar, efriedma

Reviewed By: efriedma

Subscribers: efriedma, tra, eraman, javed.absar, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339225 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-08 09:35:26 +00:00
Craig Topper
bd8a67bd05 [SelectionDAG] When splitting scatter nodes during DAGCombine, create a serial chain dependency.
Scatter could have multiple identical indices. We need to maintain sequential order. We get this right in LegalizeVectorTypes, but not in this code.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339157 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-07 17:35:02 +00:00
Simon Pilgrim
29e9277c6c [DAG] Allow non-uniform constant vectors to call BuildSDIV
This was missed in D50185.

NFC until we add actual non-uniform support to BuildSDIV (similar BuildUDIV support in D49248) - for now it just early outs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339147 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-07 14:50:39 +00:00
Simon Pilgrim
13f3fc4d27 [TargetLowering] Use pre-computed Shift value type in BuildUDIV (NFCI)
This was missed in D49248


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339146 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-07 14:40:21 +00:00
Jonas Devlieghere
b2fdb72a01 Fix inconsistency with/without debug information (-g)
This fixes an inconsistency in code generation when compiling with or
without debug information (-g). When debug information is available in
an empty block, the original test would fail, resulting in possibly
different code.

Patch by: Jeroen Dobbelaere

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339129 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-07 12:14:01 +00:00
Pavel Labath
23332c50c1 [DebugInfo] Reduce debug_str_offsets section size
Summary:
The accelerator tables use the debug_str section to store their strings.
However, they do not support the indirect method of access that is
available for the debug_info section (DW_FORM_strx et al.).

Currently our code is assuming that all strings can/will be referenced
indirectly, and puts all of them into the debug_str_offsets section.
This is generally true for regular (unsplit) dwarf, but in the DWO case,
most of the strings in the debug_str section will only be used from the
accelerator tables. Therefore the contents of the debug_str_offsets
section will be largely unused and bloating the main executable.

This patch rectifies this by teaching the DwarfStringPool to
differentiate between strings accessed directly and indirectly. When a
user inserts a string into the pool it has to declare whether that
string will be referenced directly or not. If at least one user requsts
indirect access, that string will be assigned an index ID and put into
debug_str_offsets table. Otherwise, the offset table is skipped.

This approach reduces the overall binary size (when compiled with
-gdwarf-5 -gsplit-dwarf) in my tests by about 2% (debug_str_offsets is
shrunk by 99%).

Reviewers: probinson, dblaikie, JDevlieghere

Subscribers: aprantl, mgrang, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339122 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-07 09:54:52 +00:00
Simon Pilgrim
4fcef69e65 [TargetLowering] Add support for non-uniform vectors to BuildUDIV
This patch refactors the existing TargetLowering::BuildUDIV base implementation to support non-uniform constant vector denominators.

It also includes a fold for MULHU by pow2 constants to SRL which can now more readily occur from BuildUDIV.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339121 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-07 09:51:34 +00:00
Craig Topper
a6d27860a5 [SelectionDAG][X86] Rename MaskedLoadSDNode::getSrc0 to getPassThru.
Src0 doesn't really convey any meaning to what the operand is. Passthru matches what's used in the documentation for the intrinsic this comes from.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339101 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-07 06:52:49 +00:00
Craig Topper
a4b4e86ad8 [SelectionDAG][X86] Rename getValue to getPassThru for gather SDNodes.
getValue is more meaningful name for scatter than it is for gather. Split them and use getPassThru for gather.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339096 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-07 06:13:40 +00:00