Commit Graph

7390 Commits

Author SHA1 Message Date
Don Hinton 8f6c93d958 [docs] Put DefaultOption bullet in alphabetical order.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359309 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-26 15:22:21 +00:00
Francis Visoiu Mistrih 2f2940ec9d [Remarks] Fix documentation indentation
Fix the documentation bot:

http://lab.llvm.org:8011/builders/llvm-sphinx-docs/builds/30450/steps/docs-llvm-html/logs/stdio

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359053 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 00:27:59 +00:00
Francis Visoiu Mistrih 04dcbb5165 [Remarks] Add string deduplication using a string table
* Add support for uniquing strings in the remark streamer and emitting the string table in the remarks section.

* Add parsing support for the string table in the RemarkParser.

From this remark:

```
--- !Missed
Pass:     inline
Name:     NoDefinition
DebugLoc: { File: 'test-suite/SingleSource/UnitTests/2002-04-17-PrintfChar.c',
            Line: 7, Column: 3 }
Function: printArgsNoRet
Args:
  - Callee:   printf
  - String:   ' will not be inlined into '
  - Caller:   printArgsNoRet
    DebugLoc: { File: 'test-suite/SingleSource/UnitTests/2002-04-17-PrintfChar.c',
                Line: 6, Column: 0 }
  - String:   ' because its definition is unavailable'
...
```

to:

```
--- !Missed
Pass: 0
Name: 1
DebugLoc: { File: 3, Line: 7, Column: 3 }
Function: 2
Args:
  - Callee:   4
  - String:   5
  - Caller:   2
    DebugLoc: { File: 3, Line: 6, Column: 0 }
  - String:   6
...
```

And the string table in the .remarks/__remarks section containing:

```
inline\0NoDefinition\0printArgsNoRet\0
test-suite/SingleSource/UnitTests/2002-04-17-PrintfChar.c\0printf\0
will not be inlined into \0 because its definition is unavailable\0
```

This is mostly supposed to be used for testing purposes, but it gives us
a 2x reduction in the remark size, and is an incremental change for the
updates to the remarks file format.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359050 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 00:06:24 +00:00
Roman Lebedev 6d4a3cda92 [Docs] ReleaseNotes: fixup markup in memcmp()->bcmp() entry
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358986 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-23 13:46:18 +00:00
Igor Kudrin dac6480dfd [llvm-symbolizer] Add llvm-addr2line
This adds an alias for llvm-symbolizer with different defaults so that
it can be used as a drop-in replacement for GNU's addr2line.

If a substring "addr2line" is found in the tool's name:
  * it defaults "-i", "-f" and "-C" to OFF;
  * it uses "--output-style=GNU" by default.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358749 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-19 10:17:52 +00:00
Igor Kudrin e78c62a4e5 [llvm-symbolizer] Unhide and document the "-output-style" option
With the latest changes, the option gets useful for users of
llvm-symbolizer, not only for the upcoming llvm-addr2line.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358748 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-19 10:14:18 +00:00
Rong Xu 94148739fa [llvm-profdata] Fix one bad format in llvm-profdata CommandGuide doc. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358643 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-18 07:11:05 +00:00
Don Hinton f944830706 [CommandLineParser] Add DefaultOption flag
Summary: Add DefaultOption flag to CommandLineParser which provides a
default option or alias, but allows users to override it for some
other purpose as needed.

Also, add `-h` as a default alias to `-help`, which can be seamlessly
overridden by applications like llvm-objdump and llvm-readobj which
use `-h` as an alias for other options.

(relanding after revert, r358414)
Added DefaultOptions.clear() to reset().

Reviewers: alexfh, klimek

Reviewed By: klimek

Subscribers: kristina, MaskRay, mehdi_amini, inglorion, dexonsmith, hiraditya, llvm-commits, jhenderson, arphaman, cfe-commits

Tags: #clang, #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358428 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-15 17:18:10 +00:00
Ilya Biryukov 14eebb8749 Revert r358337: "[CommandLineParser] Add DefaultOption flag"
The change causes test failures under asan. Reverting to unbreak our
integrate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358414 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-15 14:43:50 +00:00
Jeremy Morse 6ce3cbed7b [Docs] Switch a code block from LLVM to text
While I can't replicate this locally, it looks like the buildbots don't
recognize the IR block in r358385 l764 as IR. Downgrade it to being just
text while I look into it.

