Commit Graph

282141 Commits

Author SHA1 Message Date
Momchil Velikov 74906a467c Revert "[DebugInfo] Improvements to representation of enumeration types (PR36168)"
Revert commit r324489, it broke LLDB tests.

llvm-svn: 324511
2018-02-07 20:28:47 +00:00
Alexey Bataev cd8d6de381 [SLP] Add a tests for PR36280, NFC.
llvm-svn: 324510
2018-02-07 20:11:37 +00:00
Jim Ingham 9c82180d3a Remove an errant ^S
(still can't get over those Emacs habits...)

llvm-svn: 324509
2018-02-07 20:09:13 +00:00
Momchil Velikov cd0ac25124 Revert [DebugInfo] Improvements to representation of enumeration types (PR36168)"
Revert due to breaking buildbots (LLDB tests)

llvm-svn: 324508
2018-02-07 19:57:04 +00:00
George Karpenkov 46163786e5 [analyzer] [NFC] Factor out generating path diagnostics for a statement into a function
Differential Revision: https://reviews.llvm.org/D42558

llvm-svn: 324507
2018-02-07 19:56:52 +00:00
Rafael Espindola 880c3b24c5 Revert "Recommit r324107."
This reverts commit r324500.

The bots found two failures:

    ThreadSanitizer-x86_64 :: Linux/pie_no_aslr.cc
    ThreadSanitizer-x86_64 :: pie_test.cc

when using gold. The issue is a limitation in gold when building pie
binaries. I will investigate how to work around it.

llvm-svn: 324505
2018-02-07 19:44:15 +00:00
Zachary Turner 876dc7124d Generate PDB files for profiling even in Release build.
This patch enables PDB generation for Release build, which has
slightly different optimize option with RelWithDebInfo on windows.

This helps to know slow part of Release build when profiling.

Patch by Takuto Ikuta
Differential Revision: https://reviews.llvm.org/D42632

llvm-svn: 324504
2018-02-07 19:37:52 +00:00
Marshall Clow 1d4546c0ad Comment on 'Review' issues
llvm-svn: 324503
2018-02-07 19:24:37 +00:00
Rui Ueyama fa9f699d30 Add --build-id=fast as a synonym for --build-id.
When you omit an argument, most options fall back to their defaults.
For example, --color-diagnostics is a synonym for --color-diagnostics=auto.
We don't have a way to specify the default choice for --build-id, so we
can't describe --build-id (without an argument) in that way.
This patch adds "fast" for the default build-id choice.

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

llvm-svn: 324502
2018-02-07 19:22:42 +00:00
Eric Fiselier cca7dddcd3 Fix r324498: the commit removed the '-' before the disable-llvm-verifier flag
llvm-svn: 324501
2018-02-07 19:17:03 +00:00
Rafael Espindola fa9874c33b Recommit r324107.
It now includes a fix to not mark available_externally definitions as
dso_local.

Original message:

Start setting dso_local in clang.

This starts adding dso_local to clang.

The hope is to eventually have TargetMachine::shouldAssumeDsoLocal go
away. My objective for now is to move enough of it to clang to remove
the need for the TargetMachine one to handle PIE copy relocations and
-fno-plt. With that it should then be easy to implement a
-fno-copy-reloc in clang.

This patch just adds the cases where we assume a symbol to be local
based on the file being compiled for an executable or a shared
library.

llvm-svn: 324500
2018-02-07 19:16:49 +00:00
Rafael Espindola deb10becf3 Don't pass ForDefinition_t in places it is redundant.
I found this while looking at the ppc failures caused by the dso_local
change.

The issue was that the patch would produce the wrong answer for
available_externally. Having ForDefinition_t available in places where
the code can just check the linkage is a bit of a foot gun.

This patch removes the ForDefiniton_t argument in places where the
linkage is already know.

llvm-svn: 324499
2018-02-07 19:04:41 +00:00
Eric Fiselier 123c749ee9 [Driver] Add option to manually control discarding value names in LLVM IR.
Summary:
Currently, assertion-disabled Clang builds emit value names when generating LLVM IR. This is controlled by the `NDEBUG` macro, and is not easily overridable. In order to get IR output containing names from a release build of Clang, the user must manually construct the CC1 invocation w/o the `-discard-value-names` option. This is less than ideal.

For example, Godbolt uses a release build of Clang, and so when asked to emit LLVM IR the result lacks names, making it harder to read. Manually invoking CC1 on Compiler Explorer is not feasible.

This patch adds the driver options `-fdiscard-value-names` and `-fno-discard-value-names` which allow the user to override the default behavior. If neither is specified, the old behavior remains.

Reviewers: erichkeane, aaron.ballman, lebedev.ri

Reviewed By: aaron.ballman

Subscribers: bogner, cfe-commits

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

llvm-svn: 324498
2018-02-07 18:36:51 +00:00
Craig Topper d18430018d [X86] Regenerate test using update_mir_test_checks.py. NFC
llvm-svn: 324497
2018-02-07 18:32:15 +00:00
Yvan Roux cae4970b34 [asan] Fix filename size on linux platforms.
This is a a fix for:
https://bugs.llvm.org/show_bug.cgi?id=35996

Use filename limits from system headers to be synchronized with what
LD_PRELOAD can handle.

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

llvm-svn: 324496
2018-02-07 18:27:25 +00:00
Gheorghe-Teodor Bercea aaeab8d4ef [OpenMP][libomptarget] Add data sharing support in libomptarget
Summary: This patch extends the libomptarget functionality in patch D14254 with support for the data sharing scheme for supporting implicitly shared variables. The runtime therefore maintains a list of references to shared variables.

Reviewers: carlo.bertolli, ABataev, Hahnfeld, grokos, caomhin, hfinkel

Reviewed By: Hahnfeld, grokos

Subscribers: guansong, llvm-commits, openmp-commits

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

llvm-svn: 324495
2018-02-07 18:21:55 +00:00
Rafael Espindola f4e3f3e31c Revert "AMDGPU: Add 32-bit constant address space"
This reverts commit r324487.

It broke clang tests.

llvm-svn: 324494
2018-02-07 18:09:35 +00:00
Jonas Devlieghere 36df7631b4 Revert dsymutil -update commits
Revert "[dsymutil][test] Check the updated dSYM instead of companion file."
Revert "[dsymutil] Upstream update feature."

llvm-svn: 324493
2018-02-07 17:35:27 +00:00
Jonas Devlieghere ea6fbd92d8 [test] Don't drop existing categories for methods.
The change in r324488 dropped the existing category attribute in for
instance methods. This patch corrects that.

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

llvm-svn: 324492
2018-02-07 17:34:46 +00:00
Nirav Dave efed656873 [SelectionDAG] More Aggressibly prune nodes in AddChains. NFCI.
Travel all chains paths to first non-tokenfactor node can be
exponential work. Add simple redundency check to avoid this.
Fixes PR36264.

llvm-svn: 324491
2018-02-07 17:12:34 +00:00
Momchil Velikov d7e17c232f [DebugInfo] Improvements to representation of enumeration types (PR36168)
This patch:

* fixes an incorrect sign-extension of unsigned values, when emitting
  debug info metadata for enumerators
* the enumerators metadata is created with a flag, which determines
  interpretation of the value bits (signed or unsigned)
* the enumerations metadata contains the underlying integer type and a
  flag, indicating whether this is a C++ "fixed enum"

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

llvm-svn: 324490
2018-02-07 16:52:02 +00:00
Momchil Velikov c502027efd [DebugInfo] Improvements to representation of enumeration types (PR36168)
This patch is the LLVM part of fixing the issues, described in
https://bugs.llvm.org/show_bug.cgi?id=36168

* The representation of enumerator values in the debug info metadata now
  contains a boolean flag isUnsigned, which determines how the bits of
  the value are interpreted.
* The DW_TAG_enumeration type DIE now always (for DWARF version >= 3)
  includes a DW_AT_type attribute, which refers to the underlying
  integer type, as suggested in DWARFv4 (5.7 Enumeration Type Entries).
* The debug info metadata for enumeration type contains (in flags)
  indication whether this is a C++11 "fixed enum".
* For C++11 enumeration with a fixed underlying type, the DIE also
  includes the DW_AT_enum_class attribute (for DWARF version >= 4).
* Encoding of enumerator constants uses DW_FORM_sdata for signed values
  and DW_FORM_udata for unsigned values, as suggested by DWARFv4 (7.5.4
  Attribute Encodings).

The changes should be backwards compatible:

* the isUnsigned attribute is optional and defaults to false.
* if the underlying type for the enumeration is not available, the
  enumerator values are considered signed.
* the FixedEnum flag defaults to clear.
* the bitcode format for DIEnumerator stores the unsigned flag bit #1 of
  the first record element, so the format does not change and the zero
  previously stored there is consistent with the false default for
  IsUnsigned.

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

llvm-svn: 324489
2018-02-07 16:46:33 +00:00
Jonas Devlieghere 466396592d [test] Enable setting category for inline tests.
Inlined tests have a test function that is actually an instance method,
which requires a slightly different approach when it comes to setting
the category attribute. The attribute must be set on the actual
function, rather than on a particular instance.

llvm-svn: 324488
2018-02-07 16:10:59 +00:00
Marek Olsak 871c30e540 AMDGPU: Add 32-bit constant address space
Note: This is a candidate for LLVM 6.0, because it was planned to be
      in that release but was delayed due to a long review period.

Merge conflict in release_60 - resolution:
    Add "-p6:32:32" into the second (non-amdgiz) string.

Only scalar loads support 32-bit pointers. An address in a VGPR will
fail to compile. That's OK because the results of loads will only be used
in places where VGPRs are forbidden.

Updated AMDGPUAliasAnalysis and used SReg_64_XEXEC.
The tests cover all uses cases we need for Mesa.

Reviewers: arsenm, nhaehnle

Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits

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

llvm-svn: 324487
2018-02-07 16:01:00 +00:00
Marek Olsak b2cc77985b AMDGPU: Remove the s_buffer workaround for GFX9 chips
Summary:
I checked the AMD closed source compiler and the workaround is only
needed when x3 is emulated as x4, which we don't do in LLVM.

SMEM x3 opcodes don't exist, and instead there is a possibility to use x4
with the last component being unused. If the last component is out of
buffer bounds and falls on the next 4K page, the hw hangs.

Reviewers: arsenm, nhaehnle

Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, llvm-commits, t-tye

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

llvm-svn: 324486
2018-02-07 16:00:40 +00:00
Simon Pilgrim b4e789e8f6 [X86][AVX] Add PACKSSDW/PACKUSDW support for truncation of clamped values
SSE and shorter vector sizes will have to wait until we can add support for general SMIN/SMAX matching.

llvm-svn: 324485
2018-02-07 15:48:44 +00:00
Jonas Devlieghere b419108203 [dsymutil][test] Check the updated dSYM instead of companion file.
This patch has llvm-dwarfdump check the whole dSYM, rather than the
hard-coded path to the Mach-O companion file. This might be what's
causing the Windows bot to fail.

llvm-svn: 324483
2018-02-07 15:18:21 +00:00
Clement Courbet 9c22d8018c [SLPVectorizer][NFC] Make a loop more readable.
llvm-svn: 324482
2018-02-07 14:26:43 +00:00
Kamil Rytarowski ccb970ee03 Correct a bug in GetArgsAndEnv() for NetBSD
Fix setting envp.

llvm-svn: 324481
2018-02-07 14:05:57 +00:00
Jonas Devlieghere a4b9417b52 [dsymutil] Upstream update feature.
Now that dsymutil can generate accelerator tables, we can upstream the
update logic that, as the name implies, updates the accelerator tables
in an existing dSYM bundle. In combination with `-minimize` this can be
used to remove redundant .debug_(inlines|pubtypes|pubnames).

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

llvm-svn: 324480
2018-02-07 13:51:29 +00:00
Simon Pilgrim c90d79f80a [X86] Regenerate atomic i32 tests
llvm-svn: 324479
2018-02-07 13:28:23 +00:00
Benjamin Kramer 6ddafa565b [Orc] Pacify -pedantic.
llvm-svn: 324478
2018-02-07 12:55:01 +00:00
Simon Atanasyan 70498f81de [mips] Support 'y' operand code to print exact log2 of the operand
llvm-svn: 324477
2018-02-07 12:36:39 +00:00
Simon Atanasyan 737bec38d0 [mips] Handle 'M' and 'L' operand codes for memory operands
Both operand codes now work the same way in case of register or memory
operands. It print high-order or low-order word in a double-word
register or memory location.

llvm-svn: 324476
2018-02-07 12:36:33 +00:00
Eric Liu 7deda4f5af [clangd] Do not precent-encode numbers in URI.
Reviewers: ilya-biryukov

Subscribers: klimek, jkorous-apple, cfe-commits, sammccall

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

llvm-svn: 324475
2018-02-07 12:12:06 +00:00
Pavel Labath 524bd9cd24 [BinaryFormat] Remove dangling declaration of DiscriminantString
The implementation of the function was deleted in r324426. This also
removes the declaration.

llvm-svn: 324474
2018-02-07 11:19:29 +00:00
Max Kazantsev b299ade2c5 Re-enable "[SCEV] Make isLoopEntryGuardedByCond a bit smarter"
The failures happened because of assert which was overconfident about
SCEV's proving capabilities and is generally not valid.

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

llvm-svn: 324473
2018-02-07 11:16:29 +00:00
Pavel Labath 986b39b61f Remove function DW_DSC_value_to_name
It is unused, and the underlying llvm function has been removed as well.

llvm-svn: 324472
2018-02-07 11:13:21 +00:00
Jacek Olesiak fb7f5c08b9 [clang-format] Fix ObjC message arguments formatting.
Summary:
Fixes formatting of ObjC message arguments when inline block is a first
argument.

Having inline block as a first argument when method has multiple parameters is
discouraged by Apple:
"It’s best practice to use only one block argument to a method. If the
method also needs other non-block arguments, the block should come last"
(https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/WorkingwithBlocks/WorkingwithBlocks.html#//apple_ref/doc/uid/TP40011210-CH8-SW7),
it should be correctly formatted nevertheless.

Current formatting:
```
[object blockArgument:^{
  a = 42;
}
    anotherArg:42];
```

Fixed (colon alignment):
```
[object
  blockArgument:^{
    a = 42;
  }
     anotherArg:42];
```

Test Plan: make -j12 FormatTests && tools/clang/unittests/Format/FormatTests

Reviewers: krasimir, benhamilton

Reviewed By: krasimir, benhamilton

Subscribers: benhamilton, klimek, cfe-commits

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

llvm-svn: 324469
2018-02-07 10:35:08 +00:00
Simon Atanasyan 7244159b82 [ELF][MIPS] Mark the test as required MIPS target support. NFC
llvm-svn: 324468
2018-02-07 10:14:22 +00:00
Simon Atanasyan 85815a3149 [ELF][MIPS] Ignore incorrect version definition index for _gp_disp symbol
MIPS BFD linker puts _gp_disp symbol into DSO files and assigns zero
version definition index to it. This value means 'unversioned local
symbol' while _gp_disp is a section global symbol. We have to handle
this bug in the LLD because BFD linker is used for building MIPS
toolchain libraries.

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

llvm-svn: 324467
2018-02-07 10:02:49 +00:00
Clement Courbet 10003e31f4 [MergeICmps] Re-commit rL324317 "Enable the MergeICmps Pass by default."
With fixes from rL324341.

Original commit message:

[MergeICmps] Enable the MergeICmps Pass by default.

Summary: Now that PR33325 is fixed, this should always improve the generated code.

Reviewers: spatel

Subscribers: llvm-commits

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

llvm-svn: 324465
2018-02-07 09:58:55 +00:00
George Rimar 308c92b25d [ELF] - Fix BB after r324463.
Test requires arm, but specified x86.

llvm-svn: 324464
2018-02-07 09:41:14 +00:00
George Rimar 3d5e86e5ee [ELF] - Remove unused synthetic sections correctly.
This is PR35740 which now crashes
because we remove unused synthetic sections incorrectly.

We can keep input section description and corresponding output
section live even if it must be empty and dead. 
This results in a crash because SHF_LINK_ORDER handling code
tries to access first section which is nullptr in this case.

Patch fixes the issue.

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

llvm-svn: 324463
2018-02-07 09:11:07 +00:00
Serguei Katkov 69246ca787 Revert [SCEV] Make isLoopEntryGuardedByCond a bit smarter
Revert rL324453 commit which causes buildbot failures.

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

llvm-svn: 324462
2018-02-07 09:10:08 +00:00
George Rimar 27ae7ae774 [ELF] - Make defsym to work correctly with reserved symbols.
Previously --defsym=foo2=etext+2 would produce incorrect value
for foo2 because expressions did not work correctly with
reserved symbols, section offset was calculated wrong for them.

Fixes PR35744.

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

llvm-svn: 324461
2018-02-07 09:00:34 +00:00
George Rimar 9d9e9e1889 [ELF] - Allow set CPU string with -plugin-opt=mcpu=<xxx>
Previously we ignored -plugin-opt=mcpu=<xxx>
and the only way to set CPU string was to pass
-mllvm -mcpu=<xxx>
Though clang may pass it with use of plugin options:
-plugin-opt=mcpu=x86-64
Since we are trying to be compatible in command line
with gold plugin, seems we should support it too.

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

llvm-svn: 324459
2018-02-07 08:50:36 +00:00
George Rimar 545652491d Revert r324455 "[ThinLTO] - Simplify code in ThinLTOBitcodeWriter."
It broke BB:
http://lab.llvm.org:8011/builders/sanitizer-windows/builds/23721

llvm-svn: 324458
2018-02-07 08:46:36 +00:00
George Rimar c9b6c5c67d [ELF] - Add testcase for -debugger-tune=<value>
In D42733 we supported different LTO command line
options, including -debugger-tune=<value>.

Initially debugger-tune support was needed to fix PR36035.
Patch adds testcase for this option to check we
don't simply ignore it.

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

llvm-svn: 324457
2018-02-07 08:43:19 +00:00
Sjoerd Meijer 8c0739347c [ARM] FP16 mov imm pattern
This is a follow up of r324321, adding a match pattern for mov with a FP16
immediate (also fixing operand vfp_f16imm that wasn't even compiling).

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

llvm-svn: 324456
2018-02-07 08:37:17 +00:00