Commit Graph

24807 Commits

Author SHA1 Message Date
Aditya Nandakumar
a347456a98 [GISel]: Add Opcodes for CTLZ/CTTZ/CTPOP
https://reviews.llvm.org/D48600

Added IRTranslator support to translate these known intrinsics into GISel opcodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338944 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-04 01:22:12 +00:00
Craig Topper
027b97fe0a [SelectionDAG] Teach LegalizeVectorTypes to widen the mask input to a masked store.
The mask operand is visited before the data operand so we need to be able to widen it.

Fixes PR38436.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338915 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-03 20:14:18 +00:00
Matt Arsenault
7166ee595d DAG: Enhance isKnownNeverNaN
Add a parameter for testing specifically for
sNaNs - at least one instruction pattern on AMDGPU
needs to check specifically for this.

Also handle more cases, and add a target hook
for custom nodes, similar to the hooks for known
bits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338910 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-03 18:27:52 +00:00
Simon Pilgrim
5bf23c0ee0 [TargetLowering] Generalise BuildSDIV function
First step towards a BuildSDIV equivalent to D49248 for non-uniform vector support - this just pushes the splat detection down into TargetLowering::BuildSDIV where its still used.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338838 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-03 10:00:54 +00:00
Eli Friedman
f4a5ef1f00 [GlobalMerge] Allow merging globals with explicit section markings.
At least on ELF, it's impossible to tell from the object file whether
two globals with the same section marking were merged: the merged global
uses "private" linkage to hide its symbol, and the aliases look like
regular symbols. I can't think of any other reason to disallow it.
(Of course, we can only merge globals in the same section.)

The weird alignment handling matches AsmPrinter; our alignment handling
for global variables should probably be refactored.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338791 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-02 23:54:16 +00:00
Matt Arsenault
2920ef7815 DAG: Fix vector widening fcanonicalize
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338715 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-02 13:43:53 +00:00
Alexander Ivchenko
8c575a1c2e [GlobalISel] Rewrite CallLowering::lowerReturn to accept multiple VRegs per Value
This is logical continuation of https://reviews.llvm.org/D46018 (r332449)

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338685 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-02 08:33:31 +00:00
Lei Liu
b4d32d09c5 Fix FCOPYSIGN expansion
In expansion of FCOPYSIGN, the shift node is missing when the two
operands of FCOPYSIGN are of the same size. We should always generate
shift node (if the required shift bit is not zero) to put the sign
bit into the right position, regardless of the size of underlying
types.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338665 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-02 01:54:12 +00:00
Lei Liu
6b6a4ee7d7 [AArch64] DWARF: do not generate AT_location for thread local
AArch64 ELF ABI does not define a static relocation type for TLS offset within
a module, which makes it impossible for compiler to generate a valid
DW_AT_location content for thread local variables. Currently LLVM generates an
invalid R_AARCH64_ABS64 relocation at the DW_AT_location field for a TLS
variable. That causes trouble for linker because thread local variable does
not have an absolute address at link time. AArch64 GCC solves the problem by
not generating DW_AT_location for thread local variables. We should do the
same in LLVM.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338655 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-01 23:46:49 +00:00
Alexey Bataev
83de821178 [DEBUGINFO] Disable emission of the dwarf sections, but allow directives.
Summary:
Added an option that allows to emit only '.loc' and '.file' kind debug
directives, but disables emission of the DWARF sections. Required for
NVPTX target to support profiling. It requires '.loc' and '.file'
directives, but does not require any DWARF sections for the profiler.

Reviewers: probinson, echristo, dblaikie

Subscribers: aprantl, JDevlieghere, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338616 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-01 19:38:20 +00:00
Michael Berg
a227166d0e [NFC] small addendum to r334242, FMF propagation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338604 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-01 18:06:49 +00:00
Sanjay Patel
8fe02fad97 [SelectionDAG] fix bug in translating funnel shift with non-power-of-2 type
The bug is visible in the constant-folded x86 tests. We can't use the
negated shift amount when the type is not power-of-2:
https://rise4fun.com/Alive/US1r

...so in that case, use the regular lowering that includes a select
to guard against a shift-by-bitwidth. This path is improved by only
calculating the modulo shift amount once now.