http://lab.llvm.org:8011/builders/llvm-sphinx-docs/builds/30132


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358391 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-15 10:23:22 +00:00
Jeremy Morse 4159a62fd3 [Docs] Correct some indentation muppetry that trips buildbots
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358388 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-15 10:04:52 +00:00
Jeremy Morse 24f9633dfe [DebugInfo][Docs] Document variable location metadata transformations
This patch adds documentation explaining how variable location information is
compiled from the IR representation down to the end of the codegen pipeline,
but avoiding discussion of file formats and encoding.

This should make it clearer how the dbg.value / dbg.declare etc intrinsics
are transformed and arranged into DBG_VALUE instructions, and their meaning.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358385 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-15 09:42:38 +00:00
Don Hinton 3f5d54bc7b [CommandLineParser] Add DefaultOption flag
Summary: Add DefaultOption flag to CommandLineParser which provides a
default option or alias, but allows users to override it for some
other purpose as needed.

Also, add `-h` as a default alias to `-help`, which can be seamlessly
overridden by applications like llvm-objdump and llvm-readobj which
use `-h` as an alias for other options.

Reviewers: alexfh, klimek

Reviewed By: klimek

Subscribers: MaskRay, mehdi_amini, inglorion, dexonsmith, hiraditya, llvm-commits, jhenderson, arphaman, cfe-commits

Tags: #clang, #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358337 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-13 16:55:28 +00:00
Zachary Turner 324cbd6cc8 [PDB Docs] Add some prose describing public and global symbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358289 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-12 15:51:40 +00:00
Hans Wennborg c895f8c934 Fix missing arguments in tutorial
In tutorial "8. Kaleidoscope: Compiling to Object Code" a call to
TargetMachine->addPassesToEmitFile(pass, dest, FileType) is missing
nullptr as its 3rd value.

Patch by Sajjad Heydari!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358267 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-12 08:23:28 +00:00
Zachary Turner d3de2ef7e7 Fix sphinx documentation warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358198 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-11 17:30:03 +00:00
Zachary Turner c4ffb0705d [PDB Docs] Add skeleton of documentation for CodeView symbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358197 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-11 17:29:48 +00:00
Kevin P. Neal b3832039a9 New document skeleton describing how to add a constrained floating-point
intrinsic.

Reviewed by:	andrew.w.kaylor, cameron.mcinally
Differential Revision:	https://reviews.llvm.org/D59833


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358194 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-11 17:16:03 +00:00
Hans Wennborg 69455d8a78 try to fix the sphinx build some more
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358156 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-11 07:46:25 +00:00
Hans Wennborg 4c129f6e6c Try to fix the shpinx build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358154 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-11 07:30:56 +00:00
Zachary Turner 091d3974cc [PDB Docs] Start documenting CodeView Type Records.
This puts the general layout of the document in place and fully
describes 1 simple type record.  Followups will fill out more
pieces.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358119 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-10 18:26:51 +00:00
Roman Lebedev 4e72ab8b66 [TableGen] Introduce !listsplat 'binary' operator
Summary:
```
``!listsplat(a, size)``
    A list value that contains the value ``a`` ``size`` times.
    Example: ``!listsplat(0, 2)`` results in ``[0, 0]``.
```

I plan to use this in X86ScheduleBdVer2.td for LoadRes handling.

This is a little bit controversial because unlike every other binary operator
the types aren't identical.

Reviewers: stoklund, javed.absar, nhaehnle, craig.topper

Reviewed By: javed.absar

Subscribers: llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358117 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-10 18:26:36 +00:00
Zachary Turner 40b4c59816 [PDB Docs] Clarifications and fixes for DBI Stream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358022 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-09 17:38:34 +00:00
Andrea Di Biagio eb44479056 [llvm-mca][scheduler-stats] Print issued micro opcodes per cycle. NFCI
It makes more sense to print out the number of micro opcodes that are issued
every cycle rather than the number of instructions issued per cycle.
This behavior is also consistent with the dispatch-stats: numbers from the two
views can now be easily compared.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357919 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-08 16:05:54 +00:00
Justin Bogner 9736ffc02a [CMake] Replace LLVM_ENABLE_CXX1Y and friends with LLVM_CXX_STD
Simplify building with particular C++ standards by replacing the
specific "enable standard X" flags with a flag that allows specifying
the standard you want directly.

