Commit Graph

156927 Commits

Author SHA1 Message Date
Mohammed Agabaria
89ec3b09eb [TTI][X86] update costs of interleaved load\store of i64\double
This patch contains more accurate cost of interelaved load\store of stride 2 for the types int64\double on AVX2.

Reviewers: delena, RKSimon, craig.topper, dorit

Reviewed By: dorit

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318385 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16 09:38:32 +00:00
Mikael Holmen
920531cc2b [MachineRegisterInfo] Avoid having dbg.values affect code generation
Summary:
Use use_nodbg_empty() rather than use_empty() in
MachineRegisterInfo::EmitLiveInCopies() when determining if a livein
register has any uses or not. Otherwise a single dbg.value can make us
generate different code, meaning -g would affect code generation.

Found when compiling code for my out-of-tree target. Unfortunately I
haven't been able to reproduce the problem on X86 or any of the other
in-tree targets that I tried, so no test case.

Reviewers: MatzeB

Reviewed By: MatzeB

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318382 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16 07:01:23 +00:00
Max Kazantsev
63a8861896 [IRCE] Fix SCEVExpander's usage in IRCE
When expanding exit conditions for pre- and postloops, we may end up expanding a
recurrency from the loop to in its loop's preheader. This produces incorrect IR.

This patch ensures that IRCE uses SCEVExpander correctly and only expands code which
is safe to expand in this particular location.

Differentian Revision: https://reviews.llvm.org/D39234


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318381 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16 06:06:27 +00:00
Craig Topper
7ddaab8764 [X86] Update TTI to report that v1iX/v1fX types aren't legal for masked gather/scatter/load/store.
The type legalizer will try to scalarize these operations if it sees them, but there is no handling for scalarizing them. This leads to a fatal error. With this change they will now be scalarized by the mem intrinsic scalarizing pass before SelectionDAG.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318380 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16 06:02:05 +00:00
Craig Topper
0761a60a58 [SelectionDAG] Use report_fatal_error instead of llvm_unreachable in some code that can be reached if targets don't configure things correctly.
For example, this is currently reachable by X86 if you use a masked store intrinsic with a v1iX type.

Using a fatal error seems like a better user experience if someone were to encounter this on a release build. There are several other similar places that have been converted from unreachable to fatal error previously.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318379 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16 06:02:03 +00:00
Max Kazantsev
cb0def446f [SCEV][NFC] Introduce isSafeToExpandAt function to SCEVExpander
This function checks that:
1) It is safe to expand a SCEV;
2) It is OK to materialize it at the specified location.
For example, attempt to expand a loop's AddRec to the same loop's preheader should fail.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318377 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16 05:10:56 +00:00
Eric Christopher
74e1e11745 Fix thinko in last commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318374 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16 03:25:02 +00:00
Eric Christopher
ea5836a7a6 Add NDEBUG checks around LLVM_DUMP_METHOD functions for Wunused-function warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318373 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16 03:18:15 +00:00
Eric Christopher
c9fbb168a9 Need to work around the gcc Wunused-function bug as far back as gcc 6.1, update accordingly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318372 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16 03:18:13 +00:00
Yaxun Liu
23c0fc7405 Fix APInt bit size in processDbgDeclares
processDbgDeclares assumes pointer size is the same for different addr spaces.
It uses pointer size for addr space 0 for all pointers, which causes assertion
in stripAndAccumulateInBoundsConstantOffsets for amdgcn---amdgiz since
pointer in addr space 5 has different size than in addr space 0.

This patch fixes that.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318370 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16 02:54:49 +00:00
Evgeniy Stepanov
0b6f500673 [asan] Fallback to non-ifunc dynamic shadow on android<22.
Summary: Android < 22 does not support ifunc.

Reviewers: pcc

Subscribers: srhines, kubamracek, hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318369 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16 02:52:19 +00:00
Craig Topper
0a36dc407e [X86] Custom type legalize v2f32 masked gathers instead of trying to cleanup after type legalization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318368 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16 02:07:45 +00:00
Bob Haarman
f349107e55 LTO: clarify why we need to gracefully handle sys::fs::rename failures
Reviewers: pcc, rafael

Reviewed By: pcc

