149713 Commits

Author SHA1 Message Date
Sanjay Patel
cf2a64aaaf [DAGCombiner] fix load narrowing transform to exclude loads with extension
The extending load possibility was missed in:
https://reviews.llvm.org/rL304072

We might want to handle this cases as a follow-up, but bailing out for now
to avoid miscompiling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304153 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 13:24:58 +00:00
Jonas Paulsson
d31fe92b61 [SystemZ] Improve buildVector() in SystemZISelLowering.cpp.
Use VLREP when inserting one or more loads into a vector. This is more
efficient than to first load and then use a VLVGP.

Review: Ulrich Weigand

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304152 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 13:22:23 +00:00
Mattias Eriksson
4ca30c7c76 Test commit: fix typos
Just fixing a few typos in comments to test commit access.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304149 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 11:46:44 +00:00
Nikolai Bozhenov
404324ef9b [Nios2] Target registration
Reviewers: craig.topper, hfinkel, joerg, lattner, zvi

Reviewed By: craig.topper

Subscribers: oren_ben_simhon, igorb, belickim, tvvikram, mgorny, llvm-commits, pavel.v.chupin, DavidKreitzer

Differential Revision: https://reviews.llvm.org/D32669
Patch by AndreiGrischenko <andrei.l.grischenko@intel.com>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304144 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 09:48:30 +00:00
Diana Picus
a67ba2c9a1 [ARM] GlobalISel: Extract helper. NFCI.
Create a helper to deal with the common code for merging incoming values
together after they've been split during call lowering. There's likely
more stuff that can be commoned up here, but we'll leave that for later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304143 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 09:09:54 +00:00
Hiroshi Inoue
1c5b81edd4 [trivial] fix a typo in comment, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304139 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 08:37:42 +00:00
Diana Picus
5a31d0a746 [ARM] GlobalISel: Support array returns
These are a bit rare in practice, but they don't require anything
special compared to array parameters, so support them as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304137 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 08:19:19 +00:00
Hiroshi Inoue
2f498526c2 [PPC] Fix assertion failure during binary encoding with -mcpu=pwr9
Summary
clang -c -mcpu=pwr9 test/CodeGen/PowerPC/build-vector-tests.ll causes an assertion failure during the binary encoding.
The failure occurs when a D-form load instruction takes two register operands instead of a register + an immediate.

This patch fixes the problem and also adds an assertion to catch this failure earlier before the binary encoding (i.e. during lit test).
The fix is from Nemanja Ivanovic @nemanjai.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304133 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 07:12:39 +00:00
Diana Picus
0aa64f381a [ARM] GlobalISel: Support array parameters/arguments
Clang coerces structs into arrays, so it's a good idea to support them.
Most of the support boils down to getting the splitToValueTypes helper
to actually split types. We then use G_INSERT/G_EXTRACT to deal with the
parts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304132 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 07:01:52 +00:00
Mehdi Amini
2ef4cb9ee0 DebugInfo: Include .dwo file name when hashing multiple CUs in a single file
This is really a workaround for ThinLTO in particular - since it can
import partial CUs that may end up looking very similar/the same as
the same partial import in another ThinLTO compile.

An alternative fix would be to change the DICompileUnit metadata to
include a "primary file" or the like - and when importing for ThinLTO
set the primary file to the name of the DICompileUnit that is being
imported into. This involves changing the schema and would reduce the
excessive uniqueness in the hash that this change creates - allowing
diagnosing of more duplicate CUs than will be caught with this change.

But duplicate CUs can still be caught in non-ThinLTO builds & are mostly
a nuisance rather than a particularly deliberate/effective tool for
finding broken code. (arguably the hash could always include the dwo
file and nothing in fission would break, I think..)

Reapply of r304119 after adding a triple to the test and moving it
to the X86 directory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304130 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 06:32:34 +00:00
Mehdi Amini
d8c1a8e00d DebugInfo: Omit an empty CU when a subprogram was moved into its use
When the only use of a CU is for a subprogram that's only emitted into
the using CU (to avoid cross-CU references in DWO files), avoid creating
that CU at all.

Reapply of r304111 after adding a triple to the test and moving it
to the X86 directory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304129 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 06:25:30 +00:00
Tobias Grosser
fb50bac10d Revert "[IfConversion] Keep the CFG updated incrementally in IfConvertTriangle"
The reverted change introdued assertions ala:

