platform/upstream/llvm.git
6 years ago[MachineOutliner] Add DISubprograms to outlined functions.
Jessica Paquette [Thu, 18 Jan 2018 00:00:58 +0000 (00:00 +0000)]
[MachineOutliner] Add DISubprograms to outlined functions.

Before, it wasn't possible to get backtraces inside outlined functions. This
commit adds DISubprograms to the IR functions created by the outliner which
makes this possible. Also attached a test that ensures that the produced
debug information is correct. This is useful to users that want to debug
outlined code.

llvm-svn: 322789

6 years ago[CodeGen] Hoist common AsmPrinter code out of X86, ARM, and AArch64
Reid Kleckner [Wed, 17 Jan 2018 23:55:23 +0000 (23:55 +0000)]
[CodeGen] Hoist common AsmPrinter code out of X86, ARM, and AArch64

Every known PE COFF target emits /EXPORT: linker flags into a .drective
section. The AsmPrinter should handle this.

While we're at it, use global_values() and emit each export flag with
its own .ascii directive. This should make the .s file output more
readable.

llvm-svn: 322788

6 years ago[analyzer] operator new: Add a new checker callback, check::NewAllocator.
Artem Dergachev [Wed, 17 Jan 2018 23:46:13 +0000 (23:46 +0000)]
[analyzer] operator new: Add a new checker callback, check::NewAllocator.

The callback runs after operator new() and before the construction and allows
the checker to access the casted return value of operator new() (in the
sense of r322780) which is not available in the PostCall callback for the
allocator call.

Update MallocChecker to use the new callback instead of PostStmt<CXXNewExpr>,
which gets called after the constructor.

Differential Revision: https://reviews.llvm.org/D41406
rdar://problem/12180598

llvm-svn: 322787

6 years ago[LangRef] Clarify Varargs forwarding for musttail calls.
Florian Hahn [Wed, 17 Jan 2018 23:29:25 +0000 (23:29 +0000)]
[LangRef] Clarify Varargs forwarding for musttail calls.

This clarification was suggested by @efriedma in D41335, which uses this
behavior to inline musttail calls with varargs.

Reviewers: hfinkel, efriedma, rnk

Reviewed By: rnk

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

llvm-svn: 322786

6 years ago[hwasan] LLVM-level flags for linux kernel-compatible hwasan instrumentation.
Evgeniy Stepanov [Wed, 17 Jan 2018 23:24:38 +0000 (23:24 +0000)]
[hwasan] LLVM-level flags for linux kernel-compatible hwasan instrumentation.

Summary:
-hwasan-mapping-offset defines the non-zero shadow base address.
-hwasan-kernel disables calls to __hwasan_init in module constructors.
Unlike ASan, -hwasan-kernel does not force callback instrumentation.
This is controlled separately with -hwasan-instrument-with-calls.

Reviewers: kcc

Subscribers: srhines, hiraditya, llvm-commits

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

llvm-svn: 322785

6 years ago[Sanitizers] Make common allocator agnostic to failure handling modes.
Alex Shlyapnikov [Wed, 17 Jan 2018 23:20:36 +0000 (23:20 +0000)]
[Sanitizers] Make common allocator agnostic to failure handling modes.

Summary:
Make common allocator agnostic to failure handling modes and move the
decision up to the particular sanitizer's allocator, where the context
is available (call stack, parameters, return nullptr/crash mode etc.)

It simplifies the common allocator and allows the particular sanitizer's
allocator to generate more specific and detailed error reports (which
will be implemented later).

The behavior is largely the same, except one case, the violation of the
common allocator's check for "size + alignment" overflow is now reportied
as OOM instead of "bad request". It feels like a worthy tradeoff and
"size + alignment" is huge in this case anyway (thus, can be interpreted
as not enough memory to satisfy the request). There's also a Report()
statement added there.

Reviewers: eugenis

Subscribers: kubamracek, llvm-commits, #sanitizers

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

llvm-svn: 322784

6 years ago[ASTMatchers] Support generating docs for single-line matchers
Benjamin Kramer [Wed, 17 Jan 2018 23:14:49 +0000 (23:14 +0000)]
[ASTMatchers] Support generating docs for single-line matchers

clang-format likes this format. PR35989.

llvm-svn: 322783

6 years ago[scudo] Fix for the Scudo interface function scope
Kostya Kortchinsky [Wed, 17 Jan 2018 23:10:02 +0000 (23:10 +0000)]
[scudo] Fix for the Scudo interface function scope

Summary:
A forgotten include in `scudo_allocator.cpp` made the symbol only local :/

Before:
```
nm ./lib/clang/7.0.0/lib/linux/libclang_rt.scudo-i686-android.so | grep rss
00024730 t __scudo_set_rss_limit
```
After:
```
nm ./lib/clang/7.0.0/lib/linux/libclang_rt.scudo-i686-android.so | grep rs
00024760 T __scudo_set_rss_limit
```
And we want `T`!