We preserve compatibility with the existing flags so that anyone with
those flags in existing caches won't break mysteriously.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357899 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-08 10:19:17 +00:00
Chris Lattner 2dd25b0413 last changes for now
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357868 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-07 14:34:24 +00:00
Chris Lattner c599324ae4 various improvements in wording, also unbreak the bot
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357867 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-07 14:23:11 +00:00
Chris Lattner a932c9ae0a make a bunch of cleanups in wording and tone
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357865 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-07 13:42:29 +00:00
Chris Lattner e0a373b557 remove some unhelpful language from the tutorial
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357863 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-07 13:17:16 +00:00
Chris Lattner b97b21f624 Copy the C++ kaleidoscope tutorial into a subdirectory and clean up various things, aligning with the direction of the WiCT workshop, and Meike Baumgärtner's view of how this should work. The old version of the documentation is unmodified, this is an experiment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357862 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-07 13:14:23 +00:00
Zachary Turner 0e34344e6e [PDB Docs] Add documentation for the hash table format.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357826 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-05 22:09:30 +00:00
Zachary Turner 903fc4e173 [PDB Docs] The IPI Stream actually has index 4.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357825 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-05 22:09:14 +00:00
Zachary Turner aeacd5adf4 [PDB Docs] Delete * LINKER * Stream information.
This is actually just a module debug info stream, so it should
technically be covered by a discussion of the module list.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357819 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-05 21:16:00 +00:00
Zachary Turner 90e8e81199 Try to fix Sphinx bot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357790 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-05 18:06:42 +00:00
Zachary Turner 0651f46071 [PDB Docs] Finish documentation for PDB Info Stream.
The information about the named stream map and feature codes
was not present.  This patch adds it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357788 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-05 17:59:26 +00:00
Zachary Turner 65e5a02fa9 [PDB Docs] Add info about the hash adjustment buffer.
This necessitates adding a document describing the serialized
hash table format.  This document is currently empty, although
it will be filled out in followup patches.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357784 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-05 17:12:37 +00:00
Zachary Turner e28ea96f43 Add documentation for PDB TPI/IPI Stream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357777 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-05 16:43:42 +00:00
Guillaume Chatelet 99e08856ae Add an option do not dump the generated object on disk
Reviewers: courbet

Subscribers: llvm-commits, bdb

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357769 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-05 15:18:59 +00:00
Don Hinton 50b9c08241 [llvm] Add isa_and_nonnull
Summary:
Add new ``isa_and_nonnull<>`` operator that works just like
the ``isa<>`` operator, except that it allows for a null pointer as an
argument (which it then returns false).

Reviewers: lattner, aaron.ballman, greened

Reviewed By: lattner

Subscribers: hubert.reinterpretcast, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357761 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-05 13:59:24 +00:00
Matt Arsenault 234b3a117e AMDGPU: Remove dx10-clamp from subtarget features
Since this can be set with s_setreg*, it should not be a subtarget
property. Set a default based on the calling convention, and Introduce
a new amdgpu-dx10-clamp attribute to override this if desired.

Also introduce a new amdgpu-ieee attribute to match.

The values need to match to allow inlining. I think it is OK for the
caller's dx10-clamp attribute to override the callee, but there
doesn't appear to be the infrastructure to do this currently without
definining the attribute in the generic Attributes.td.

Eventually the calling convention lowering will need to insert a mode
switch somewhere for these.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357302 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-29 19:14:54 +00:00
Scott Linder 6209ea9ff7 [AMDGPU] Add an additional Code Object V3 assembler example
Document the intended use of the `.amdgcn.next_free_{s,v}gpr` in the
context of multiple kernels and functions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357289 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-29 17:49:51 +00:00
Konstantin Zhuravlyov 142ef796c0 AMDGPU: Make sram-ecc off by default for Vega20
Differential Revision: https://reviews.llvm.org/D59718


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357247 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-29 12:04:18 +00:00
Scott Linder 8c243de4d1 [AMDGPU] Clarify Code Object V2/V3 differences in AMDGPUUsage
Ensure Code Object V2 documentation is complete, but always contains a
warning and a link to the equivalent Code Object V3 documentation.

Explicitly indicate that any note records present in a code object that
are not documented must be considered deprecated and ignored.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357176 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-28 15:08:52 +00:00
Michael Platings 53583ed1d7 [Documentation] Proposal to change variable names
Differential Revision: https://reviews.llvm.org/D59251

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357174 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-28 14:42:21 +00:00
Roman Lebedev 98ccb48264 [llvm-exegesis] Introduce a 'naive' clustering algorithm (PR40880)
Summary:
This is an alternative to D59539.

Let's suppose we have measured 4 different opcodes, and got: `0.5`, `1.0`, `1.5`, `2.0`.
Let's suppose we are using `-analysis-clustering-epsilon=0.5`.
By default now we will start processing the `0.5` point, find that `1.0` is it's neighbor, add them to a new cluster.
Then we will notice that `1.5` is a neighbor of `1.0` and add it to that same cluster.
Then we will notice that `2.0` is a neighbor of `1.5` and add it to that same cluster.
So all these points ended up in the same cluster.
This may or may not be a correct implementation of dbscan clustering algorithm.