Subscribers: mehdi_amini, llvm-commits, hiraditya

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318362 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16 01:16:52 +00:00
Rafael Espindola
d0222efb19 Convert a use of createUniqueFile to TempFile::create.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318361 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16 01:06:36 +00:00
Yonghong Song
0df1955fdb bpf: enable llvm-objdump to print out symbolized jmp target
Add hook in BPF backend so that llvm-objdump can print out
the jmp target with label names, e.g.,
  ...
  if r1 != 2 goto 6 <LBB0_2>
  ...
  goto 7 <LBB0_4>
  ...
 LBB0_2:
  ...
 LBB0_4:
  ...

Signed-off-by: Yonghong Song <yhs@fb.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318358 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16 00:52:30 +00:00
Daniel Sanders
64b77007a6 [globalisel][tablegen] Generate rule coverage and use it to identify untested rules
Summary:
This patch adds a LLVM_ENABLE_GISEL_COV which, like LLVM_ENABLE_DAGISEL_COV,
causes TableGen to instrument the generated table to collect rule coverage
information. However, LLVM_ENABLE_GISEL_COV goes a bit further than
LLVM_ENABLE_DAGISEL_COV. The information is written to files
(${CMAKE_BINARY_DIR}/gisel-coverage-* by default). These files can then be
concatenated into ${LLVM_GISEL_COV_PREFIX}-all after which TableGen will
read this information and use it to emit warnings about untested rules.

This technique could also be used by SelectionDAG and can be further
extended to detect hot rules and give them priority over colder rules.