This include also means that we can get rid of the `extern "C"` in the C++
file, the compiler does fine without it (note that this was already the case
for all the `__sanitizer_*` interface functions.

Reviewers: alekseyshl, eugenis

Reviewed By: eugenis

Subscribers: #sanitizers, llvm-commits

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

llvm-svn: 322782

6 years ago[analyzer] operator new: Fix ambigious type name.
Artem Dergachev [Wed, 17 Jan 2018 23:03:25 +0000 (23:03 +0000)]
[analyzer] operator new: Fix ambigious type name.

Hopefully fixes an MSVC buildbot failure.

llvm-svn: 322781

6 years ago[analyzer] operator new: Fix memory space for the returned region.
Artem Dergachev [Wed, 17 Jan 2018 22:58:35 +0000 (22:58 +0000)]
[analyzer] operator new: Fix memory space for the returned region.

Make sure that with c++-allocator-inlining=true we have the return value of
conservatively evaluated operator new() in the correct memory space (heap).
This is a regression/omission that worked well in c++-allocator-inlining=false.

Heap regions are superior to regular symbolic regions because they have
stricter aliasing constraints: heap regions do not alias each other or global
variables.

Differential Revision: https://reviews.llvm.org/D41266
rdar://problem/12180598

llvm-svn: 322780

6 years ago[Sema] Allow conversion between long double and __float128.
Benjamin Kramer [Wed, 17 Jan 2018 22:56:57 +0000 (22:56 +0000)]
[Sema] Allow conversion between long double and __float128.

We should only ban this if long double is a double double. x86's 80 bit
long double is fine and supported by the backend.

llvm-svn: 322779

6 years ago[DOXYGEN] Fix doxygen and content issues in xmmintrin.h
Douglas Yung [Wed, 17 Jan 2018 22:53:15 +0000 (22:53 +0000)]
[DOXYGEN] Fix doxygen and content issues in xmmintrin.h

- Fix inaccurate instruction listings.
- Fix small issues in _mm_getcsr and _mm_setcsr.
- Fix description of NaN handling in comparison intrinsics.
- Fix inaccurate description of _mm_movemask_pi8.
- Fix inaccurate instruction mappings.
- Fix typos.
- Clarify wording on some descriptions.
- Fix bit ranges in return value.
- Fix typo in _mm_move_ms intrinsic instruction since it operates on singe-precision values, not double.
- This patch was made by Craig Flores

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

llvm-svn: 322778

6 years ago[analyzer] operator new: Model the cast of returned pointer into object type.
Artem Dergachev [Wed, 17 Jan 2018 22:51:19 +0000 (22:51 +0000)]
[analyzer] operator new: Model the cast of returned pointer into object type.

According to [basic.stc.dynamic.allocation], the return type of any C++
overloaded operator new() is "void *". However, type of the new-expression
"new T()" and the type of "this" during construction of "T" are both "T *".

Hence an implicit cast, which is not present in the AST, needs to be performed
before the construction. This patch adds such cast in the case when the
allocator was indeed inlined. For now, in the case where the allocator was *not*
inlined we still use the same symbolic value (which is a pure SymbolicRegion of
type "T *") because it is consistent with how we represent the casts and causes
less surprise in the checkers after switching to the new behavior.

The better approach would be to represent that value as a cast over a
SymbolicRegion of type "void *", however we have technical difficulties
conjuring such region without any actual expression of type "void *" present in
the AST.

Differential Revision: https://reviews.llvm.org/D41250
rdar://problem/12180598

llvm-svn: 322777

6 years agoFix nodiscard failure tests on compilers w/o -verify.
Eric Fiselier [Wed, 17 Jan 2018 22:48:09 +0000 (22:48 +0000)]
Fix nodiscard failure tests on compilers w/o -verify.

Previously .fail.cpp tests for nodiscard were run with -Wunused-result
being a warning, not an error, when the compiler didn't support -verify.

When -verify isn't enabled this change judiciously adds -Werror=unused-result
when to only the failure tests containing the // expected-error string for nodiscard.

As a drive-by change, this patch also adds a missing // UNSUPPORTED: c++2a to
a test which was only supposed to run in C++ <= 11.

llvm-svn: 322776

6 years ago[analyzer] NFC: Forbid array elements of void type.
Artem Dergachev [Wed, 17 Jan 2018 22:40:36 +0000 (22:40 +0000)]
[analyzer] NFC: Forbid array elements of void type.

Represent the symbolic value for results of pointer arithmetic on void pointers
in a different way: instead of making void-typed element regions, make
char-typed element regions.

Add an assertion that ensures that no void-typed regions are ever constructed.

This is a refactoring of internals that should not immediately affect
the analyzer's (default) behavior.

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

llvm-svn: 322775

6 years ago[analyzer] operator new: Use the correct region for the constructor.
Artem Dergachev [Wed, 17 Jan 2018 22:34:23 +0000 (22:34 +0000)]
[analyzer] operator new: Use the correct region for the constructor.

The -analyzer-config c++-allocator-inlining experimental option allows the
analyzer to reason about C++ operator new() similarly to how it reasons about
regular functions. In this mode, operator new() is correctly called before the
construction of an object, with the help of a special CFG element.

However, the subsequent construction of the object was still not performed into
the region of memory returned by operator new(). The patch fixes it.

Passing the value from operator new() to the constructor and then to the
new-expression itself was tricky because operator new() has no call site of its
own in the AST. The new expression itself is not a good call site because it
has an incorrect type (operator new() returns 'void *', while the new expression
is a pointer to the allocated object type). Additionally, lifetime of the new
expression in the environment makes it unsuitable for passing the value.
For that reason, an additional program state trait is introduced to keep track
of the return value.

Finally this patch relaxes restrictions on the memory region class that are
required for inlining the constructor. This change affects the old mode as well
(c++-allocator-inlining=false) and seems safe because these restrictions were
an overkill compared to the actual problems observed.

Differential Revision: https://reviews.llvm.org/D40560
rdar://problem/12180598

llvm-svn: 322774

6 years agoAdd a TargetOption to enable/disable GlobalISel
Volkan Keles [Wed, 17 Jan 2018 22:34:21 +0000 (22:34 +0000)]
Add a TargetOption to enable/disable GlobalISel

Summary:
This patch adds a new target option in order to control GlobalISel.
This will allow the users to enable/disable GlobalISel prior to the
backend by calling `TargetMachine::setGlobalISel(bool Enable)`.

No test case as there is already a test to check GlobalISel
command line options.
See: CodeGen/AArch64/GlobalISel/gisel-commandline-option.ll.

Reviewers: qcolombet, aemerson, ab, dsanders

Reviewed By: qcolombet

Subscribers: rovka, javed.absar, kristof.beyls, llvm-commits

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

llvm-svn: 322773

6 years agoAdd support for emitting libcalls for x86_fp80 -> fp128 and vice-versa
Benjamin Kramer [Wed, 17 Jan 2018 22:29:16 +0000 (22:29 +0000)]
Add support for emitting libcalls for x86_fp80 -> fp128 and vice-versa

compiler_rt doesn't provide them (yet), but libgcc does. PR34076.

llvm-svn: 322772

6 years agoAdd a ProfileCount class to represent entry counts.
Easwaran Raman [Wed, 17 Jan 2018 22:24:23 +0000 (22:24 +0000)]
Add a ProfileCount class to represent entry counts.

Summary:
The class wraps a uint64_t and an enum to represent the type of profile
count (real and synthetic) with some helper methods.

Reviewers: davidxl

Subscribers: llvm-commits

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

llvm-svn: 322771

6 years ago[X86][MMX] Add PR35982 test cases
Simon Pilgrim [Wed, 17 Jan 2018 22:19:31 +0000 (22:19 +0000)]
[X86][MMX] Add PR35982 test cases

FEMMS has the same problem as EMMS

llvm-svn: 322770

6 years ago[RISCV] Propagate -mabi and -march values to GNU assembler.
Ana Pazos [Wed, 17 Jan 2018 22:09:58 +0000 (22:09 +0000)]
[RISCV] Propagate -mabi and -march values to GNU assembler.

When using -fno-integrated-as flag, the gnu assembler produces code
with some default march/mabi which later causes linker failure due
to incompatible mabi/march.

In this patch we explicitly propagate -mabi and -march flags to the
GNU assembler.

In this patch we explicitly propagate -mabi and -march flags to the GNU assembler.

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

llvm-svn: 322769

6 years agoFix standalone test-suite run.
Eric Fiselier [Wed, 17 Jan 2018 22:07:09 +0000 (22:07 +0000)]
Fix standalone test-suite run.

This patch updates libc++abi's HandleOutOfTreeLLVM.cmake to match
libc++'s -- and more importantly, to fix a bug where llvm-lit wasn't
found/created when libc++abi was built out-of-tree. This prevented
the test suite from running.

llvm-svn: 322768

6 years ago[LegalizeDAG] Fix ATOMIC_CMP_SWAP_WITH_SUCCESS legalization.
Eli Friedman [Wed, 17 Jan 2018 22:04:36 +0000 (22:04 +0000)]
[LegalizeDAG] Fix ATOMIC_CMP_SWAP_WITH_SUCCESS legalization.

The code wasn't zero-extending correctly, so the comparison could
spuriously fail.

Adds some AArch64 tests to cover this case.

Inspired by D41791.

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

llvm-svn: 322767

6 years ago[polly] [ScopInfo] Don't use isl_val_get_num_si.
Eli Friedman [Wed, 17 Jan 2018 21:59:02 +0000 (21:59 +0000)]
[polly] [ScopInfo] Don't use isl_val_get_num_si.

isl_val_get_num_si crashes on overflow, so don't use it on arbitrary
integers.

Testcase only crashes on platforms where long is 32 bits because of the
signature of isl_val_get_num_si; not sure if it's possible to write a
testcase which crashes if long is 64 bits.

There are a few other places in polly which use isl_val_get_num_si;
they probably need to be fixed as well. I don't think polly uses any
of the other "long" isl APIs in an unsafe manner.

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

llvm-svn: 322766

6 years ago[SCEV] Fix typo. NFC.
Javed Absar [Wed, 17 Jan 2018 21:58:35 +0000 (21:58 +0000)]
[SCEV] Fix typo. NFC.

Fix confusing typo in comment.

llvm-svn: 322765

6 years ago[scudo] Limit by default the TSD pool to 2 on Android
Kostya Kortchinsky [Wed, 17 Jan 2018 21:54:48 +0000 (21:54 +0000)]
[scudo] Limit by default the TSD pool to 2 on Android

Summary:
jemalloc on Android currently uses 2 arenas
(https://android.googlesource.com/platform/external/jemalloc/+/master/Android.bp#64).
Since the Android toolchain absorbs compiler-rt and compiles it as is, we have
to enforce the same limit to somehow stay competitive in terms of memory usage.

The changes could either go in:
- `scudo_platform.h` with a default for Android of 2 (this is the solution
  implemented here);
- in `CMakeLists.txt` adding -DSCUDO_SHARED_TSD_POOL_SIZE=2 for Android.
- something else?

I don't have a strong opinion on how to do it, but it has to be done upstream
anyway.

Reviewers: alekseyshl, eugenis

Reviewed By: alekseyshl, eugenis

Subscribers: srhines, #sanitizers, llvm-commits

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

llvm-svn: 322764

6 years agorootn: Port from amd_builtins
Jan Vesely [Wed, 17 Jan 2018 21:22:14 +0000 (21:22 +0000)]
rootn: Port from amd_builtins

Passes piglit on turks and carrizo
fp64 passes ctx on carrizo

v2: fix formatting
    check fp32 denormal support at runtime

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322763

6 years agopowr: Port from amd_builtins
Jan Vesely [Wed, 17 Jan 2018 21:22:06 +0000 (21:22 +0000)]
powr: Port from amd_builtins

Passes piglit on turks and carrizo
fp64 passes cts on carrizo

v2: fix formatting
    check fp32 denormal support at runtime

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322762

6 years agopown: Port from amd_builtins
Jan Vesely [Wed, 17 Jan 2018 21:22:03 +0000 (21:22 +0000)]
pown: Port from amd_builtins

Passes piglit on turks and carrizo
fp64 passes CTS on carrizo

v2: fix formatting
    check fp32 denormal support at runtime

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322761

6 years agopow: Port from amd_builtins
Jan Vesely [Wed, 17 Jan 2018 21:21:35 +0000 (21:21 +0000)]
pow: Port from amd_builtins

Passes piglit on turks and carrizo
fp64 passes CTS on carrizo

v2: fix formatting
    check fp32 denormal support at runtime

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322760

6 years ago[clang-tidy] Adding Fuchsia checker for trailing returns
Julie Hockett [Wed, 17 Jan 2018 21:18:15 +0000 (21:18 +0000)]
[clang-tidy] Adding Fuchsia checker for trailing returns

Adds a check to the Fuchsia module to warn if a function has a trailing
return.

See https://fuchsia.googlesource.com/zircon/+/master/docs/cxx.md for
reference.

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

llvm-svn: 322759

6 years agoA third attempt to mark TestRdar12408181.py as skipped
Vedant Kumar [Wed, 17 Jan 2018 20:54:39 +0000 (20:54 +0000)]
A third attempt to mark TestRdar12408181.py as skipped

Due to an unfortunate difference between the open source test harness
and our internal harness, applying two @skip... decorators to this test
works in the internal build but not in the open source build.

I've tried another approach to skipping this test and tested it out with
the open source harness. Hopefully this sticks!

rdar://36417163

llvm-svn: 322756

6 years agoReland "[libFuzzer] Support using libc++"
Petr Hosek [Wed, 17 Jan 2018 20:39:14 +0000 (20:39 +0000)]
Reland "[libFuzzer] Support using libc++"

This is needed in case the users of libFuzzer use libc++ in their
code, which the fuzz target (libFuzzer) will be linked against.
When libc++ source is available, we build a private version of it
and link it against libFuzzer which allows using the same static
library against codebases which use both libc++ and libstdc++.

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

llvm-svn: 322755

6 years ago[globalisel][tablegen] Honour priority order within nested instructions.
Daniel Sanders [Wed, 17 Jan 2018 20:34:29 +0000 (20:34 +0000)]
[globalisel][tablegen] Honour priority order within nested instructions.

It appears that we haven't been prioritizing rules that contain nested
instructions properly. InstructionOperandMatcher didn't override
isHigherPriorityThan so it never compared the instructions/operands/predicates
inside nested instructions.

Fixes PR35926. Thanks to Diana Picus for the bug report.

llvm-svn: 322754

6 years ago[analyzer] introduce getSVal(Stmt *) helper on ExplodedNode, make sure the helper...
George Karpenkov [Wed, 17 Jan 2018 20:27:29 +0000 (20:27 +0000)]
[analyzer] introduce getSVal(Stmt *) helper on ExplodedNode, make sure the helper is used consistently

In most cases using
`N->getState()->getSVal(E, N->getLocationContext())`
is ugly, verbose, and also opens up more surface area for bugs if an
inconsistent location context is used.

This patch introduces a helper on an exploded node, and ensures
consistent usage of either `ExplodedNode::getSVal` or
`CheckContext::getSVal` across the codebase.
As a result, a large number of redundant lines is removed.

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

llvm-svn: 322753

6 years ago[analyzer] Make isSubRegionOf reflexive
George Karpenkov [Wed, 17 Jan 2018 20:27:26 +0000 (20:27 +0000)]
[analyzer] Make isSubRegionOf reflexive

All usages of isSubRegionOf separately check for reflexive case, and in
any case, set theory tells us that each set is a subset of itself.

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

llvm-svn: 322752

6 years ago[WebAssembly] Simplify generation of "names" section
Sam Clegg [Wed, 17 Jan 2018 20:19:04 +0000 (20:19 +0000)]
[WebAssembly] Simplify generation of "names" section

Simplify generation of "names" section by simply iterating
over the DefinedFunctions array.

This even fixes some bugs, judging by the test changes required.
Some tests are asserting that functions are named multiple times,
other tests are asserting that the "names" section contains the
function's alias rather than its original name

Patch by Nicholas Wilson!

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

llvm-svn: 322751

6 years ago[analyzer] Better UI in html reports for displaying shortcuts help
George Karpenkov [Wed, 17 Jan 2018 20:06:26 +0000 (20:06 +0000)]
[analyzer] Better UI in html reports for displaying shortcuts help

Make the help window accessible, but don't show by default.
Use a different CSS class from macro.

llvm-svn: 322750

6 years ago[clang-format] Replace unordered_set with an array
Krasimir Georgiev [Wed, 17 Jan 2018 20:01:02 +0000 (20:01 +0000)]
[clang-format] Replace unordered_set with an array

Summary: This replaces an unordered_set from r322690 with an array and binary search.

Reviewers: bkramer, benhamilton

Reviewed By: bkramer, benhamilton

Subscribers: jolesiak, benhamilton, klimek, cfe-commits

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

llvm-svn: 322749

6 years agoRevert [PowerPC] This reverts commit rL322721
Zaara Syeda [Wed, 17 Jan 2018 20:00:15 +0000 (20:00 +0000)]
Revert [PowerPC] This reverts commit rL322721

Failing build bots. Revert the commit now.

llvm-svn: 322748

6 years ago[MDA] Use common code instead of reimplementing same. [NFC]
Philip Reames [Wed, 17 Jan 2018 19:57:19 +0000 (19:57 +0000)]
[MDA] Use common code instead of reimplementing same. [NFC]

llvm-svn: 322747

6 years ago[ASTMatchers] Add isNoReturn() match narrower for FunctionDeclarations
Roman Lebedev [Wed, 17 Jan 2018 19:40:55 +0000 (19:40 +0000)]
[ASTMatchers] Add isNoReturn() match narrower for FunctionDeclarations

Reviewers: aaron.ballman

Reviewed By: aaron.ballman

Subscribers: dblaikie, klimek, cfe-commits

Tags: #clang

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

llvm-svn: 322746

6 years ago[WebAssembly] Remove DEBUG_FUNCTION_NAME after llvm change
Sam Clegg [Wed, 17 Jan 2018 19:35:16 +0000 (19:35 +0000)]
[WebAssembly] Remove DEBUG_FUNCTION_NAME after llvm change

Patch by Nicholas Wilson!

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

llvm-svn: 322745

6 years agolibcxx: Disable CFI in function std::get_temporary_buffer.
Peter Collingbourne [Wed, 17 Jan 2018 19:32:35 +0000 (19:32 +0000)]
libcxx: Disable CFI in function std::get_temporary_buffer.

The specification of this function mandates a cast to uninitialized
T*, which is forbidden under CFI.

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

llvm-svn: 322744

6 years ago[GISel] Make constrainSelectedInstRegOperands() available to the legalizer. NFC
Aditya Nandakumar [Wed, 17 Jan 2018 19:31:33 +0000 (19:31 +0000)]
[GISel] Make constrainSelectedInstRegOperands() available to the legalizer. NFC

https://reviews.llvm.org/D42149

llvm-svn: 322743

6 years ago[DeclPrinter] Fix two cases that crash clang -ast-print.
Artem Belevich [Wed, 17 Jan 2018 19:29:39 +0000 (19:29 +0000)]
[DeclPrinter] Fix two cases that crash clang -ast-print.

Both are related to handling anonymous structures.
* clang didn't handle () around an anonymous struct variable.
* clang also crashed on syntax errors that could lead to other
  syntactic constructs following the declaration of an
  anonymous struct. While the code is invalid, that's not
  a good reason to panic compiler.

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

llvm-svn: 322742

6 years ago[WebAssembly] Remove debug names from symbol table
Sam Clegg [Wed, 17 Jan 2018 19:28:43 +0000 (19:28 +0000)]
[WebAssembly] Remove debug names from symbol table

Get rid of DEBUG_FUNCTION_NAME symbols. When we actually debug
data, maybe we'll want somewhere to put it... but having a symbol
that just stores the name of another symbol seems odd.
It means you have multiple Symbols with the same name, one
containing the actual function and another containing the name!

Store the names in a vector on the WasmObjectFile when reading
them in. Also stash them on the WasmFunctions themselves.
The names are //not// "symbol names" or aliases or anything,
they're just the name that a debugger should show against the
function body itself. NB. The WasmObjectFile stores them so that
they can be exported in the YAML losslessly, and hence the tests
can be precise.

Enforce that the CODE section has been read in before reading
the "names" section. Requires minor adjustment to some tests.

Patch by Nicholas Wilson!

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

llvm-svn: 322741

6 years agoTry again to mark TestRdar12408181.py as skipped
Vedant Kumar [Wed, 17 Jan 2018 19:25:12 +0000 (19:25 +0000)]
Try again to mark TestRdar12408181.py as skipped

rdar://36417163

llvm-svn: 322740

6 years agoUse a got to access a hidden weak undefined on MachO.
Rafael Espindola [Wed, 17 Jan 2018 19:19:55 +0000 (19:19 +0000)]
Use a got to access a hidden weak undefined on MachO.

Trying to link

__attribute__((weak, visibility("hidden"))) extern int foo;
int *main(void) {
  return &foo;
}

on OS X fails with

ld: 32-bit RIP relative reference out of range (-4294971318 max is +/-2GB): from _main (0x100000FAB) to _foo@0x00001000 (0x00000000) in '_main' from test.o for architecture x86_64

The problem being that 0 cannot be computed as a fixed difference from
%rip. Exactly the same issue exists on ELF and we can use the same
solution.

llvm-svn: 322739

6 years ago[ARM] Optimize {s,u}mul.with.overflow.
Joel Galenson [Wed, 17 Jan 2018 19:19:05 +0000 (19:19 +0000)]
[ARM] Optimize {s,u}mul.with.overflow.

This extends my previous patches to also optimize overflow-checked multiplies during SelectionDAG.

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

llvm-svn: 322738

6 years ago[ARM] Optimize {s,u}{add,sub}.with.overflow.
Joel Galenson [Wed, 17 Jan 2018 19:19:05 +0000 (19:19 +0000)]
[ARM] Optimize {s,u}{add,sub}.with.overflow.

The ARM backend contains code that tries to optimize compares by replacing them with an existing instruction that sets the flags the same way. This allows it to replace a "cmp" with a "adds", generalizing the code that replaces "cmp" with "sub". It also heuristically disables sinking of instructions that could potentially be used to replace compares (currently only if they're next to each other).

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

llvm-svn: 322737

6 years ago[coff] Print detailed timing information with /TIME.
Zachary Turner [Wed, 17 Jan 2018 19:16:26 +0000 (19:16 +0000)]
[coff] Print detailed timing information with /TIME.

The classes used to print and update time information are in
common, so other linkers could use this as well if desired.

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

llvm-svn: 322736

6 years ago[Attributes] Fix crash when attempting to remove alignment from an attribute list/set
Daniel Neilson [Wed, 17 Jan 2018 19:15:21 +0000 (19:15 +0000)]
[Attributes] Fix crash when attempting to remove alignment from an attribute list/set

Summary:
 Discovered while working on a patch to move alignment in
@llvm.memcpy/move/set from an arg into parameter attributes.

 The current implementations of AttributeSet::removeAttribute() and
AttributeList::removeAttribute crash when attempting to remove the
alignment attribute. Currently, these implementations add the
to-be-removed attributes to an AttrBuilder and then remove
the builder from the list/set. Alignment is special in that it
must be added to a builder with an integer value for the alignment;
attempts to add alignment to a builder without a value is an error.

 This change fixes the removeAttribute implementations for AttributeSet and
AttributeList to make them able to remove the alignment, and other similar,
attributes.

Reviewers: rnk, chandlerc, pete, javed.absar, reames

Reviewed By: rnk

Subscribers: llvm-commits

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

llvm-svn: 322735

6 years ago[X86][BTVER2] Reduce instregex usage (PR35955)
Simon Pilgrim [Wed, 17 Jan 2018 19:12:48 +0000 (19:12 +0000)]
[X86][BTVER2] Reduce instregex usage (PR35955)

Most are just replaced with instrs lists, but a few regexps have been further generalized to match more instructions with a single pattern.

llvm-svn: 322734

6 years ago[InstCombine] add baseline tests for D39958; NFC
Sanjay Patel [Wed, 17 Jan 2018 19:04:18 +0000 (19:04 +0000)]
[InstCombine] add baseline tests for D39958; NFC

llvm-svn: 322733

6 years ago[WebAssembly] Remove non-existent method declaration. NFC.
Sam Clegg [Wed, 17 Jan 2018 19:01:52 +0000 (19:01 +0000)]
[WebAssembly] Remove non-existent method declaration. NFC.

Patch by Nicholas Wilson!

llvm-svn: 322732

6 years ago[WebAssembly] Remove unused member variable. NFC.
Sam Clegg [Wed, 17 Jan 2018 18:58:50 +0000 (18:58 +0000)]
[WebAssembly] Remove unused member variable. NFC.

Patch by Nicholas Wilson!

llvm-svn: 322731

6 years ago[X86] Teach LowerBUILD_VECTOR to recognize pair-wise splats of 32-bit elements and...
Craig Topper [Wed, 17 Jan 2018 18:58:22 +0000 (18:58 +0000)]
[X86] Teach LowerBUILD_VECTOR to recognize pair-wise splats of 32-bit elements and use a 64-bit broadcast

If we are splatting pairs of 32-bit elements, we can use a 64-bit broadcast to get the job done.

We could probably could probably do this with other sizes too, for example four 16-bit elements. Or we could broadcast pairs of 16-bit elements using a 32-bit element broadcast. But I've left that as a future improvement.

I've also restricted this to AVX2 only because we can only broadcast loads under AVX.

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

llvm-svn: 322730

6 years ago[Parse] Forward brace locations to TypeConstructExpr
Vedant Kumar [Wed, 17 Jan 2018 18:53:51 +0000 (18:53 +0000)]
[Parse] Forward brace locations to TypeConstructExpr

When parsing C++ type construction expressions with list initialization,
forward the locations of the braces to Sema.

Without these locations, the code coverage pass crashes on the given test
case, because the pass relies on getLocEnd() returning a valid location.

Here is what this patch does in more detail:

  - Forwards init-list brace locations to Sema (ParseExprCXX),
  - Builds an InitializationKind with these locations (SemaExprCXX), and
  - Uses these locations for constructor initialization (SemaInit).

The remaining changes fall out of introducing a new overload for
creating direct-list InitializationKinds.

Testing: check-clang, and a stage2 coverage-enabled build of clang with
asserts enabled.

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

llvm-svn: 322729

6 years agoSkip a flaky test (TestRdar12408181.py)
Vedant Kumar [Wed, 17 Jan 2018 18:53:42 +0000 (18:53 +0000)]
Skip a flaky test (TestRdar12408181.py)

This test frequently times out on our bots. While we're investigating
the issue, mark the test as skipped so the builds aren't impacted as
much.

rdar://36417163

llvm-svn: 322728

6 years ago[WebAssembly] Fix typo in comment
Sam Clegg [Wed, 17 Jan 2018 18:50:30 +0000 (18:50 +0000)]
[WebAssembly] Fix typo in comment

Patch by Nicholas Wilson!

llvm-svn: 322727

6 years ago[WebAssembly] Refactor InputChunk.getSize(). NFC
Sam Clegg [Wed, 17 Jan 2018 18:49:11 +0000 (18:49 +0000)]
[WebAssembly] Refactor InputChunk.getSize(). NFC

Also, remove trailing semicolons.

Patch by Nicholas Wilson!

llvm-svn: 322726

6 years ago[utils] Make .cfi_startproc optional for powerpc
Fangrui Song [Wed, 17 Jan 2018 18:48:50 +0000 (18:48 +0000)]
[utils] Make .cfi_startproc optional for powerpc

Summary: llc sometimes may not emit .cfi_startproc which makes func_dict to have less entries.

Subscribers: nemanjai, llvm-commits

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

llvm-svn: 322725

6 years ago[X86] When legalizing (v64i1 select i8, v64i1, v64i1) make sure not to introduce...
Craig Topper [Wed, 17 Jan 2018 18:46:01 +0000 (18:46 +0000)]
[X86] When legalizing (v64i1 select i8, v64i1, v64i1) make sure not to introduce bitcasts to i64 in 32-bit mode

We legalize selects of masks with scalar conditions using a bitcast to an integer type. But if we are in 32-bit mode we can't convert v64i1 to i64. So instead split the v64i1 to v32i1 and concat it back together. Each half will then be legalized by bitcasting to i32 which is fine.

The test case is a little indirect. If we have the v64i1 select in IR it will get legalized by legalize vector ops which has a run of type legalization after it. That type legalization run is able to fix this i64 bitcast. So in order to avoid that we need a build_vector of a splat which legalize vector ops will ignore. Legalize DAG will then turn that into a select via LowerBUILD_VECTORvXi1. And the select will get legalized. In this case there is no type legalizer run to cleanup the bitcast.

This fixes pr35972.

llvm-svn: 322724

6 years ago[X86][SSE] Add v4i16 PMULLD tests
Simon Pilgrim [Wed, 17 Jan 2018 18:41:27 +0000 (18:41 +0000)]
[X86][SSE] Add v4i16 PMULLD tests

llvm-svn: 322723

6 years ago[clangd] Deduplicate symbols collected in global-symbol-builder tool.
Eric Liu [Wed, 17 Jan 2018 18:27:41 +0000 (18:27 +0000)]
[clangd] Deduplicate symbols collected in global-symbol-builder tool.

Summary: After D42111, the executor framework no longer deduplicate tool results.

Reviewers: bkramer, sammccall

Subscribers: klimek, ilya-biryukov, cfe-commits

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

llvm-svn: 322722

6 years ago[PowerPC] Add handling for ColdCC calling convention and a pass to mark
Zaara Syeda [Wed, 17 Jan 2018 18:22:55 +0000 (18:22 +0000)]
[PowerPC] Add handling for ColdCC calling convention and a pass to mark
candidates with coldcc attribute.

This patch adds support for the coldcc calling convention for Power.
This changes the set of non-volatile registers. It includes a pass to stress
test the implementation by marking all static directly called functions with
the coldcc attribute through the option -enable-coldcc-stress-test. It also
includes an option, -ppc-enable-coldcc, to add the coldcc attribute to
functions which are cold at all call sites based on BlockFrequencyInfo when
the containing function does not call any non cold functions.

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

llvm-svn: 322721

6 years ago[Index] Fix GCC warning again :-(
Sam McCall [Wed, 17 Jan 2018 18:20:57 +0000 (18:20 +0000)]
[Index] Fix GCC warning again :-(

llvm-svn: 322720

6 years agoFix MSVC "not all control paths return a value" warning.
Simon Pilgrim [Wed, 17 Jan 2018 18:16:28 +0000 (18:16 +0000)]
Fix MSVC "not all control paths return a value" warning.

llvm-svn: 322719

6 years ago[ARC] Add missing condition codes.
Tatyana Krasnukha [Wed, 17 Jan 2018 17:58:28 +0000 (17:58 +0000)]
[ARC] Add missing condition codes.

Summary: Added VS and VC, required for disassembling.

Reviewers: petecoup

Reviewed By: petecoup

Subscribers: llvm-commits

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

llvm-svn: 322718

6 years ago[clang-tidy] Fixing Fuchsia overloaded operator warning message
Julie Hockett [Wed, 17 Jan 2018 17:41:50 +0000 (17:41 +0000)]
[clang-tidy] Fixing Fuchsia overloaded operator warning message

Updating Fuchsia overloaded operator warning message for clarity.

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

llvm-svn: 322692

6 years ago[Tooling] Don't deduplicate tool results in the All-TUs executor.
Eric Liu [Wed, 17 Jan 2018 17:37:11 +0000 (17:37 +0000)]
[Tooling] Don't deduplicate tool results in the All-TUs executor.

Summary:
As result deduplication or reduction is not supported in the framework,
we should leave the deplication to tools (if needed) until the framework supports it.

Reviewers: bkramer

Subscribers: klimek, cfe-commits

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

llvm-svn: 322691

6 years ago[Format] Improve ObjC header guessing heuristic
Ben Hamilton [Wed, 17 Jan 2018 17:33:08 +0000 (17:33 +0000)]
[Format] Improve ObjC header guessing heuristic

Summary:
This improves upon the previous Objective-C header guessing heuristic
from rC320479.

Now, we run the lexer on C++ header files and look for Objective-C
keywords and syntax. We also look for Foundation types.

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

Reviewers: jolesiak, krasimir

Reviewed By: jolesiak

Subscribers: klimek, cfe-commits

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

llvm-svn: 322690

6 years agoRevert "[libFuzzer] Support using libc++"
Petr Hosek [Wed, 17 Jan 2018 17:24:56 +0000 (17:24 +0000)]
Revert "[libFuzzer] Support using libc++"

This reverts commit r322604: test is failing for standalone compiler-rt.

llvm-svn: 322689

6 years ago[SystemZ] Handle BRCTH branches correctly in SystemZLongBranch.cpp.
Jonas Paulsson [Wed, 17 Jan 2018 17:16:07 +0000 (17:16 +0000)]
[SystemZ]  Handle BRCTH branches correctly in SystemZLongBranch.cpp.

BRCTH is capable of a long branch which needs to be recognized during branch
relaxation. This is done by checking for ExtraRelaxSize == 0.

Review: Ulrich Weigand
llvm-svn: 322688

6 years agoUpdate dump_ast_matchers for many recent changes.
Benjamin Kramer [Wed, 17 Jan 2018 16:50:14 +0000 (16:50 +0000)]
Update dump_ast_matchers for many recent changes.

The html file hasn't been updated in a long time so there are quite a
few changes in there. No matchers were removed though.

llvm-svn: 322687

6 years agoAMDGPU: Error in SIAnnotateControlFlow instead of assert
Matt Arsenault [Wed, 17 Jan 2018 16:30:01 +0000 (16:30 +0000)]
AMDGPU: Error in SIAnnotateControlFlow instead of assert

This assert typically happens if an unstructured CFG is passed
to the pass. This can happen if the pass is run independently
without the structurizer.

llvm-svn: 322685

6 years agoAdd tests for ConstantFoldTerminator preserving DomTree
Matt Arsenault [Wed, 17 Jan 2018 16:27:17 +0000 (16:27 +0000)]
Add tests for ConstantFoldTerminator preserving DomTree

With my bad luck I separately implemented the DomTree preservation
for ConstantFoldTerminator before r322401 was committed. Commit the
tests which I think still provide some value.

llvm-svn: 322683

6 years ago[clang-format] adds enclosing function detection to raw string formatting
Krasimir Georgiev [Wed, 17 Jan 2018 16:17:26 +0000 (16:17 +0000)]
[clang-format] adds enclosing function detection to raw string formatting

Summary: This patch adds enclosing function detection to raw string formatting.

Reviewers: bkramer

Reviewed By: bkramer

Subscribers: klimek, cfe-commits

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

llvm-svn: 322678

6 years agoAttempt to fix test/Driver/masm.c on the ARM bots.
Nico Weber [Wed, 17 Jan 2018 16:03:08 +0000 (16:03 +0000)]
Attempt to fix test/Driver/masm.c on the ARM bots.

llvm-svn: 322674

6 years ago[Index] Fix GCC warning. This is silly, but no llvm_unreachable and no C99.
Sam McCall [Wed, 17 Jan 2018 15:57:14 +0000 (15:57 +0000)]
[Index] Fix GCC warning. This is silly, but no llvm_unreachable and no C99.

llvm-svn: 322672

6 years ago[clangd] Avoid divide-by-zero
Sam McCall [Wed, 17 Jan 2018 15:25:55 +0000 (15:25 +0000)]
[clangd] Avoid divide-by-zero

llvm-svn: 322668

6 years ago[ARM GlobalISel] Rename local variable. NFC
Diana Picus [Wed, 17 Jan 2018 15:25:37 +0000 (15:25 +0000)]
[ARM GlobalISel] Rename local variable. NFC

llvm-svn: 322667

6 years ago[lldb][PPC64] Fixed long double variables dump
Pavel Labath [Wed, 17 Jan 2018 15:11:20 +0000 (15:11 +0000)]
[lldb][PPC64] Fixed long double variables dump

Summary:
LLDB's DumpDataExtractor was not prepared to handle PowerPC's long double type: PPCDoubleDouble.

As it is somewhat special, treating it as other regular float types resulted in getting wrong information about it.
In this particular case, llvm::APFloat::getSizeInBits(PPCDoubleDouble) was returning 0.

This caused the TestSetValues.py test to fail, because lldb would abort on an assertion failure on APInt(), because of the invalid size.

Since in the PPC case the value of item_byte_size was correct and the
getSizeInBits call was only added to support x87DoubleExtended
semantics, this restricts the usage of getSizeInBits to the x87
semantics.

Reviewers: labath, clayborg

Reviewed By: labath

Subscribers: llvm-commits, anajuliapc, alexandreyy, lbianc, lldb-commits

Differential Revision: https://reviews.llvm.org/D42083
Author: Leandro Lupori <leandro.lupori@gmail.com>

llvm-svn: 322666

6 years ago[ARM GlobalISel] Add instselect tests for G_FPEXT and G_FPTRUNC
Diana Picus [Wed, 17 Jan 2018 15:01:19 +0000 (15:01 +0000)]
[ARM GlobalISel] Add instselect tests for G_FPEXT and G_FPTRUNC

G_FPEXT and G_FPTRUNC are handled by TableGen'erated code, just add
tests.

llvm-svn: 322665

6 years agoFix assertion in ObjectFileELF
Pavel Labath [Wed, 17 Jan 2018 14:40:25 +0000 (14:40 +0000)]
Fix assertion in ObjectFileELF

In D40616 I (mistakenly) assumed that logging an llvm::Error would clear
it. This of course is only true if logging is actually enabled.

This fixes the assertion by manually clearing the error, but it raises
the point of whether we need a special error-clearing logging primitive.

llvm-svn: 322664

6 years ago[AArch64] Fix incorrect LD1 of 16-bit FP vectors in big endian
Pablo Barrio [Wed, 17 Jan 2018 14:39:29 +0000 (14:39 +0000)]
[AArch64] Fix incorrect LD1 of 16-bit FP vectors in big endian

Summary:
Loading a vector of 4 half-precision FP sometimes results in an LD1
of 2 single-precision FP + a reversal. This results in an incorrect
byte swap due to the conversion from little endian to big endian.

In order to generate the correct byte swap, it is easier to
generate the correct LD1 of 4 half-precision FP, thus avoiding the
subsequent reversal.

Reviewers: craig.topper, jmolloy, olista01

Reviewed By: olista01

Subscribers: efriedma, samparker, SjoerdMeijer, rogfer01, aemerson, rengolin, javed.absar, kristof.beyls, llvm-commits

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

llvm-svn: 322663

6 years ago[InstCombine] fix demanded-bits propagation for zext/trunc
Sanjay Patel [Wed, 17 Jan 2018 14:39:28 +0000 (14:39 +0000)]
[InstCombine] fix demanded-bits propagation for zext/trunc

I was comparing the demanded-bits implementations between InstCombine
and TargetLowering as part of investigating questions in D42088 and
noticed that this was wrong in IR. We were losing all of the prior
known bits when we got back to the 'zext'.

llvm-svn: 322662

6 years ago[Sema] Add visited contexts to CodeCompleteContext
Haojian Wu [Wed, 17 Jan 2018 14:29:25 +0000 (14:29 +0000)]
[Sema] Add visited contexts to CodeCompleteContext

Summary:
This would allow code completion clients to know which context is visited during Sema code completion.

Also some changes:
 * add `EnteredContext` callback in VisibleDeclConsumer.
 * add a simple unittest for sema code completion (only for visited contexts at the moment).

Reviewers: ilya-biryukov

Reviewed By: ilya-biryukov

Subscribers: mgorny, bkramer, cfe-commits

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

llvm-svn: 322661

6 years ago[InstCombine] add test to show hole in demanded bits; NFC
Sanjay Patel [Wed, 17 Jan 2018 14:27:35 +0000 (14:27 +0000)]
[InstCombine] add test to show hole in demanded bits; NFC

llvm-svn: 322660

6 years ago[RISCV] Allow RISCVAsmBackend::writeNopData to generate c.nop when supported
Alex Bradbury [Wed, 17 Jan 2018 14:17:12 +0000 (14:17 +0000)]
[RISCV] Allow RISCVAsmBackend::writeNopData to generate c.nop when supported

When the compressed instruction set is enabled, the 16-bit c.nop can be
generated if necessary.

Differential Revision: https://reviews.llvm.org/D41221
Patch by Shiva Chen.

llvm-svn: 322658

6 years ago[ARM GlobalISel] Map G_FPEXT and G_FPTRUNC to FPR
Diana Picus [Wed, 17 Jan 2018 14:14:14 +0000 (14:14 +0000)]
[ARM GlobalISel] Map G_FPEXT and G_FPTRUNC to FPR

llvm-svn: 322657

6 years ago[AMDGPU] add LDS f32 intrinsics
Daniil Fukalov [Wed, 17 Jan 2018 14:05:05 +0000 (14:05 +0000)]
[AMDGPU] add LDS f32 intrinsics

added llvm.amdgcn.atomic.{add|min|max}.f32 intrinsics
to allow generate ds_{add|min|max}[_rtn]_f32 instructions
needed for OpenCL float atomics in LDS

Reviewed by: arsenm

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

llvm-svn: 322656

6 years ago[AMDGPU][MC][GFX9] Enable inline constants for SDWA operands
Dmitry Preobrazhensky [Wed, 17 Jan 2018 14:00:48 +0000 (14:00 +0000)]
[AMDGPU][MC][GFX9] Enable inline constants for SDWA operands

See bug 35771: https://bugs.llvm.org/show_bug.cgi?id=35771

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

Reviewers: vpykhtin, artem.tamazov, arsenm
llvm-svn: 322655

6 years agoSimplify some LogTest tests
Pavel Labath [Wed, 17 Jan 2018 13:46:06 +0000 (13:46 +0000)]
Simplify some LogTest tests

This removes boilerplate for setting up a log channel and capturing the
output from some of the tests. I do this by moving the setup code into a
test fixture and adding a logAndTakeOutput utility function to log some
string and then retrieve it from the log.

I also use some googlemock goodies to simplify a couple of assertions.

llvm-svn: 322653

6 years ago[clang-cl] Let /FA output use intel assembly.
Nico Weber [Wed, 17 Jan 2018 13:34:20 +0000 (13:34 +0000)]
[clang-cl] Let /FA output use intel assembly.

cl's assembly output is in intel syntax, so clang-cl's should be too, PR35031.
https://reviews.llvm.org/D42157

llvm-svn: 322652

6 years ago[ARM GlobalISel] Legalize G_FPEXT and G_FPTRUNC
Diana Picus [Wed, 17 Jan 2018 13:34:10 +0000 (13:34 +0000)]
[ARM GlobalISel] Legalize G_FPEXT and G_FPTRUNC

Mark G_FPEXT and G_FPTRUNC as legal or libcall, depending on hardware
support, but only for conversions between float and double.

Also add the necessary boilerplate so that the LegalizerHelper can
introduce the required libcalls. This also works only for float and
double, but isn't too difficult to extend when the need arises.

llvm-svn: 322651

6 years ago[Transforms] Support making mutable versions of new-format TBAA access tags
Ivan A. Kosarev [Wed, 17 Jan 2018 13:29:54 +0000 (13:29 +0000)]
[Transforms] Support making mutable versions of new-format TBAA access tags

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

llvm-svn: 322650

6 years agoAdd new interceptor: acct(2)
Kamil Rytarowski [Wed, 17 Jan 2018 13:05:14 +0000 (13:05 +0000)]
Add new interceptor: acct(2)

Summary:
acct - enable or disable process accounting

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, vitalybuka

Reviewed By: vitalybuka

Subscribers: kubamracek, llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 322646

6 years ago[X86] Don't mutate shuffle arguments after early-out for AVX512
Benjamin Kramer [Wed, 17 Jan 2018 13:01:06 +0000 (13:01 +0000)]
[X86] Don't mutate shuffle arguments after early-out for AVX512

The match* functions have the annoying behavior of modifying its inputs.
Save and restore the inputs, just in case the early out for AVX512 is
hit. This is still not great and its only a matter of time this kind of
bug happens again, but I couldn't come up with a better pattern without
rewriting significant chunks of this code. Fixes PR35977.

llvm-svn: 322644