Commit Graph

268827 Commits

Author SHA1 Message Date
Kamil Rytarowski 886b30c4ff Add NetBSD support in sanitizer_linux_libcdep.cc
Summary:
When possible reuse FreeBSD and Linux code.

Part of the code inspired by the original work on libsanitizer in GCC 5.4 by Christos Zoulas.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, kcc, vitalybuka, filcab

Reviewed By: vitalybuka

Subscribers: srhines, emaste, kubamracek, llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 310143
2017-08-04 22:32:46 +00:00
Rafael Espindola 6e93d0546a Move File from SymbolBody to Symbol.
With this Symbol has the same size as before, but DefinedRegular goes
from 72 to 64 bytes.

I also find this a bit easier to read. There are fewer places
initializing File for example.

This has a small but measurable speed improvement on all tests (1%
max).

llvm-svn: 310142
2017-08-04 22:31:42 +00:00
Sanjay Patel e12d734be3 [InstCombine] narrow truncated add/sub/mul with constant
Name: narrow_sub
  %sub = sub i32 C1, %x
  %r = trunc i32 %sub to i8
  =>  
  %xn = trunc i32 %x to i8
  %narrowC = trunc i32 C1 to i8
  %r = sub i8 %narrowC, %xn
 
Name: narrow_add
  %add = add i32 %x, C1
  %r = trunc i32 %add to i8
  =>  
  %xn = trunc i32 %x to i8
  %narrowC = trunc i32 C1 to i8
  %r = add i8 %xn, %narrowC
  
Name: narrow_mul
  %mul = mul i32 %x, C1
  %r = trunc i32 %mul to i8
  =>  
  %xn = trunc i32 %x to i8
  %narrowC = trunc i32 C1 to i8
  %r = mul i8 %xn, %narrowC


http://rise4fun.com/Alive/QpS

This doesn't solve PR34046 (failure to recognize rotate):
https://bugs.llvm.org/show_bug.cgi?id=34046
...but it reduces an extra complication in the description examples 
to a form that we can more easily match.

llvm-svn: 310141
2017-08-04 22:30:34 +00:00
Kamil Rytarowski d1dc704c87 Add NetBSD support in interception.h
Summary:
Part of the code inspired by the original work on libsanitizer in GCC 5.4 by Christos Zoulas.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, kcc, filcab, vitalybuka

Reviewed By: vitalybuka

Subscribers: llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 310140
2017-08-04 22:27:01 +00:00
Kamil Rytarowski 6c68c2e2c5 Add NetBSD support in sanitizer_syscall_generic.inc
Summary:
This adds:
 - NetBSD specific aliases for renamed syscalls,
 - differentiate internal_syscall, internal_syscall64, internal_syscall_ptr as there are various types of syscalls on NetBSD.

Part of the code inspired by the original work on libsanitizer in GCC 5.4 by Christos Zoulas.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, kcc, vitalybuka, filcab

Reviewed By: vitalybuka

Subscribers: kubamracek, llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 310139
2017-08-04 22:23:52 +00:00
Reid Kleckner e6cde14416 [libclang] Determinize order of platform availability attrs
Previously this code was doing std::sort on IdentifierInfo pointers. Now
it sorts alphabetically by platform name.

This should de-flake clang/test/Index/availability.c, which was failing
non-deterministically for me.

llvm-svn: 310138
2017-08-04 21:52:25 +00:00
Reid Kleckner cefb333582 [Support] Use FILE_SHARE_DELETE to fix RemoveFileOnSignal on Windows
Summary:
Tools like clang that use RemoveFileOnSignal on their output files
weren't actually able to clean up their outputs before this change.  Now
the call to llvm::sys::fs::remove succeeds and the temporary file is
deleted. This is a stop-gap to fix clang before implementing the
solution outlined in PR34070.

Reviewers: davide

Subscribers: llvm-commits, hiraditya

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

