Commit Graph

273618 Commits

Author SHA1 Message Date
Rui Ueyama 124bedbd50 Add comment to InputSectionBase::File.
This patch also moves declarations so that related declarations next
to each other.

llvm-svn: 315266
2017-10-10 03:22:29 +00:00
Rui Ueyama 339ddd1685 Remove dead function.
llvm-svn: 315265
2017-10-10 03:01:41 +00:00
Reid Kleckner 97a2d5c42f [MC] Properly diagnose badly scoped .cfi_ directives
Removes two report_fatal_errors.

Implement this by removing EmitCFICommon, and do the checking in
getCurrentDwarfFrameInfo. Have the callers check for null before
dereferencing it.

llvm-svn: 315264
2017-10-10 01:49:21 +00:00
Reid Kleckner 78eb8b912f Give a test a triple
llvm-svn: 315263
2017-10-10 01:34:31 +00:00
Reid Kleckner e52d1e6787 [SEH] Use reportError instead of report_fatal_error for bad directives
This makes the .seh_ directives slightly more usable from standalone
assembly files.

This removes a large number of report_fatal_errors and recovers from the
error by ignoring the directive.

llvm-svn: 315262
2017-10-10 01:26:25 +00:00
Akira Hatanaka cc7171abbf [Sema][ObjC] Preserve syntactic sugar when removing
ARCReclaimReturnedObject cast.

This is a follow-up to r314370.

Rather than throwing away the enclosing parentheses, this commit walks
down the expression until an ARCReclaimReturnedObject cast is found and
removes just the cast, preserving the syntactic sugar expressions
(parens and casts) that were visited up to that point.

rdar://problem/34705720

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

llvm-svn: 315261
2017-10-10 01:24:33 +00:00
Lang Hames 1301a878f1 [MC] Plumb unique_ptr<MCWasmObjectTargetWriter> through createWasmObjectWriter
to WasmObjectWriter's constructor.

Fixes the same ownership issue for COFF that r315245 did for MachO:
WasmObjectWriter takes ownership of its MCWasmObjectTargetWriter, so we want to
pass this through to the constructor via a unique_ptr, rather than a raw ptr.

llvm-svn: 315260
2017-10-10 01:15:10 +00:00
Reid Kleckner ab23dace56 [MC] Suppress .Lcfi labels when emitting textual assembly
Summary:
This suppresses the generation of .Lcfi labels in our textual assembler.
It was annoying that this generated cascading .Lcfi labels:
  llc foo.ll -o - | llvm-mc | llvm-mc

After three trips through MCAsmStreamer, we'd have three labels in the
output when none are necessary. We should only bother creating the
labels and frame data when making a real object file.

This supercedes D38605, which moved the entire .seh_ implementation into
MCObjectStreamer.

This has the advantage that we do more checking when emitting textual
assembly, as a minor efficiency cost. Outputting textual assembly is not
performance critical, so this shouldn't matter.

Reviewers: majnemer, MatzeB

Subscribers: qcolombet, nemanjai, javed.absar, eraman, hiraditya, JDevlieghere, llvm-commits

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

llvm-svn: 315259
2017-10-10 00:57:36 +00:00
Reid Kleckner a11b983e11 Fix Wasm build after r315254
llvm-svn: 315258
2017-10-10 00:52:40 +00:00
Lang Hames 77dff39cb4 [MC] Plumb unique_ptr<MCWinCOFFObjectTargetWriter> through
createWinCOFFObjectWriter to WinCOFFObjectWriter's constructor.

Fixes the same ownership issue for COFF that r315245 did for MachO:
WinCOFFObjectWriter takes ownership of its MCWinCOFFObjectTargetWriter, so we
want to pass this through to the constructor via a unique_ptr, rather than a
raw ptr.

llvm-svn: 315257
2017-10-10 00:50:29 +00:00
Richard Smith a0b68be6cf [Modules TS] Avoid computing the linkage of the enclosing DeclContext for a declaration in the global module.
This works around a language issue where adding a typedef name for linkage
purposes changes the linkage of an already-defined class after it becomes
complete.

llvm-svn: 315256
2017-10-10 00:49:38 +00:00
Jan Korous e6a0242ebc R13575: Fix USR mangling for function pointer types
Differential Revision: https://reviews.llvm.org/D38707