"MachineBasicBlock::succ_iterator
llvm::MachineBasicBlock::removeSuccessor(succ_iterator, bool): Assertion
`I != Successors.end() && "Not a current successor!"'

Mikael, the original committer, wrote me that he is working on a fix, but that
it likely will take some time to get this resolved. As this bug is one of the
last two issues that keep the AOSP buildbot from turning green, I revert the
original commit r302876.

I am looking forward to see this recommitted after the assertion has been
resolved.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304128 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 06:12:18 +00:00
Mehdi Amini
c91ffc6f56 Revert "DebugInfo: Omit an empty CU when a subprogram was moved into its use"
This reverts commit r304111.
GreenDragon is broken.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304126 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 05:17:57 +00:00
Mehdi Amini
138f19e1de Revert "DebugInfo: Include .dwo file name when hashing multiple CUs in a single file"
This reverts commit r304119 and r304118. GreenDragon is broken.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304125 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 05:17:54 +00:00
Zachary Turner
1fa6eae52d Don't capture a temporary std::string in a StringRef.
This fixes the breakages in llvm-tblgen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304123 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 02:20:12 +00:00
Zachary Turner
5f67424f80 Resubmit "[X86] Adding new LLVM TableGen backend that generates the X86 backend memory folding tables."
This was reverted due to buildbot breakages and I was not familiar
with this code to investigate it.  But while trying to get a
useful backtrace for the author, it turns out the fix was very
obvious.  Resubmitting this patch as is, and will submit the
fix in a followup so that the fix is not hidden in the larger
CL.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304122 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 02:19:37 +00:00
Zachary Turner
0279796588 Revert "[X86] Adding new LLVM TableGen backend that generates the X86 backend memory folding tables."
This reverts commit 28cb1003507f287726f43c771024a1dc102c45fe as well
as all subsequent followups.  llvm-tblgen currently segfaults with
this change, and it seems it has been broken on the bots all
day with no fixes in preparation.  See, for example:

http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304121 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 01:48:53 +00:00
Galina Kistanova
800305e39a Disabled implicit-fallthrough warnings for ConvertUTF.cpp.
ConvertUTF.cpp has a little dependency on LLVM, and since the code extensively uses fall-through switches,
I prefer disabling the warning for the whole file, rather than adding attributes for each case.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304120 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 01:34:26 +00:00
David Blaikie
266f4ffb5d DebugInfo: Include .dwo file name when hashing multiple CUs in a single file
This is really a workaround for ThinLTO in particular - since it can
import partial CUs that may end up looking very similar/the same as
the same partial import in another ThinLTO compile.

An alternative fix would be to change the DICompileUnit metadata to
include a "primary file" or the like - and when importing for ThinLTO
set the primary file to the name of the DICompileUnit that is being
imported into. This involves changing the schema and would reduce the
excessive uniqueness in the hash that this change creates - allowing
diagnosing of more duplicate CUs than will be caught with this change.

But duplicate CUs can still be caught in non-ThinLTO builds & are mostly
a nuisance rather than a particularly deliberate/effective tool for
finding broken code. (arguably the hash could always include the dwo
file and nothing in fission would break, I think..)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304119 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 00:48:45 +00:00
David Blaikie
ea7381b5bd Attempt to fix buildbots...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304118 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 00:24:01 +00:00
Saleem Abdulrasool
9ad104d71d Support: adjust the default obj format for wasm
WebAssemly uses a custom object file format.  For the wasm targets,
default to the `Wasm` object file format.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304117 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 00:14:57 +00:00
Dylan McKay
87801d8b92 [AVR] Remove SREG from CPI's Uses; authored by Florian Zeitz
Summary: CPI does not read the status register, but only writes it.

Reviewers: dylanmckay

Reviewed By: dylanmckay

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304116 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 00:10:14 +00:00
Craig Topper
1cd10499fc [TableGen][X86] Fix formatting I accidentally messed up in r304099. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304115 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-28 23:47:17 +00:00
Erik Pilkington
1e9ed47d14 [ItaniumDemangle] Fix a exponential string copying bug
This is a port of libcxxabi's r304113.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304114 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-28 23:24:52 +00:00
NAKAMURA Takumi
a505cdf463 Prune trailing whitespace. (To regenerate makefiles)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304112 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-28 22:54:25 +00:00
David Blaikie
22bea2c1f6 DebugInfo: Omit an empty CU when a subprogram was moved into its use
When the only use of a CU is for a subprogram that's only emitted into
the using CU (to avoid cross-CU references in DWO files), avoid creating
that CU at all.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304111 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-28 22:51:37 +00:00
Geoff Berry
bb4561917a [AArch64][Falkor] Combine sched details files into one. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304109 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-28 22:20:44 +00:00
Geoff Berry
d2258e404d [AArch64][Falkor] Fix some sched details.
- Remove all uses of base sched model entries and set them all to
  Unsupported so all the opcodes are described in
  AArch64SchedFalkorDetails.td.
- Remove entries for unsupported half-float opcodes.
- Remove entries for unsupported LSE extension opcodes.
- Add entry for MOVbaseTLS (and set Sched in base td file entry to
  WriteSys) and a few other pseudo ops.
- Fix a few FP load/store with reg offset entries to use the LSLfast
  predicates.
- Add Q size BIF/BIT/BSL entries.
- Fix swapped Q/D sized CLS/CLZ/CNT/RBIT entires.
- Fix pre/post increment address register latency (this operand is
  always dest 0).
- Fix swapped FCVTHD/FCVTHS/FCVTDH/FCVTDS entries.
- Fix XYZ resource over usage on LD[1-4] opcodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304108 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-28 21:48:31 +00:00
Craig Topper
7193e15c38 [TableGen][X86] Use CHAR_BIT with sizeof instead of hardcoded 8. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304100 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-28 18:24:43 +00:00
Craig Topper
d60f6d272b [TableGen][X86] Mark a couple global tables as const. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304099 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-28 18:24:41 +00:00
Craig Topper
3d21edd814 [TableGen][X86] Improve formatting of the fold table output by indenting the body of the table and adding blank lines between tables. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304098 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-28 18:24:39 +00:00
Craig Topper
8595928974 [TableGen][X86] Add an llvm_unreachable to a switch so we get an error if we need expansion in the future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304097 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-28 18:24:37 +00:00
Craig Topper
c10cab0683 [TableGen][X86] Remove unnecessary std::string creations. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304096 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-28 18:24:35 +00:00
Craig Topper
3443b3b2d8 [TableGen][X86] Replace a global std::vector with a regular array. llvm::find works on arrays, just need to use std::end to check the result.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304095 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-28 18:24:32 +00:00
Craig Topper
fb26ad64d8 [TableGen][X86] getValueAsString returns a std::string not a StringRef. Capture it that way to avoid a StringRef to a temporary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304093 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-28 17:48:41 +00:00
Sanjay Patel
206b68cd0d [x86] auto-generate better checks; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304090 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-28 13:57:59 +00:00
Benjamin Kramer
0dbb1537bc [InstrProf] Use more ArrayRef/StringRef.
No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304089 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-28 13:23:02 +00:00
Ayman Musa
0ccceac14c [X86] Adding new LLVM TableGen backend that generates the X86 backend memory folding tables.
X86 backend holds huge tables in order to map between the register and memory forms of each instruction.
This TableGen Backend automatically generated all these tables with the appropriate flags for each entry.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304088 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-28 12:55:36 +00:00
Ayman Musa
09d9f45186 [X86] Adding FoldGenRegForm helper field (for memory folding tables tableGen backend) to X86Inst class and set its value for the relevant instructions.
Some register-register instructions can be encoded in 2 different ways, this happens when 2 register operands can be folded (separately). 
For example if we look at the MOV8rr and MOV8rr_REV, both instructions perform exactly the same operation, but are encoded differently. Here is the relevant information about these instructions from Intel's 64-ia-32-architectures-software-developer-manual:

Opcode  Instruction  Op/En  64-Bit Mode  Compat/Leg Mode  Description
8A /r   MOV r8,r/m8  RM     Valid        Valid            Move r/m8 to r8.
88 /r   MOV r/m8,r8  MR     Valid        Valid            Move r8 to r/m8.
Here we can see that in order to enable the folding of the output and input registers, we had to define 2 "encodings", and as a result we got 2 move 8-bit register-register instructions.

In the X86 backend, we define both of these instructions, usually one has a regular name (MOV8rr) while the other has "_REV" suffix (MOV8rr_REV), must be marked with isCodeGenOnly flag and is not emitted from CodeGen.

Automatically generating the memory folding tables relies on matching encodings of instructions, but in these cases where we want to map both memory forms of the mov 8-bit (MOV8rm & MOV8mr) to MOV8rr (not to MOV8rr_REV) we have to somehow point from the MOV8rr_REV to the "regular" appropriate instruction which in this case is MOV8rr.

This field enable this "pointing" mechanism - which is used in the TableGen backend for generating memory folding tables.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304087 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-28 12:39:37 +00:00
Oren Ben Simhon
3a87b52179 [X86] Fixing VPOPCNTDQ feature set lookup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304086 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-28 11:26:11 +00:00
Galina Kistanova
74cf5860af Reverted r304083 as it seems there is a desire to address this in the googletest.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304084 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-28 05:50:22 +00:00
Galina Kistanova
3eda9f25f3 Added braces to address gcc warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else]. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304083 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-28 03:50:52 +00:00
David Blaikie
f1e232d9b0 DebugInfo: Add source code/build instructions for split-dwarf-dwp symbolizer test
Addressing post-commit code review feedback from Paul Robinson on
r303609.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304080 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-27 19:52:20 +00:00
Gor Nishanov
c60a982fd5 Cloning: Fix debug info cloning
Summary:
I believe https://reviews.llvm.org/rL302576 introduced two bugs:

1) it produces duplicate distinct variables for every: dbg.value describing the same variable.
    To fix the problme I switched form getDistinct() to get() in DebugLoc.cpp: auto reparentVar = [&](DILocalVariable *Var) {
    return DILocalVariable::getDistinct(

2) It passes NewFunction plain name as a linkagename parameter to Subprogram constructor. Breaks assert in:

 || DeclLinkageName.empty()) || LinkageName == DeclLinkageName) && "decl has a linkage name and it is different"' failed.
#9 0x00007f5010261b75 llvm::DwarfUnit::applySubprogramDefinitionAttributes(llvm::DISubprogram const*, llvm::DIE&) /home/gor/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp:1173:3
#
(Edit: reproducer added)

Here how https://reviews.llvm.org/rL302576 broke coroutine debug info.
Coroutine body of the original function is split into several parts by cloning and removing unneeded code.
All parts describe the original function and variables present in the original function.

For a simple case, prior to Split, original function has these two blocks:

```
PostSpill:                                        ; preds = %AllocaSpillBB
  call void @llvm.dbg.value(metadata i32 %x, i64 0, metadata !14, metadata !15), !dbg !13
  store i32 %x, i32* %x.addr, align 4
  ...