llvm-svn: 310137
2017-08-04 21:52:00 +00:00
Kostya Serebryany 7dbb1e179e [libFuzzer] add -fsanitize-coverage-pc-table to -fsanitize=fuzzer
llvm-svn: 310136
2017-08-04 21:35:11 +00:00
Alexey Bataev d90ec748a8 Revert "[OPENMP][DEBUG] Set proper address space info if required by target."
This reverts commit r310104.

llvm-svn: 310135
2017-08-04 21:27:11 +00:00
Alexey Bataev efd884d393 Revert "[OPENMP] Fix for pacify buildbots, NFC."
This reverts commit r310120.

llvm-svn: 310134
2017-08-04 21:26:25 +00:00
Kostya Kortchinsky a53de0bf0f [asan] Fix unsupported test on Android
Summary:
`pvalloc` appears to not be available on Android. Mark the failing test as
unsupported on that platform.

Reviewers: alekseyshl, vitalybuka

Reviewed By: alekseyshl, vitalybuka

Subscribers: srhines, kubamracek, llvm-commits

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

llvm-svn: 310133
2017-08-04 21:26:20 +00:00
Vlad Tsyrklevich 3f3aad235d Reland "CFI: blacklist STL allocate() from unrelated-casts"
Reland r310097 with a fix for a debug assertion in NamedDecl.getName()

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

llvm-svn: 310132
2017-08-04 21:21:00 +00:00
Zachary Turner 6b7db9a66c More PDB buildbot fixes.
llvm-svn: 310131
2017-08-04 21:18:17 +00:00
Zachary Turner dd6f4368d6 Fix broken PDB tests.
llvm-svn: 310130
2017-08-04 21:15:12 +00:00
Kyle Butt 74f61dd8ef BlockPlacement: add a flag to force cold block outlining w/o a profile.
NFC.

llvm-svn: 310129
2017-08-04 21:13:41 +00:00
Zachary Turner 92e584cb48 [pdbutil] When dumping section contribs, show the section name.
llvm-svn: 310128
2017-08-04 21:10:04 +00:00
Petr Hosek c4df10e139 Reland "[llvm][llvm-objcopy] Added support for outputting to binary in llvm-objcopy"
This change adds the "-O binary" flag which directs llvm-objcopy to
output the object file to the same format as GNU objcopy does when given
the flag "-O binary". This was done by splitting the Object class into
two subclasses ObjectELF and ObjectBianry which each output a different
format but relay on the same code to read in the Object in Object.

Patch by Jake Ehrlich

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

llvm-svn: 310127
2017-08-04 21:09:26 +00:00
Kostya Serebryany 64426e3ba8 [libFuzzer] re-enable fuzzer-printcovpcs.test
llvm-svn: 310126
2017-08-04 20:47:22 +00:00
Adrian Prantl 299bebfbc3 Remove unused include directive and un-break the module build.
llvm-svn: 310124
2017-08-04 20:41:37 +00:00
Nico Weber 69ca5322d4 Revert r310055, it caused PR34074.
llvm-svn: 310123
2017-08-04 20:40:38 +00:00
Sanjay Patel 73ab438c48 [InstCombine] add vector tests for truncated math; NFC
llvm-svn: 310122
2017-08-04 20:38:33 +00:00
Vlad Tsyrklevich bbe96e50f3 Revert "Reland "CFI: blacklist STL allocate() from unrelated-casts""
This reverts commit r310105.

llvm-svn: 310121
2017-08-04 20:37:49 +00:00
Alexey Bataev e09a774bea [OPENMP] Fix for pacify buildbots, NFC.
llvm-svn: 310120
2017-08-04 20:29:52 +00:00
Kostya Kortchinsky d7d1681a0e [asan] Check for pvalloc overlow
Summary:
Last one of the `pvalloc` overflow checks!

`CheckForPvallocOverflow` was introduced with D35818 to detect when `pvalloc`
would wrap when rounding up to the next multiple of the page size.

Add this check to ASan's `pvalloc` implementation.

Reviewers: alekseyshl

Reviewed By: alekseyshl

Subscribers: llvm-commits, kubamracek

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