Usage:
* Enable LLVM_ENABLE_GISEL_COV in CMake
* Build the compiler and run some tests
* cat gisel-coverage-[0-9]* > gisel-coverage-all
* Delete lib/Target/*/*GenGlobalISel.inc*
* Build the compiler

Known issues:
* ${LLVM_GISEL_COV_PREFIX}-all must be generated as a manual
  step due to a lack of a portable 'cat' command. It should be the
  concatenation of all ${LLVM_GISEL_COV_PREFIX}-[0-9]* files.
* There's no mechanism to discard coverage information when the ruleset
  changes

Depends on D39742

Reviewers: ab, qcolombet, t.p.northover, aditya_nandakumar, rovka

Reviewed By: rovka

Subscribers: vsk, arsenm, nhaehnle, mgorny, kristof.beyls, javed.absar, igorb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318356 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16 00:46:35 +00:00
Reid Kleckner
93d7d4e1d2 Try to fix WebAssembly build after r318352
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318355 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16 00:32:19 +00:00
Craig Topper
41838463b3 [GVNHoist] Fix a signed/unsigned comparison warning that occurs in 32-bit builds with gcc.
std::distance returns ptrdiff_t which is signed. 64-bit builds don't notice because type promotion widens the unsigned first.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318354 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16 00:19:59 +00:00
Rong Xu
573c3541f3 [CodeGen] Fix the branch probability assertion in r318202
Due to integer precision, we might have numerator greater than denominator in
the branch probability scaling. Add a check to prevent this from happening.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318353 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16 00:14:05 +00:00
Daniel Sanders
355825a81e Add backend name to Target to enable runtime info to be fed back into TableGen
Summary:
Make it possible to feed runtime information back to tablegen to enable
profile-guided tablegen-eration, detection of untested tablegen definitions, etc.

Being a cross-compiler by nature, LLVM will potentially collect data for multiple
architectures (e.g. when running 'ninja check'). We therefore need a way for
TableGen to figure out what data applies to the backend it is generating at the
time. This patch achieves that by including the name of the 'def X : Target ...'
for the backend in the TargetRegistry.

Reviewers: qcolombet

Reviewed By: qcolombet

Subscribers: jholewinski, arsenm, jyknight, aditya_nandakumar, sdardis, nemanjai, ab, nhaehnle, t.p.northover, javed.absar, qcolombet, llvm-commits, fedor.sergeev

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318352 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 23:55:44 +00:00
Evandro Menezes
c39780185f [AArch64] Adjust the cost model for Exynos M1 and M2
Fix the modeling of FP stores.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318351 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 23:49:58 +00:00
Aditya Nandakumar
e6aaf10a30 [GISel][NFC]: Move getOpcodeDef from the LegalizationArtifactCombiner into GlobalISel/Utils for use elsewhere
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318350 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 23:45:04 +00:00
Sanjay Patel
512f338d01 [InstCombine] add sub narrowing tests; NFC
This might be the root cause of PR35295:
https://bugs.llvm.org/show_bug.cgi?id=35295


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318342 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 22:19:55 +00:00
Matt Arsenault
710e9b3dae AMDGPU: Replace i64 add/sub lowering
Use VOP3 add/addc like usual.

This has some tradeoffs. Inline immediates fold
a little better, but other constants are worse off.
SIShrinkInstructions could be made smarter to handle
these cases.

This allows us to avoid selecting scalar adds where we
need to track the carry in scc and replace its users.
This makes it easier to use the carryless VALU adds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318340 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 21:51:43 +00:00
Dan Gohman
9b78b26b27 [WebAssembly] Update cfg-stackify.ll to remove the workaround added in r318288.
Remove -switch-peel-threshold=100 and update the expected results in test10
in cfg-stackify.ll.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318338 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 21:38:33 +00:00
Evandro Menezes
6bce9f6182 [AArch64] Refactor the loads and stores optimizer
Move remaining inline matching of instructions of some optimizations into
separate functions, like in the other optimizations.  Otherwise, NFC.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318335 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 21:06:22 +00:00
Rafael Espindola
5feaa63a70 Simplify file handling in dsymutil.
This moves the file handling out of DwarfLinker.cpp.

This fixes what is at least an oddity if not a bug. DwarfLinker.cpp
was using ToolOutputFile, which uses RemoveFileOnSignal. The issue is
that dsymutil.cpp uses that too. It is now clear from the interface
that only dsymutil.cpp is responsible for creating and deleting files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318334 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 20:55:53 +00:00
Craig Topper
9723ed5d6f [X86] Add some explanatory comments to the ProcessorFeatures enum in Host.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318331 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 20:42:49 +00:00
Craig Topper
d3affce9f3 [X86] Add a return to the end of a switch to prevent an accidental fallthrough in the future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318330 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 20:42:47 +00:00
Jake Ehrlich
7198b60643 [llvm-objcopy] Change -O binary to respect section removal and behave like GNU objcopy
The original -O binary implementation just copied segment data from the
object and dumped it into a file. This doesn't take into account any
operations performed on objects such as section removal. GNU objcopy has
some specific behavior that we'd also like to respect. For instance
using -O binary and -j <some_section> will dump <some_section> to a
file. This change implements GNU objcopy style -O binary to as close of
an approximation as I can determine.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318324 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 19:13:31 +00:00
Sanjay Patel
c8be5de456 [InstCombine] trunc (binop X, C) --> binop (trunc X, C')
Note that one-use and shouldChangeType() are checked ahead of the switch.

Without the narrowing folds, we can produce inferior vector code as shown in PR35299:
https://bugs.llvm.org/show_bug.cgi?id=35299



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318323 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 19:12:01 +00:00
Rafael Espindola
58a331a982 Use TempFile in lto caching.
This requires a small change to TempFile: allowing a discard after a
failed keep.

With this the cache now handles signals and reuses a fd instead of
reopening the file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318322 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 19:09:22 +00:00
Sean Fertile
0fe98240bd [PowerPC] Implement mayBeEmittedAsTailCall for PPC
Implements TargetLowering callback 'mayBeEmittedAsTailCall' that enables
CodeGenPrepare to duplicate returns when they might enable a tail-call.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318321 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 18:58:27 +00:00
Reid Kleckner
869a0096cd [InstCombine] Salvage debug info during initial DCE
InstCombine salvages debug info for every instruction it erases from its
worklist, but it wasn't doing it during its initial DCE when populating
its worklist. This fixes that.

This should help improve availability of 'this' in optimized debug info
when casts are necessary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318320 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 18:51:12 +00:00
Sanjay Patel
82de10056f [InstCombine] add tests for missing trunc folds; NFC
As noted in PR35299:
https://bugs.llvm.org/show_bug.cgi?id=35299
...this is likely the root cause for a mis-vectorization transform.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318319 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 18:09:43 +00:00
Vedant Kumar
5e1ec5bede [docs] Mention opt -metarenamer in the bugpoint docs
Thanks to arsenm and davide for the suggestion!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318318 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 18:05:19 +00:00
Evandro Menezes
9c19935acc [AArch64] Adjust the cost model for Exynos M1 and M2
Fix the modeling of loads and stores using the pre or post indexed
addressing modes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318312 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 17:39:37 +00:00
Simon Pilgrim
f640c8e4d8 [X86] Add CBW/CDQ/CDQE/CQO/CWD/CWDE to WriteALU schedule class
Some CPUs are already overriding these sign extension instructions but we should be able to use the WriteALU schedule class by default.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318308 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 17:11:24 +00:00
Adam Nemet
e074ad4a0c [SLP] Added more missed optimization remarks
Summary:
Added more remarks to SLP pass, in particular "missed" optimization remarks.
Also proposed several tests for new functionality.

Patch by Vladimir Miloserdov!

For reference you may look at: https://reviews.llvm.org/rL302811

Reviewers: anemet, fhahn

Reviewed By: anemet

Subscribers: javed.absar, lattner, petecoup, yakush, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318307 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 17:04:53 +00:00
Sean Fertile
73e1b04819 [PowerPC] Split out the tailcall calling convention checks. NFC.
Move the calling convention checks for tail-call eligibility for the 64-bit
SysV ABI into a separate function. This is so that it can be shared with
'mayBeEmittedAsTailCall' in a subsequent change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318305 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 16:53:41 +00:00
Sanjay Patel
d68d614a5d [PassManager, SimplifyCFG] add test for PR34603 / D38566; NFC
This is a recommit of r316908 which was reverted by r317444.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318300 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 16:37:30 +00:00
Sanjay Patel
dda43d9dce [(new) Pass Manager] instantiate SimplifyCFG with the same options as the old PM
This is a recommit of r316869 which was speculatively reverted with r317444 and 
subsequently shown to not be the cause of PR35210. That crash should be fixed
after r318237.

Original commit message:

The old PM sets the options of what used to be known as "latesimplifycfg" on the
instantiation after the vectorizers have run, so that's what we'redoing here.

FWIW, there's a later SimplifyCFGPass instantiation in both PMs where we do not
set the "late" options. I'm not sure if that's intentional or not.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318299 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 16:33:11 +00:00
Sanjay Patel
b7ba7dffa6 [Reassociate] simplify code; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318298 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 16:19:17 +00:00
Sander de Smalen
7e8bb4787f [AArch64][SVE] Asm: Report SVE parsing diagnostics only once
Summary:
Prevent an issue where a diagnostic is reported multiple times by bailing out with a ParseFail if an invalid SVE register element qualifier/suffix is specified, for example:

 <stdin>:10:18: error: invalid sve vector kind qualifier
 add z20.h, z2.h, z31.x
                 ^
 <stdin>:10:18: error: invalid sve vector kind qualifier
 add z20.h, z2.h, z31.x
 
 ...
 
 <stdin>:10:18: error: invalid sve vector kind qualifier
 add z20.h, z2.h, z31.x
                 ^


Reviewers: fhahn, rengolin

Reviewed By: rengolin

Subscribers: aemerson, javed.absar, tschuett, llvm-commits, kristof.beyls

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318297 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 15:44:43 +00:00
Petar Jovanovic
9c8398490b [mips] Improve genConstMult() to work with arbitrary precision
APInt is now used instead of uint64_t in function genConstMult() allowing
multiplication optimizations with constants of arbitrary length.

Patch by Milos Stojanovic.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318296 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 15:24:04 +00:00
Igor Laevsky
b3380b5cf4 [llvm-opt-fuzzer] Add opt fuzzer to the test-depends list.
This should help with the buildbot failures after rL318293.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318295 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 15:07:37 +00:00
Igor Laevsky
9f1a57ce79 [llvm-opt-fuzzer] Only run tests for the x86 target.
This fixes build bot failures after rL318293.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318294 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 13:35:42 +00:00
Igor Laevsky
7de5f26dcd [llvm-opt-fuzzer] NFC. Add sanity tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318293 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 12:36:57 +00:00
Momchil Velikov
29a99e3278 [ARM] Split Arm jump table branch into i12 and rs suffixed versions
This is a refactoring/cleanup of Arm `addrmode2` operand class. The patch
removes it completely.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318291 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 12:02:55 +00:00
Jonas Devlieghere
4dac35da72 [DebugInfo] Fix potential CU mismatch for SubprogramScopeDIEs.
In constructAbstractSubprogramScopeDIE there can be a potential mismatch
between `this` and the CU of ContextDIE when a scope is shared between
two DISubprograms belonging to a different CU. In that case, `this` is
the CU that was specified in the IR, but the CU of ContextDIE is that of
the first subprogram that was emitted. This patch fixes the mismatch by
looking up the CU of ContextDIE, and switching to use that.

This fixes PR35212 (https://bugs.llvm.org/show_bug.cgi?id=35212)

Patch by Philip Craig!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318289 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 10:57:05 +00:00