llvm-svn: 315255
2017-10-10 00:35:16 +00:00
Lang Hames dcb312bdb9 [MC] Plumb unique_ptr<MCELFObjectTargetWriter> through createELFObjectWriter to
ELFObjectWriter's constructor.

Fixes the same ownership issue for ELF that r315245 did for MachO:
ELFObjectWriter takes ownership of its MCELFObjectTargetWriter, so we want to
pass this through to the constructor via a unique_ptr, rather than a raw ptr.

llvm-svn: 315254
2017-10-09 23:53:15 +00:00
Adam Nemet e0f1541f41 Rename OptimizationDiagnosticInfo.h to OptimizationRemarkEmitter.h
Polly version of r315249 on LLVM trunk.

llvm-svn: 315253
2017-10-09 23:49:08 +00:00
Jan Korous 0e171eab3e Fix typos in documentation
Differential Revision: https://reviews.llvm.org/D38711

llvm-svn: 315252
2017-10-09 23:45:20 +00:00
Richard Smith b87720b77a [Modules TS] Module ownership semantics for redeclarations.
When declaring an entity in the "purview" of a module, it's never a
redeclaration of an entity in the purview of a default module or in no module
("in the global module"). Don't consider those other declarations as possible
redeclaration targets if they're not visible, and reject any cases where we
pick a prior visible declaration that violates this rule.

llvm-svn: 315251
2017-10-09 23:42:09 +00:00
George Karpenkov 8b53f7ca6d [Analyzer] Do not segfault on unexpected call_once implementation
Fixes https://bugs.llvm.org/show_bug.cgi?id=34869

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

llvm-svn: 315250
2017-10-09 23:20:46 +00:00
Adam Nemet 0965da2055 Rename OptimizationDiagnosticInfo.* to OptimizationRemarkEmitter.*
Sync it up with the name of the class actually defined here.  This has been
bothering me for a while...

llvm-svn: 315249
2017-10-09 23:19:02 +00:00
Zachary Turner 1e2c8b1157 [llvm-rc] Try again to fix errors on big endian systems.
llvm-svn: 315248
2017-10-09 22:59:40 +00:00
Evgeniy Stepanov cb993304ac [ubsan] Fix Asan internal alloc corruption in PR33221 test.
MAP_FIXED discards the existing mapping at the given address.

llvm-svn: 315247
2017-10-09 22:52:13 +00:00
Eugene Zemtsov eb4adc3daf Fix LLDB build for Android.
Currently libstdc++ on Android doesn't support std::to_string().

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

llvm-svn: 315246
2017-10-09 22:43:35 +00:00
Lang Hames 9b206a7d60 [MC] Plumb unique_ptr<MCMachObjectTargetWriter> through createMachObjectWriter
to MCObjectWriter's constructor.

MCObjectWriter takes ownership of its MCMachObjectTargetWriter argument -- this
patch plumbs that ownership relationship through the constructor (which
previously took raw MCMachObjectTargetWriter*) and the createMachObjectWriter
function.

llvm-svn: 315245
2017-10-09 22:38:13 +00:00
Jonas Devlieghere d3b670e79a [DWARF] DW_TAG_imported_unit is not a unit type.
As pointed out by David in D38453 and confirmed with the DWARF mailing
list, DW_TAG_imported_unit is not a valid unit type.

llvm-svn: 315244
2017-10-09 22:33:53 +00:00
Francis Ricci 57d8452a63 [llvm-objdump] Use initializer list for scoped xar api constructors
llvm-svn: 315243
2017-10-09 20:27:14 +00:00
Bruno Cardoso Lopes c084589877 Revert r315214 since diff -Z isn't portable, this is breaking:
http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-expensive
http://green.lab.llvm.org/green/job/clang-stage1-configure-RA

llvm-svn: 315242
2017-10-09 20:22:05 +00:00
Jan Korous 10141da380 PR13575: Fix test
Ignore OS-specific mangled name.

llvm-svn: 315241
2017-10-09 20:17:28 +00:00
Aditya Nandakumar c3bfc81a1f [GISel]: Fix generation of illegal COPYs during CallLowering
We end up creating COPY's that are either truncating/extending and this
should be illegal.

https://reviews.llvm.org/D37640

Patch for X86 and ARM by igorb, rovka