llvm-svn: 310119
2017-08-04 20:28:59 +00:00
Nico Weber b24df62bb6 Revert r310058, it caused PR34073.
llvm-svn: 310118
2017-08-04 20:24:13 +00:00
Amara Emerson 56dca4e3ca [SCEV] Preserve NSW information for sext(subtract).
Pushes the sext onto the operands of a Sub if NSW is present.
Also adds support for propagating the nowrap flags of the
llvm.ssub.with.overflow intrinsic during analysis.

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

llvm-svn: 310117
2017-08-04 20:19:46 +00:00
Kamil Rytarowski fcf8e5e345 Add NetBSD support in sanitizer_procmaps_freebsd.cc
Summary:
This adds NetBSD specific:
 - ReadProcMaps()
 - MemoryMappingLayout::Next()

This code is largely shared with FreeBSD.

Part of the code inspired by the original work on libsanitizer in GCC 5.4 by Christos Zoulas.

Sponsored by <The NetBSD Foundation>

Reviewers: kcc, joerg, filcab, vitalybuka, fjricci

Reviewed By: fjricci

Subscribers: emaste, kubamracek, mgorny, llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 310116
2017-08-04 20:17:24 +00:00
Quentin Colombet c046208c52 [GlobalISel] Remove the GISelAccessor API.
Its sole purpose was to avoid spreading around ifdefs related to
building global-isel. Since r309990, GlobalISel is not optional anymore,
thus, we can get rid of this mechanism all together.

NFC.

llvm-svn: 310115
2017-08-04 20:15:46 +00:00
Quentin Colombet c7652e22d7 [GlobalISel] Remove a stall comment in CMake.
Thanks to Diana Picus <diana.picus@linaro.org> for noticing.

NFC

llvm-svn: 310114
2017-08-04 20:15:41 +00:00
Kostya Serebryany 27cba58898 [libFuzzer] make a test more robust
llvm-svn: 310113
2017-08-04 20:09:15 +00:00
Zachary Turner 4f588a93bf Fix build breakage.
llvm-svn: 310112
2017-08-04 20:07:08 +00:00
Nico Weber d7d98aa49f minor grammar fix
llvm-svn: 310111
2017-08-04 20:06:03 +00:00
Kostya Serebryany 1d7a33b8ae [libFuzzer] remove the now redundant 'LLVMFuzzer-' prefix from libFuzzer tests
llvm-svn: 310110
2017-08-04 20:05:25 +00:00
Vlad Tsyrklevich 8d7755e7aa CFI: Move STL allocator blacklist to clang
Summary:
The regular expression to match STL allocators can't easily account for
C++ mangling compression and fails to match some valid instances of STL
allocators. Perform this logic in clang instead.

Motivated by crbug.com/751385.

Reviewers: pcc, kcc, llvm-commits

Reviewed By: pcc

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

llvm-svn: 310109
2017-08-04 20:04:01 +00:00
Zachary Turner f1ca78c253 [lld] Write the absolute PDB path to the debug directory.
This matches the behavior of MSVC's linker.

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

llvm-svn: 310108
2017-08-04 20:02:55 +00:00
Zachary Turner fb1cd5090c [llvm-pdbutil] Dump image section headers.
Image section headers are stored in the DBI stream, but we
had no way to dump them.  This patch adds dumping support,
along with some tests that LLD actually dumps them correctly.

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

llvm-svn: 310107
2017-08-04 20:02:38 +00:00
Kostya Serebryany 785cec91a4 [libFuzzer] split one test into several
llvm-svn: 310106
2017-08-04 20:01:04 +00:00
Vlad Tsyrklevich bf736037be Reland "CFI: blacklist STL allocate() from unrelated-casts"
Reland r310097 with a unit test fix for MS ABI build bots.

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

llvm-svn: 310105
2017-08-04 19:50:39 +00:00
Alexey Bataev be83fad57e [OPENMP][DEBUG] Set proper address space info if required by target.
Arguments, passed to the outlined function, must have correct address
space info for proper Debug info support. Patch sets global address
space for arguments that are mapped and passed by reference.