Also, improve the rotate (with power-of-2 size) lowering to use
a negate rather than subtract from bitwidth. This improves the
codegen whether we have a rotate instruction or not (although
we can still see that we're not matching to a legal rotate in
all cases).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338592 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-01 17:17:08 +00:00
Simon Pilgrim
a2d22f73a3 [SelectionDAG] Make binop reduction matcher available to all targets
There is nothing x86-specific about this code, so it'd be nice to make this available for other targets to use in the future (and get it out of X86ISelLowering!).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338586 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-01 16:52:28 +00:00
Cameron McInally
682f0ada21 [FPEnv] Widen illegal width StrictFP vector operations as needed
Differential Revision: https://reviews.llvm.org/D49806



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338562 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-01 14:17:19 +00:00
Jonas Devlieghere
6c7ea834f8 [MC] Report fatal error for DWARF types for non-ELF object files
Getting the DWARF types section is only implemented for ELF object
files. We already disabled emitting debug types in clang (r337717), but
now we also report an fatal error (rather than crashing) when trying to
obtain this section in MC. Additionally we ignore the generate debug
types flag for unsupported target triples.

See PR38190 for more information.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338527 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-01 12:53:06 +00:00
Victor Leschuk
6f455447cb [DWARF] Basic support for producing DWARFv5 .debug_addr section
This revision implements support for generating DWARFv5 .debug_addr section.
The implementation is pretty straight-forward: we just check the dwarf version
and emit section header if needed.

Reviewers: aprantl, dblaikie, probinson

Reviewed by: dblaikie

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338487 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-01 05:48:06 +00:00
Amara Emerson
59a658d8e2 [GlobalISel][IRTranslator] Use RPO traversal when visiting blocks to translate.
Previously we were just visiting the blocks in the function in IR order, which
is rather arbitrary. Therefore we wouldn't always visit defs before uses, but
the translation code relies on this assumption in some places.

Only codegen change seen in tests is an elision of a redundant copy.

Fixes PR38396

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338476 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-01 02:17:42 +00:00
Eric Christopher
5311a6ea83 Simplify selectELFSectionForGlobal by pulling out the entry size
determination for mergeable sections into a small static function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338469 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-01 01:29:30 +00:00
Eric Christopher
bf9b77d2fa Tidy up logic around unique section name creation and remove a
mostly unused variable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338468 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-01 01:03:34 +00:00
Eli Friedman
a3904966ff [MachineOutliner] Clean up subtarget handling.
Call shouldOutlineFromFunctionByDefault, isFunctionSafeToOutlineFrom,
getOutliningType, and getMachineOutlinerMBBFlags using the correct
TargetInstrInfo. And don't create a MachineFunction for a function
declaration.

The call to getOutliningCandidateInfo is still a little weird, but at
least the weirdness is explicitly called out.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338465 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-01 00:37:20 +00:00
Wolfgang Pieb
7cef9e8fc8 [DWARF] Do not create a .debug_ranges section when no ranges are needed.
Reviewers: aprantl

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338437 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-31 20:56:32 +00:00
Matt Arsenault
e946b0193e DAG: Correct pointer type used for stack slot
Correct the address space for the inserted argument
stack slot.

AMDGPU seems to not do anything with this information,
so I don't think this was breaking anything.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338428 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-31 19:51:20 +00:00
Vlad Tsyrklevich
bee8996fbd Revert "[DebugInfo] Generate DWARF debug information for labels."
This reverts commits r338390 and r338398, they were causing LSan
failures on the ASan bot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338408 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-31 18:10:37 +00:00
Hsiangkai Wang
f03f9e8cd4 [DebugInfo] Generate DWARF debug information for labels.
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@338390 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-31 14:48:32 +00:00
Matt Arsenault
48e2f47300 DAG: Fix PromoteFloatResult for fcanonicalize
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338382 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-31 14:15:22 +00:00
Hsiangkai Wang
d8319b3d66 Test commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338352 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-31 06:09:29 +00:00
Amara Emerson
be764dbd77 [GlobalISel] Add a G_BLOCK_ADDR opcode to handle IR blockaddress constants.
Differential Revision: https://reviews.llvm.org/D49900

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338335 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-31 00:08:50 +00:00
Craig Topper
4a5776cc93 [DAGCombiner][TargetLowering] Pass a SmallVector instead of a std::vector to BuildSDIV/BuildUDIV/etc.
The vector contains the SDNodes that these functions create. The number of nodes is always a small number so we should use SmallVector to avoid a heap allocation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338329 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-30 23:22:00 +00:00
Sanjay Patel
648b708c20 [DAGCombiner] transform sub-of-shifted-signbit to add
This is exchanging a sub-of-1 with add-of-minus-1:
https://rise4fun.com/Alive/plKAH