and

sw.epilog:                                        ; preds = %sw.bb
  %x.addr.reload.addr = getelementptr inbounds %f.Frame, %f.Frame* %FramePtr, i32 0, i32 4, !dbg !20
  %4 = load i32, i32* %x.addr.reload.addr, align 4, !dbg !20
  call void @llvm.dbg.value(metadata i32 %4, i64 0, metadata !14, metadata !15), !dbg !13

!14 = !DILocalVariable(name: "x", arg: 1, scope: !6, file: !7, line: 55, type: !11)

```

Note that in two blocks different expression represent the same original user variable X.

Before rL302576, for every cloned function there was exactly one cloned DILocalVariable(name: "x" as in:

```
define i8* @f(i32 %x) #0 !dbg !6 {
  ...
!6 = distinct !DISubprogram(name: "f", scope: !7, file: !7, line: 55, type: !8, isLocal: false, isDefinition: true, scopeLine: 55, flags: DIFlagPrototyped,
...
!14 = !DILocalVariable(name: "x", arg: 1, scope: !6, file: !7, line: 55, type: !11)

define internal fastcc void @f.resume(%f.Frame* %FramePtr) #0 !dbg !25 {
...
!25 = distinct !DISubprogram(name: "f", scope: !7, file: !7, line: 55, type: !8, isLocal: false, isDefinition: true, scopeLine: 55, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
!28 = !DILocalVariable(name: "x", arg: 1, scope: !25, file: !7, line: 55, type: !11)
```
After rL302576, for every cloned function there were as many DILocalVariable(name: "x" as there were "call void @llvm.dbg.value" for that variable.
This was causing asserts in VerifyDebugInfo and AssemblyPrinter.

Example:

```
!27 = distinct !DISubprogram(name: "f", linkageName: "f.resume", scope: !7, file: !7, line: 55, type: !8, isLocal: false, isDefinition: true, scopeLine: 55,
!29 = distinct !DILocalVariable(name: "x", arg: 1, scope: !27, file: !7, line: 55, type: !11)
!39 = distinct !DILocalVariable(name: "x", arg: 1, scope: !27, file: !7, line: 55, type: !11)
!41 = distinct !DILocalVariable(name: "x", arg: 1, scope: !27, file: !7, line: 55, type: !11)
```

Second problem:

Prior to rL302576, all clones were described by DISubprogram referring to original function.

```
define i8* @f(i32 %x) #0 !dbg !6 {
...
!6 = distinct !DISubprogram(name: "f", scope: !7, file: !7, line: 55, type: !8, isLocal: false, isDefinition: true, scopeLine: 55, flags: DIFlagPrototyped,

define internal fastcc void @f.resume(%f.Frame* %FramePtr) #0 !dbg !25 {
...
!25 = distinct !DISubprogram(name: "f", scope: !7, file: !7, line: 55, type: !8, isLocal: false, isDefinition: true, scopeLine: 55, flags: DIFlagPrototyped,
```

After rL302576, DISubprogram for clones is of two minds, plain name refers to the original name, linkageName refers to plain name of the clone.

```
!27 = distinct !DISubprogram(name: "f", linkageName: "f.resume", scope: !7, file: !7, line: 55, type: !8, isLocal: false, isDefinition: true, scopeLine: 55,
```

I think the assumption in AsmPrinter is that both name and linkageName should refer to the same entity. It asserts here when they are not:

```
 || DeclLinkageName.empty()) || LinkageName == DeclLinkageName) && "decl has a linkage name and it is different"' failed.
#9 0x00007f5010261b75 llvm::DwarfUnit::applySubprogramDefinitionAttributes(llvm::DISubprogram const*, llvm::DIE&) /home/gor/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp:1173:3
```
After this fix, behavior (with respect to coroutines) reverts to exactly as it was before and therefore making them debuggable again, or even more importantly, compilable, with "-g"

Reviewers: dblaikie, echristo, aprantl

Reviewed By: dblaikie

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304079 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-27 19:41:09 +00:00
George Rimar
b5ac7008b1 Recommit "[DWARF] - Make collectAddressRanges() return section index in addition to Low/High PC"
With fix of uninitialized variable.

Original commit message:

This change is intended to use for LLD in D33183. 
Problem we have in LLD when building .gdb_index is that we need to know section which address range belongs to.

Previously it was solved on LLD side by providing fake section addresses with use of llvm::LoadedObjectInfo
interface. We assigned file offsets as addressed. Then after obtaining ranges lists, for each range we had to find section ID's.
That not only was slow, but also complicated implementation and was the reason of incorrect behavior when
sections share the same offsets, like D33176 shows.

This patch makes DWARF parsers to return section index as well. That solves problem mentioned above.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304078 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-27 18:10:23 +00:00
Craig Topper
67886788e2 [TableGen] Prevent DagInit from leaking its Args and ArgNames when they exceed the size of the SmallVector.
DagInits are allocated in a BumpPtrAllocator so they are never destructed. This means the destructor for the SmallVector never runs.

To fix this we now allocate the vectors in the BumpPtrAllocator too using TrailingObjects.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304077 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-27 17:36:50 +00:00
Craig Topper
8e1db259e8 [TableGen] Use the correct type for the first template for the ListInit TrailingObjects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304076 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-27 17:36:47 +00:00
Tobias Grosser
4439d654fd [SCEV] Assume parameters coming from function calls contain IVs
The optimistic delinearization implemented in LLVM detects array sizes by
looking for non-linear products between parameters and induction variables.
In OpenCL code, such products often look like:

  A[get_global_id(0) * N + get_global_id(1)]

Hence, the IV is hidden in the get_global_id() call and consequently
delinearization would fail as no induction variable is available that helps
us to identify N as array size parameter.

We now use a very simple heuristic to change this. We assume that each parameter
that comes directly from a function call is a hidden induction variable. As
a result, we can delinearize the access above to:

  A[get_global_id(0)][get_global_id(1]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304073 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-27 15:17:49 +00:00
Sanjay Patel
8cbe21fcdd [DAGCombiner] use narrow load to avoid vector extract
If we have (extract_subvector(load wide vector)) with no other users, 
that can just be (load narrow vector). This is intentionally conservative.
Follow-ups may loosen the one-use constraint to account for the extract cost
or just remove the one-use check.

The memop chain updating is based on code that already exists multiple times
in x86 lowering, so that should be pulled into a helper function as a follow-up.

Background: this is a potential improvement noticed via regressions caused by
making x86's peekThroughBitcasts() not loop on consecutive bitcasts (see 
comments in D33137).

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304072 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-27 14:07:03 +00:00
Craig Topper
f6f10854e2 [TableGen] Remove all the static vectors named TheActualPool.
These used to hold std::unique_ptrs that managed the allocation for the various *Init object so that they would be deleted on exit. Everything is allocated in a BumpPtrAllocator name so there is no reason for these to still exist.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304066 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-27 06:14:12 +00:00