llvm-svn: 315240
2017-10-09 20:07:43 +00:00
Aditya Nandakumar 4d62ca3ae9 Add a helper to build Copy instructions in MachineIRBuilder
llvm-svn: 315239
2017-10-09 20:07:41 +00:00
Matt Arsenault f12e3b848a AMDGPU: Add read_exec_lo/hi builtins
llvm-svn: 315238
2017-10-09 20:06:37 +00:00
Zvi Rackover c1d5955684 [X86] Unsigned saturation subtraction canonicalization [the backend part]
Summary:
On behalf of julia.koval@intel.com

The patch transforms canonical version of unsigned saturation, which is sub(max(a,b),a) or sub(a,min(a,b)) to special psubus insturuction on targets, which support it(8bit and 16bit uints).
umax(a,b) - b -> subus(a,b)
a - umin(a,b) -> subus(a,b)

There is also extra case handled, when right part of sub is 32 bit and can be truncated, using UMIN(this transformation was discussed in https://reviews.llvm.org/D25987).

The example of special case code:

```
void foo(unsigned short *p, int max, int n) {

  int i;
  unsigned m;
  for (i = 0; i < n; i++) {
    m = *--p;
    *p = (unsigned short)(m >= max ? m-max : 0);
  }
}
```
Max in this example is truncated to max_short value, if it is greater than m, or just truncated to 16 bit, if it is not. It is vaid transformation, because if max > max_short, result of the expression will be zero.

Here is the table of types, I try to support, special case items are bold:

| Size | 128 | 256 | 512
| -----  | -----  | -----   | -----
| i8 | v16i8 | v32i8 | v64i8
| i16 | v8i16 | v16i16 | v32i16
| i32 | | **v8i32** | **v16i32**
| i64 | | | **v8i64**

Reviewers: zvi, spatel, DavidKreitzer, RKSimon

Reviewed By: zvi

Subscribers: llvm-commits

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

llvm-svn: 315237
2017-10-09 20:01:10 +00:00
Jan Korous 663ba15ed6 PR13575: Fix USR mangling for fixed-size arrays
Differential Revision: https://reviews.llvm.org/D38643

llvm-svn: 315236
2017-10-09 19:51:33 +00:00
Jeroen Ketema 1364d268a4 Implement mem_fence on ptx
PTX does not differentiate between read and write fences. Hence, these a
lowered to a mem_fence call. The mem_fence function compiles to the
“member.cta” instruction, which commits all outstanding reads and writes
of a thread such that these become visible to all other threads in the same
CTA (i.e., work-group). The instruction does not differentiate between
global and local memory. Hence, the flags parameter is ignored, except
for deciding whether a “member.cta” instruction should be issued at all.

Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 315235
2017-10-09 19:43:04 +00:00
Shoaib Meenai 492d7134f3 [libc++] Support Microsoft ABI without vcruntime headers
The vcruntime headers are hairy and clash with both libc++ headers
themselves and other libraries. libc++ normally deals with the clashes
by deferring to the vcruntime headers and silencing its own definitions,
but for clients which don't want to depend on vcruntime headers, it's
desirable to support the opposite, i.e. have libc++ provide its own
definitions.

Certain operator new/delete replacement scenarios are not currently
supported in this mode, which requires some tests to be marked XFAIL.
The added documentation has more details.

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

llvm-svn: 315234
2017-10-09 19:25:17 +00:00
Alexey Bataev 6ab4d075ff [SLP] Add test for reversed load, NFC.
llvm-svn: 315232
2017-10-09 19:08:15 +00:00
Hamza Sood 8c01d47e52 Testing commit access.
llvm-svn: 315231
2017-10-09 19:07:09 +00:00
Zachary Turner 514b7105b5 Fix some C++ value / reference semantics issues.
Some functions were taking Twine's not by const&, these are all
fixed to take by const&.  We also had a case where some functions
were overloaded to accept by const& and &&.  Now there is only
one version which accepts by value and move's the value.

llvm-svn: 315229
2017-10-09 18:50:29 +00:00
Jeroen Ketema 4f5a3d5d6f Make ptx barrier work irrespective of the cl_mem_fence_flags
This generates a "bar.sync 0” instruction, which not only causes the
threads to wait, but does acts as a memory fence, as required by
OpenCL. The fence does not differentiate between local and global
memory. Unfortunately, there is no similar instruction which does
not include a memory fence. Hence, we cannot optimize the case
where neither CLK_LOCAL_MEM_FENCE nor CLK_GLOBAL_MEM_FENCE is
passed.

llvm-svn: 315228
2017-10-09 18:36:48 +00:00
Petr Hosek 1c0c35d034 [sanitizer] Don't intercept signal and sigaction on Fuchsia
Fuchsia doesn't support signals, so don't use interceptors for signal or
sigaction.

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

llvm-svn: 315227
2017-10-09 18:29:52 +00:00
Daniel Sanders 4d4e7650dc [globalisel] Add support for ValueType operands in patterns.
It's rare but there are a small number of patterns like this:
    (set i64:$dst, (add i64:$src1, i64:$src2))
These should be equivalent to register classes except they shouldn't check for
a specific register bank.

This doesn't occur in AArch64/ARM/X86 but does occasionally come up in other
in-tree targets such as BPF.

llvm-svn: 315226
2017-10-09 18:14:53 +00:00
Lang Hames 0b9db4c1fa [MC] Use a unique_ptr<MCAssembler> for MCObjectStreamer's Assembler member.
Removes manual new/delete.

llvm-svn: 315225
2017-10-09 18:11:04 +00:00
Sanjay Patel ce36b03b03 [InstCombine] fix formatting; NFC
llvm-svn: 315223
2017-10-09 17:54:46 +00:00
Adrian McCarthy e6275c6edb Fix after r315079
Microsoft's debug implementation of std::copy checks if the destination is an
array and then does some bounds checking.  This was causing an assertion
failure in fs::rename_internal which copies to a buffer of the appropriate
size but that's type-punned to an array of length 1 for API compatibility
reasons.

Fix is to make make the destination a pointer rather than an array.

llvm-svn: 315222
2017-10-09 17:50:01 +00:00
Stephane Sezer 7c6d1c3171 Update ABISysV_arm64::RegisterIsVolatile to accept registers prefixed with r
Summary:
While the specification says that the 64bit registers are prefixed with
`x`, it seems that many people still use `r`. Until recently, we had been using
the `r` prefix instead of the `x` prefix in ds2. This caused lldb to fail during
unwinding. I think it's reasonable to check for a register prefixed with `r`,
since some people still choose to use `r`.

Reviewers: sas, fjricci, clayborg

Reviewed By: sas, clayborg

Subscribers: aemerson, javed.absar, kristof.beyls

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

Change by Alex Langford <apl@fb.com>

llvm-svn: 315221
2017-10-09 17:49:32 +00:00
Evgeniy Stepanov 8804483b05 [ubsan] Disable one test on Android.
llvm-svn: 315220
2017-10-09 17:45:03 +00:00
Matt Arsenault cbe0dd13d2 AMDGPU: Fix missing declaration for __builtin_amdgcn_dispatch_ptr
llvm-svn: 315219
2017-10-09 17:44:18 +00:00
Francis Ricci 01ab402463 [dsymutil] Emit valid debug locations when no symbol flags are set
Summary:
swiftc emits symbols without flags set, which led dsymutil to ignore
them when searching for global symbols, causing dwarf location data
to be omitted. Xcode's dsymutil handles this case correctly, and emits
valid location data. Add this functionality to llvm-dsymutil by
allowing parsing of symbols with no flags set.

Reviewers: aprantl, friss, JDevlieghere

Subscribers: llvm-commits

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

llvm-svn: 315218
2017-10-09 17:27:47 +00:00
Alexey Bataev aadc2331e4 [SLP] Test for wrongly vectorized set of extractelements, NFC.
llvm-svn: 315217
2017-10-09 17:14:03 +00:00
Vlad Tsyrklevich a0b02833bc Limit CFI blacklist entries to specific CFI mode
Summary:
Since D37924 and D37925 were merged, it's now possible to specify
individual sanitizers or CFI modes in sanitizer blacklists. Update the
CFI blacklist entries to only apply to cfi-unrelated-cast checks.

Reviewers: eugenis, pcc

Reviewed By: eugenis

Subscribers: kcc

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

llvm-svn: 315216
2017-10-09 17:11:44 +00:00
Peter Collingbourne 107a9f624d Make the cfi target available on more platforms.
On non-Linux targets it just installs the blacklist.

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

llvm-svn: 315215
2017-10-09 17:07:47 +00:00
Ilya Biryukov de0cc39462 [clangd] Added a command-line arg to mirror clangd input into a file.
Summary: The arg is useful for debugging and creating test cases.

Reviewers: bkramer, krasimir

Reviewed By: bkramer

Subscribers: klimek, cfe-commits

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

llvm-svn: 315214
2017-10-09 16:58:16 +00:00