This is another step towards improving select-of-constants codegen (see D48970).

x86 is the motivating target, and those diffs all appear to be wins. PPC and AArch64 look neutral.
I've limited this to early combining (!LegalOperations) in case a target wants to reverse it, but
I think canonicalizing to 'add' is more likely to produce further transforms because we have more
folds for 'add'.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338317 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-30 22:21:37 +00:00
Craig Topper
e9f23bb5b1 [TargetLowering] In BuildSDIV, add the MULHS/SMUL_LOHI to the Created vector.
BuildUDIV was already correct.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338304 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-30 21:04:38 +00:00
Craig Topper
f264341a83 [DAGCombiner][PowerPC][AArch64] Pass Created vector by reference to BuildSDIVPow2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338303 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-30 21:04:34 +00:00
Craig Topper
3e5ff18867 Revert r338222 "[DAGCombiner] Remove unnecessary calls to AddToWorklist."
Thinking about it more it might be possible for the later nodes to be folded in getNode in such a way that the other created nodes are left dead. This can cause use counts to be incorrect on nodes that aren't dead.

So its probably safer to leave this alone.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338298 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-30 20:27:10 +00:00
Fangrui Song
af7b1832a0 Remove trailing space
sed -Ei 's/[[:space:]]+$//' include/**/*.{def,h,td} lib/**/*.{cpp,h}

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338293 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-30 19:41:25 +00:00
David Bolvansky
44dc58d645 [DAGCombiner] Bug 31275- Extract a shift from a constant mul or udiv if a rotate can be formed
Summary:
Attempt to extract a shrl from a udiv or a shl from a mul if this allows a rotate to be formed.  This targets cases where the input to a rotate pattern was a mul or udiv by a constant and InstCombine merged one of the shifts with the op.

Patch by: sameconrad (Sam Conrad)

Reviewers: RKSimon, craig.topper, spatel, lebedev.ri, javed.absar

Reviewed By: lebedev.ri

Subscribers: efriedma, kparzysz, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338270 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-30 16:50:00 +00:00
Thomas Preud'homme
005ad0240a Reapply "Fix crash on inline asm with 64bit matching input in 32bit GPR"
This reapplies commit r338206 reverted by r338214 since the bug that
r338206 uncovered has been fixed in r338268.

Add support for inline assembly with matching input operand that do not
naturally go in the register class it is constrained to (eg. double in a
32-bit GPR). Note that regular input is already handled by existing
code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338269 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-30 16:48:39 +00:00
Karl-Johan Karlsson
ec18b801a3 [RegisterScavenger] Fix debug print
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338231 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-30 08:17:00 +00:00
Craig Topper
28b397746c [DAGCombiner] Remove unnecessary calls to AddToWorklist.
The DAGCombiner has a mechanism for ensuring all nodes have been visited at least once. Every time a node is visited, it makes sure its operands have been in the worklist at least once. This ensures that when multiple nodes are created by a combine, only the last node needs to be returned. The earlier nodes can all be found Through this operand check. These means we don't need to explicitly add nodes to the worklist when a combine creates multiple nodes.

I've removed the most obvious cases here. There are probably more than can be removed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338222 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-29 18:39:26 +00:00
Sanjay Patel
04eda8fb6f revert r338206 because the test does not pass
Example of bot failure:
http://lab.llvm.org:8011/builders/clang-cmake-armv8-quick/builds/5107/steps/ninja%20check%201/logs/FAIL%3A%20LLVM%3A%3Ainline-asm-operand-implicit-cast.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338214 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-29 14:30:49 +00:00
Thomas Preud'homme
789dd7b805 Fix crash on inline asm with 64bit matching input in 32bit GPR
Add support for inline assembly with matching input operand that do not
naturally go in the register class it is constrained to (eg. double in a
32-bit GPR). Note that regular input is already handled by existing
code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338206 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-28 21:33:39 +00:00
Craig Topper
acb4985d70 [SelectionDAG] Pass std::vector by reference instead of by pointer to BuildSDIV/BuildUDIV.
This removes the need for an assert to ensure the pointer isn't null.