But this is rather horribly broken for the reasons of comparing the clusters with the LLVM sched data.
Let's suppose all those opcodes are currently in the same sched cluster.
If i specify `-analysis-inconsistency-epsilon=0.5`, then no matter
the LLVM values this cluster will **never** match the LLVM values,
and thus this cluster will **always** be displayed as inconsistent.

The solution is obviously to split off some of these opcodes into different sched cluster.
But how do i do that? Out of 4 opcodes displayed in the inconsistency report,
which ones are the "bad ones"? Which ones are the most different from the checked-in data?
I'd need to go in to the `.yaml` and look it up manually.

The trivial solution is to, when creating clusters, don't use the full dbscan algorithm,
but instead "pick some unclustered point, pick all unclustered points that are it's neighbor,
put them all into a new cluster, repeat". And just so as it happens, we can arrive
at that algorithm by not performing the "add neighbors of a neighbor to the cluster" step.

But that won't work well once we teach analyze mode to operate in on-1D mode
(i.e. on more than a single measurement type at a time), because the clustering would
depend on the order of the measurements.

Instead, let's just create a single cluster per opcode, and put all the points of that opcode into said cluster.
And simultaneously check that every point in that cluster is a neighbor of every other point in the cluster,
and if they are not, the cluster (==opcode) is unstable.

This is //yet another// step to bring me closer to being able to continue cleanup of bdver2 sched model..

Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=40880 | PR40880 ]].

Reviewers: courbet, gchatelet

Reviewed By: courbet

Subscribers: tschuett, jdoerfert, RKSimon, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357152 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-28 08:55:01 +00:00
Francis Visoiu Mistrih 0c810b46bd [Remarks] Emit a section containing remark diagnostics metadata
A section containing metadata on remark diagnostics will be emitted if
the flag (-mllvm) -remarks-section is present.

For now, the metadata is:

* a magic number for remarks: "REMARKS\0"
* the version number: a little-endian uint64_t
* the absolute file path to the serialized remark diagnostics: a
  null-terminated string.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357043 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-27 01:13:59 +00:00
Ronald Wampler 0e7b2400f2 Test commit: fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356999 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-26 15:26:15 +00:00
Konstantin Zhuravlyov ba71b832d8 AMDGPU: Add support for cross address space synchronization scopes
Differential Revision: https://reviews.llvm.org/D59517


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356946 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-25 20:50:21 +00:00
James Y Knight 6df50f4718 IR: Support parsing numeric block ids, and emit them in textual output.
Just as as llvm IR supports explicitly specifying numeric value ids
for instructions, and emits them by default in textual output, now do
the same for blocks.

This is a slightly incompatible change in the textual IR format.

Previously, llvm would parse numeric labels as string names. E.g.
  define void @f() {
    br label %"55"
  55:
    ret void
  }
defined a label *named* "55", even without needing to be quoted, while
the reference required quoting. Now, if you intend a block label which
looks like a value number to be a name, you must quote it in the
definition too (e.g. `"55":`).

Previously, llvm would print nameless blocks only as a comment, and
would omit it if there was no predecessor. This could cause confusion
for readers of the IR, just as unnamed instructions did prior to the
addition of "%5 = " syntax, back in 2008 (PR2480).

Now, it will always print a label for an unnamed block, with the
exception of the entry block. (IMO it may be better to print it for
the entry-block as well. However, that requires updating many more
tests.)

Thus, the following is supported, and is the canonical printing:
  define i32 @f(i32, i32) {
    %3 = add i32 %0, %1
    br label %4

  4:
    ret i32 %3
  }

New test cases covering this behavior are added, and other tests
updated as required.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356789 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-22 18:27:13 +00:00
Markus Lavin 6ce55cd841 [DebugInfo] Introduce DW_OP_LLVM_convert
Introduce a DW_OP_LLVM_convert Dwarf expression pseudo op that allows
for a convenient way to perform type conversions on the Dwarf expression
stack. As an additional bonus it paves the way for using other Dwarf
v5 ops that need to reference a base_type.

The new DW_OP_LLVM_convert is used from lib/Transforms/Utils/Local.cpp
to perform sext/zext on debug values but mainly the patch is about
preparing terrain for adding other Dwarf v5 ops that need to reference a
base_type.

For Dwarf v5 the op maps to DW_OP_convert and for earlier versions a
complex shift & mask pattern is generated to emulate sext/zext.

This is a recommit of r356442 with trivial fixes for the failing tests.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356451 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-19 13:16:28 +00:00