Also, cuda-gdb does not handle reference types correctly, so reference
arguments are represented as pointers.

llvm-svn: 310104
2017-08-04 19:46:10 +00:00
Siddharth Bhat 638316da5b [PPCGCodeGeneration] [NFC] Log every location from which PPCGCodegen bails.
This is useful when trying to understand why no GPU code was produced.

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

llvm-svn: 310103
2017-08-04 19:36:40 +00:00
Sanjay Patel 029fc7719b [InstCombine] auto-generate test checks; NFC
llvm-svn: 310101
2017-08-04 19:29:32 +00:00
George Karpenkov b0c2bb572d [libFuzzer tests] Only enable libFuzzer tests if
-DLIBFUZZER_ENABLE_TESTS=ON is set.

llvm-svn: 310100
2017-08-04 19:29:16 +00:00
Vlad Tsyrklevich 3fed079f8c Revert "CFI: blacklist STL allocate() from unrelated-casts"
This reverts commit r310097.

llvm-svn: 310099
2017-08-04 19:17:16 +00:00
Alexey Bataev 2c7eee5b84 [OPENMP] Unify generation of outlined function calls.
llvm-svn: 310098
2017-08-04 19:10:54 +00:00
Vlad Tsyrklevich 44200125e9 CFI: blacklist STL allocate() from unrelated-casts
Summary:
Previously, STL allocators were blacklisted in compiler_rt's
cfi_blacklist.txt because they mandated a cast from void* to T* before
object initialization completed. This change moves that logic into the
front end because C++ name mangling supports a substitution compression
mechanism for symbols that makes it difficult to blacklist the mangled
symbol for allocate() using a regular expression.

Motivated by crbug.com/751385.

Reviewers: pcc, kcc

Reviewed By: pcc

Subscribers: cfe-commits

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

llvm-svn: 310097
2017-08-04 19:10:11 +00:00
Florian Gross fa857b174d [clang-tidy] Added clang-tidy test cases related to rL310095
Differential Revision: https://reviews.llvm.org/D36308

llvm-svn: 310096
2017-08-04 19:01:56 +00:00
Florian Gross 4a72b4db55 [ASTMatcher] Add handling for DeducedType to HasDeclarationMatcher
HasDeclarationMatcher did not handle DeducedType, it always returned false for deduced types.

So with code like this:
struct X{};
auto x = X{};

This did no longer match:
varDecl(hasType(recordDecl(hasName("X"))))

Because HasDeclarationMatcher didn't resolve the DeducedType of x.

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

llvm-svn: 310095
2017-08-04 18:59:19 +00:00
Ulrich Weigand a11f63a952 [SystemZ] Add support for 128-bit atomic load/store/cmpxchg
This adds support for the main 128-bit atomic operations,
using the SystemZ instructions LPQ, STPQ, and CDSG.

Generating these instructions is a bit more complex than usual
since the i128 type is not legal for the back-end.  Therefore,
we have to hook the LowerOperationWrapper and ReplaceNodeResults
TargetLowering callbacks.

llvm-svn: 310094
2017-08-04 18:57:58 +00:00
Ulrich Weigand 02f1c02c27 [SystemZ] Eliminate unnecessary serialization operations
We currently emit a serialization operation (bcr 14, 0) before every
atomic load and after every atomic store.  This is overly conservative.
The SystemZ architecture actually does not require any serialization
for atomic loads, and a serialization after an atomic store only if
we need to enforce sequential consistency.  This is what other compilers
for the platform implement as well.

llvm-svn: 310093
2017-08-04 18:53:35 +00:00
Evgeny Stupachenko 38197c66a1 Fix PR33514
Summary:
The bug was uncovered after fix of  PR23384 (part 3 of 3).
The patch restricts pointer multiplication in SCEV computaion for ICmpZero.

Reviewers: qcolombet

Differential Revision: http://reviews.llvm.org/D36170

From: Evgeny Stupachenko <evstupac@gmail.com>
                         <evgeny.v.stupachenko@intel.com>
llvm-svn: 310092
2017-08-04 18:46:13 +00:00