Years ago we had ifs the checked the pointer was non-null before very access to the vector. These checks were removed and replaced with a single assert. But a reference seems more suitable here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338205 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-28 19:44:20 +00:00
Matt Arsenault
f02d879e99 DAG: Add calling convention argument to calling convention funcs
This seems like a pretty glaring omission, and AMDGPU
wants to treat kernels differently from other calling
conventions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338194 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-28 13:25:19 +00:00
Craig Topper
fefdba1e17 [DAGCombiner] Teach DAG combiner that A-(B-C) can be folded to A+(C-B)
This can be useful since addition is commutable, and subtraction is not.

This matches a transform that is also done by InstCombine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338181 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-28 00:27:25 +00:00
Jessica Paquette
4ec15997d0 [MachineOutliner] Exit getOutliningCandidateInfo when we erase all candidates
There was a missing check for if a candidate list was entirely deleted. This
adds that check.

This fixes an asan failure caused by running test/CodeGen/AArch64/addsub_ext.ll
with the MachineOutliner enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338148 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-27 18:21:57 +00:00
Sanjay Patel
125191a9e0 [DAGCombiner] fold 'not' with signbit math
This is a follow-up suggested in D48970. 

Alive proofs:
https://rise4fun.com/Alive/sII

We can eliminate an instruction in the usual select-of-constants 
to bit hack transform by adjusting the add/sub with constant.
This is always a win. 

There are more transforms that are likely wins, but they may need 
target hooks in case some targets do not benefit. 

This is another step towards making up for canonicalizing to 
select-of-constants in rL331486.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338132 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-27 16:42:55 +00:00
Matt Arsenault
f3b5d6dfcf DAG: Remove unnecessary .str()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338112 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-27 09:04:41 +00:00
Craig Topper
1393b8f6d7 [SelectionDAGBuilder] Add masked loads to PendingLoads rather than calling DAG.setRoot.
Masked loads are calling DAG.getRoot rather than calling SelectionDAGBuilder::getRoot, which means the PendingLoads weren't emptied to update the root and create any needed TokenFactor. So it would be incorrect to call setRoot for the masked load.

This patch instead adds the masked load to PendingLoads so that the root doesn't get update until a store or scatter or something happens.. Alternatively, we could call SelectionDAGBuilder::getRoot before it, but that would create unnecessary serialization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338085 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-26 23:22:11 +00:00
Wolfgang Pieb
c0e32a59ed [DWARF v5] Reposting r337981, which was reverted in r337997 due to a test failure in debuginfo_tests.
The test failure was caused by the compiler not emitting a __debug_ranges section with DWARF 4 and
earlier when no ranges are needed. The test checks for the existence regardless.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338081 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-26 22:48:52 +00:00
Craig Topper
c91e9d7b37 [SelectionDAG] Add MLOAD/MSTORE/MGATHER/MSCATTER to AddNodeIDCustom to properly calculate their folding set ID to allow them to be CSEd.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338080 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-26 22:40:24 +00:00
Craig Topper
afc6e834fe [DAGCombiner] Remove some calls to AddToWorklist that should be unnecessary.
The DAGCombiner has a system for ensuring all nodes are visited. It doesn't require an AddToWorkList for every node that is created by a combine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338079 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-26 22:40:22 +00:00
Tim Renouf
8818f00dd6 [RegisterCoalescer] Fixed inconsistent followCopyChain with subreg
Summary:
The behavior of followCopyChain with a subreg depends on the order in
which subranges appear in a live interval, which is bad.

This commit fixes that, and allows the copy chain to continue only if
all matching subranges that are not undefined take us to the same def.

I don't have a test for this; the reproducer I had on my branch with
various other local changes does not reproduce the problem on upstream
llvm. Also that reproducer was an ll test; attempting to convert it to a
mir test made the subranges appear in a different order and hid the
problem.

However I would argue that the old behavior was obviously wrong
and needs fixing.

Subscribers: MatzeB, qcolombet, llvm-commits

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

Change-Id: Iee7936ef305918f3b498ac432e2cf651ae5cc2df

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338070 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-26 21:27:34 +00:00