platform/upstream/llvm.git
6 years ago[clangd] Deduplicate query scopes.
Eric Liu [Tue, 6 Nov 2018 11:17:40 +0000 (11:17 +0000)]
[clangd] Deduplicate query scopes.

Summary:
For example, when anonymous namespace is present, duplicated namespaces might be
generated for the enclosing namespace.

Reviewers: ilya-biryukov

Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits

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

llvm-svn: 346224

6 years ago[clangd] Get rid of QueryScopes.empty() == AnyScope special case.
Eric Liu [Tue, 6 Nov 2018 11:08:17 +0000 (11:08 +0000)]
[clangd] Get rid of QueryScopes.empty() == AnyScope special case.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits

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

llvm-svn: 346223

6 years agoPrioritize the constructor call of __local_xray_dyninit()
Kamil Rytarowski [Tue, 6 Nov 2018 10:59:21 +0000 (10:59 +0000)]
Prioritize the constructor call of __local_xray_dyninit()

Summary:
For platforms without preinit support (such as NetBSD/amd64) the
initialization routine __xray_init() was called in non-deterministic order
compared to other constructors. This caused breakage failures
as xray routines attempted to execute code with assumption of
being initialized, which was no always true.

Use GCC/Clang extension to set maximal priority to the constructor
calling __xray_init(). This code switches away from C++ lambda form,
as it did not allow to specify this compiler extension.

Reviewers: dberris, joerg

Reviewed By: dberris

Subscribers: llvm-commits, mgorny, #sanitizers

Tags: #sanitizers

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

llvm-svn: 346222

6 years ago[clangd] auto-index stores symbols per-file instead of per-TU.
Eric Liu [Tue, 6 Nov 2018 10:55:21 +0000 (10:55 +0000)]
[clangd] auto-index stores symbols per-file instead of per-TU.

Summary:
This allows us to deduplicate header symbols across TUs. File digests
are collects when collecting symbols/refs. And the index store deduplicates
file symbols based on the file digest.

Reviewers: sammccall, hokein

Reviewed By: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits

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

llvm-svn: 346221

6 years agoAdd parens to silence warning
Benjamin Kramer [Tue, 6 Nov 2018 10:13:37 +0000 (10:13 +0000)]
Add parens to silence warning

MSVCUndecoratedNameParser.cpp:25:36: warning: '&&' within '||' [-Wlogical-op-parentheses]

llvm-svn: 346220

6 years ago[clang-tidy] run() doesn't update the SourceManager.
Sam McCall [Tue, 6 Nov 2018 09:28:23 +0000 (09:28 +0000)]
[clang-tidy] run() doesn't update the SourceManager.

Summary:
By now the context's SourceManager is now initialized everywhere that
ClangTidyCheck::registerMatcher() is called, so the call from run() seems
entirely redundant, and indeed all the tests pass.

This solves a problem with embedding clang-tidy: if using a DiagnosticsEngine
which already has file state, re-setting its SourceManager (to the same value)
causes an assertion.
(There are other ways to solve this problem, but this is the simplest).

Reviewers: hokein, alexfh

Subscribers: xazax.hun, cfe-commits

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

llvm-svn: 346219

6 years ago[Support] Fix `warning: unknown pragma ignored` for mingw target
Martin Storsjo [Tue, 6 Nov 2018 09:08:20 +0000 (09:08 +0000)]
[Support] Fix `warning: unknown pragma ignored` for mingw target

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

llvm-svn: 346218

6 years ago[NFC] Turn collectTransitivePredecessors into a static function
Max Kazantsev [Tue, 6 Nov 2018 09:07:03 +0000 (09:07 +0000)]
[NFC] Turn collectTransitivePredecessors into a static function

llvm-svn: 346217

6 years agoT was unused on assertion disabled builds.
Kadir Cetinkaya [Tue, 6 Nov 2018 08:59:25 +0000 (08:59 +0000)]
T was unused on assertion disabled builds.

llvm-svn: 346216

6 years ago[sanitizer] Use AT_EXECFN in ReExec() if available
Benjamin Kramer [Tue, 6 Nov 2018 08:53:38 +0000 (08:53 +0000)]
[sanitizer] Use AT_EXECFN in ReExec() if available

execve("/proc/self/exe") will not work if the binary relies on
$EXEC_ORIGIN in an rpath. Query AT_EXECFN instead, which will give the
same string that the current binary was exec'd with.

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

llvm-svn: 346215

6 years ago[XRay] Update XRayRecord to support Custom/Typed Events
Dean Michael Berris [Tue, 6 Nov 2018 08:51:37 +0000 (08:51 +0000)]
[XRay] Update XRayRecord to support Custom/Typed Events

Summary:
This change cuts across LLVM and compiler-rt to add support for
rendering custom events in the XRayRecord type, to allow for including
user-provided annotations in the output YAML (as raw bytes).

This work enables us to add custom event and typed event records into
the `llvm::xray::Trace` type for user-provided events. This can then be
programmatically handled through the C++ API and can be included in some
of the tooling as well. For now we support printing the raw data we
encounter in the custom events in the converted output.

Future work will allow us to start interpreting these custom and typed
events through a yet-to-be-defined API for extending the trace analysis
library.

Reviewers: mboerger

Subscribers: hiraditya, llvm-commits

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

llvm-svn: 346214

6 years ago[PDB] Introduce `MSVCUndecoratedNameParser`
Aleksandr Urakov [Tue, 6 Nov 2018 08:02:55 +0000 (08:02 +0000)]
[PDB] Introduce `MSVCUndecoratedNameParser`

This patch introduces the simple MSVCUndecoratedNameParser. It is needed for
parsing names of PDB symbols corresponding to template instantiations. For
example, for the name `operator<<A>'::`2'::B::operator> we can't just split the
name with :: (as it is implemented for now) to retrieve its scopes. This parser
processes such names in a more correct way.

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

llvm-svn: 346213

6 years agoCast to uint64_t instead of to unsigned.
Akira Hatanaka [Tue, 6 Nov 2018 07:12:28 +0000 (07:12 +0000)]
Cast to uint64_t instead of to unsigned.

This is a follow-up to r346211.

llvm-svn: 346212

6 years agoos_log: Allow specifying mask type in format string.
Akira Hatanaka [Tue, 6 Nov 2018 07:05:14 +0000 (07:05 +0000)]
os_log: Allow specifying mask type in format string.

A mask type is a 1 to 8-byte string that follows the "mask." annotation
in the format string. This enables obfuscating data in the event the
provided privacy level isn't enabled.

rdar://problem/36756282

llvm-svn: 346211

6 years agoos_log: Add a new privacy annotation "sensitive".
Akira Hatanaka [Tue, 6 Nov 2018 06:26:17 +0000 (06:26 +0000)]
os_log: Add a new privacy annotation "sensitive".

This is a stricter privacy annotation than "private", which will be used
for data that shouldn’t be logged to disk. For backward compatibility,
the "private" bit is set too.

rdar://problem/36755912

llvm-svn: 346210

6 years agoos_log: Minor code cleanups. NFC.
Akira Hatanaka [Tue, 6 Nov 2018 05:41:33 +0000 (05:41 +0000)]
os_log: Minor code cleanups. NFC.

Also, add a new test case and fix an incorrect comment.

llvm-svn: 346209

6 years ago[COFF, ARM64] Implement InterlockedDecrement*_* builtins
Mandeep Singh Grang [Tue, 6 Nov 2018 05:07:43 +0000 (05:07 +0000)]
[COFF, ARM64] Implement InterlockedDecrement*_* builtins

This is eight in a series of patches to move intrinsic definitions out of intrin.h.

Differential: https://reviews.llvm.org/D54068
llvm-svn: 346208

6 years ago[COFF, ARM64] Implement InterlockedIncrement*_* builtins
Mandeep Singh Grang [Tue, 6 Nov 2018 05:05:32 +0000 (05:05 +0000)]
[COFF, ARM64] Implement InterlockedIncrement*_* builtins

This is seventh in a series of patches to move intrinsic definitions out of intrin.h.

Differential: https://reviews.llvm.org/D54067
llvm-svn: 346207

6 years ago[COFF, ARM64] Implement InterlockedAnd*_* builtins
Mandeep Singh Grang [Tue, 6 Nov 2018 05:03:13 +0000 (05:03 +0000)]
[COFF, ARM64] Implement InterlockedAnd*_* builtins

This is sixth in a series of patches to move intrinsic definitions out of intrin.h.

Differential: https://reviews.llvm.org/D54066
llvm-svn: 346206

6 years ago[COFF, ARM64] Implement InterlockedXor*_* builtins
Mandeep Singh Grang [Tue, 6 Nov 2018 04:55:20 +0000 (04:55 +0000)]
[COFF, ARM64] Implement InterlockedXor*_* builtins

This is fifth in a series of patches to move intrinsic definitions out of intrin.h.

Note: This was reviewed and approved in D54065 but somehow that diff was messed
up. Committing this again with the proper diff.

llvm-svn: 346205

6 years ago[LICM] Remove too conservative IsMustExecute variable
Max Kazantsev [Tue, 6 Nov 2018 04:17:40 +0000 (04:17 +0000)]
[LICM] Remove too conservative IsMustExecute variable

LICM relies on variable `MustExecute` which is conservatively set to `false`
in all non-headers. It is used when we decide whether or not we want to hoist
an instruction or a guard.

For the guards, it might be too conservative to use this variable, we can
instead use a more precise logic from LoopSafetyInfo. Currently it is only NFC
because `IsMemoryNotModified` is also conservatively set to `false` for all
non-headers, and we cannot hoist guards from non-header blocks. However once we
give up using `IsMemoryNotModified` and use a smarter check instead, this will
allow us to hoist guards from all mustexecute non-header blocks.

Differential Revision: https://reviews.llvm.org/D50888
Reveiwed By: fedor.sergeev

llvm-svn: 346204

6 years agoAArch64: Cleanup CCMP code; NFC
Matthias Braun [Tue, 6 Nov 2018 03:15:22 +0000 (03:15 +0000)]
AArch64: Cleanup CCMP code; NFC

Cleanup CCMP pattern matching code in preparation for review/bugfix:
- Rename `isConjunctionDisjunctionTree()` to `canEmitConjunction()`
  (it won't accept arbitrary disjunctions and is really about whether we
   can transform the subtree into a conjunction that we can emit).
- Rename `emitConjunctionDisjunctionTree()` to `emitConjunction()`

llvm-svn: 346203

6 years agoIt's a test commit, which is my first commit and also add my name to CREDITS.TXT
Zi Xuan Wu [Tue, 6 Nov 2018 03:07:03 +0000 (03:07 +0000)]
It's a test commit, which is my first commit and also add my name to CREDITS.TXT

llvm-svn: 346202

6 years ago[LICM] Use ICFLoopSafetyInfo in LICM
Max Kazantsev [Tue, 6 Nov 2018 02:44:49 +0000 (02:44 +0000)]
[LICM] Use ICFLoopSafetyInfo in LICM

This patch makes LICM use `ICFLoopSafetyInfo` that is a smarter version
of LoopSafetyInfo that leverages power of Implicit Control Flow Tracking
to keep track of throwing instructions and give less pessimistic answers
to queries related to throws.

The ICFLoopSafetyInfo itself has been introduced in rL344601. This patch
enables it in LICM only.

Differential Revision: https://reviews.llvm.org/D50377
Reviewed By: apilipenko

llvm-svn: 346201

6 years ago[CodeGenCXX] XFAIL test for ASAN on Darwin.
Volodymyr Sapsai [Tue, 6 Nov 2018 02:16:28 +0000 (02:16 +0000)]
[CodeGenCXX] XFAIL test for ASAN on Darwin.

The test hits stack overflow trying to instantiate recursive templates.
It is observed with ASAN and not with a regular build because ASAN
increases stack frame size.

rdar://problem/45009892

Reviewers: george.karpenkov, lebedev.ri

Reviewed By: george.karpenkov

Subscribers: dexonsmith, rjmccall, cfe-commits

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

llvm-svn: 346200

6 years ago[NFC] Add motivating test case for revert in rL346198
Max Kazantsev [Tue, 6 Nov 2018 02:12:44 +0000 (02:12 +0000)]
[NFC] Add motivating test case for revert in rL346198

llvm-svn: 346199

6 years agoRevert "[IndVars] Smart hard uses detection"
Max Kazantsev [Tue, 6 Nov 2018 02:02:05 +0000 (02:02 +0000)]
Revert "[IndVars] Smart hard uses detection"

This reverts commit 2f425e9c7946b9d74e64ebbfa33c1caa36914402.

It seems that the check that we still should do the transform if we
know the result is constant is missing in this code. So the logic that
has been deleted by this change is still sometimes accidentally useful.
I revert the change to see what can be done about it. The motivating
case is the following:

@Y = global [400 x i16] zeroinitializer, align 1

define i16 @foo() {
entry:
  br label %for.body

for.body:                                         ; preds = %entry, %for.body
  %i = phi i16 [ 0, %entry ], [ %inc, %for.body ]

  %arrayidx = getelementptr inbounds [400 x i16], [400 x i16]* @Y, i16 0, i16 %i
  store i16 0, i16* %arrayidx, align 1
  %inc = add nuw nsw i16 %i, 1
  %cmp = icmp ult i16 %inc, 400
  br i1 %cmp, label %for.body, label %for.end

for.end:                                          ; preds = %for.body
  %inc.lcssa = phi i16 [ %inc, %for.body ]
  ret i16 %inc.lcssa
}

We should be able to figure out that the result is constant, but the patch
breaks it.

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

llvm-svn: 346198

6 years ago[LLVM-C] Fix Windows Build of Core
Robert Widmann [Tue, 6 Nov 2018 01:54:12 +0000 (01:54 +0000)]
[LLVM-C] Fix Windows Build of Core

strndup doesn't exist outside of GNU-land and modern macOSes.  Use
strdup instead as c_str() is guaranteed to be NUL-terminated.

llvm-svn: 346197

6 years agoDisable XRay test fork_basic_logging for NetBSD
Kamil Rytarowski [Tue, 6 Nov 2018 01:53:54 +0000 (01:53 +0000)]
Disable XRay test fork_basic_logging for NetBSD

This code has not been ported so far.

llvm-svn: 346196

6 years ago[LLVM-C] Improve Intrinsics Bindings
Robert Widmann [Tue, 6 Nov 2018 01:38:14 +0000 (01:38 +0000)]
[LLVM-C] Improve Intrinsics Bindings

Summary:
Improve the intrinsic bindings with operations for

- Retrieving and automatically inserting the declaration of an intrinsic by ID
- Retrieving the name of a non-overloaded intrinsic by ID
- Retrieving the name of an overloaded intrinsic by ID and overloaded parameter types

Improve the echo test to copy non-overloaded intrinsics by ID.

Reviewers: whitequark, deadalnix

Reviewed By: whitequark

Subscribers: llvm-commits

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

llvm-svn: 346195

6 years agoFollow Windows' approach for NetBSD in AlarmCallback()
Kamil Rytarowski [Tue, 6 Nov 2018 01:28:01 +0000 (01:28 +0000)]
Follow Windows' approach for NetBSD in AlarmCallback()

NetBSD's current behavior needs to ignore check for
InFuzzingThread() in Fuzzer::AlarmCallback().

llvm-svn: 346194

6 years ago[libFuzzer] Disable value-profile-cmp.test and fuzzer-oom.test on ARM64
George Karpenkov [Tue, 6 Nov 2018 01:15:51 +0000 (01:15 +0000)]
[libFuzzer] Disable value-profile-cmp.test and fuzzer-oom.test on ARM64

value-profile-cmp was always flaky, and OOM fails to work in some environments.
counters.test fails when vectorization is enabled, and it is more likely
to kick in when compiling for ARM.

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

llvm-svn: 346193

6 years agoRevert "[COFF, ARM64] Implement InterlockedXor*_* builtins"
Mandeep Singh Grang [Tue, 6 Nov 2018 01:14:24 +0000 (01:14 +0000)]
Revert "[COFF, ARM64] Implement InterlockedXor*_* builtins"

This reverts commit cc3d3cd0fbeb88412d332354c261ff139c4ede6b.

llvm-svn: 346192

6 years ago[COFF, ARM64] Implement InterlockedXor*_* builtins
Mandeep Singh Grang [Tue, 6 Nov 2018 01:12:29 +0000 (01:12 +0000)]
[COFF, ARM64] Implement InterlockedXor*_* builtins

Summary: This is fifth in a series of patches to move intrinsic definitions out of intrin.h.

Reviewers: rnk, efriedma, mstorsjo, TomTan

Reviewed By: efriedma

Subscribers: javed.absar, kristof.beyls, chrib, jfb, kristina, cfe-commits

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

llvm-svn: 346191

6 years ago[COFF, ARM64] Implement InterlockedOr*_* builtins
Mandeep Singh Grang [Tue, 6 Nov 2018 01:11:25 +0000 (01:11 +0000)]
[COFF, ARM64] Implement InterlockedOr*_* builtins

This is fourth in a series of patches to move intrinsic definitions out of intrin.h.

llvm-svn: 346190

6 years ago[COFF, ARM64] Implement InterlockedCompareExchange*_* builtins
Mandeep Singh Grang [Tue, 6 Nov 2018 00:36:48 +0000 (00:36 +0000)]
[COFF, ARM64] Implement InterlockedCompareExchange*_* builtins

Summary: This is third in a series of patches to move intrinsic definitions out of intrin.h.

Reviewers: rnk, efriedma, mstorsjo, TomTan

Reviewed By: efriedma

Subscribers: javed.absar, kristof.beyls, chrib, jfb, kristina, cfe-commits

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

llvm-svn: 346189

6 years ago[X86] Autogenerate complete checks. NFC
Craig Topper [Tue, 6 Nov 2018 00:31:27 +0000 (00:31 +0000)]
[X86] Autogenerate complete checks. NFC

llvm-svn: 346188

6 years agoRevert "[WebAssembly] Fixup `main` signature by default"
Sam Clegg [Tue, 6 Nov 2018 00:31:02 +0000 (00:31 +0000)]
Revert "[WebAssembly] Fixup `main` signature by default"

This reverts rL345880.  It caused some test failures on the
webassembly waterfall.  e.g. binaryen2.test_mainenv fails due
the fact that `envp` ends up being undef rather than 0.

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

llvm-svn: 346187

6 years ago[TestVLA] Fix a python decorator.
Davide Italiano [Tue, 6 Nov 2018 00:18:17 +0000 (00:18 +0000)]
[TestVLA] Fix a python decorator.

llvm-svn: 346186

6 years agoSpecify REQUIRES: default_triple in two debuginfo tests
Justin Bogner [Tue, 6 Nov 2018 00:16:32 +0000 (00:16 +0000)]
Specify REQUIRES: default_triple in two debuginfo tests

These were failing when specifying LLVM_DEFAULT_TARGET_TRIPLE=''

llvm-svn: 346185

6 years agoTargetMachine: Move lib/CodeGen specific callbacks to LLVMTargetMachine; NFC
Matthias Braun [Mon, 5 Nov 2018 23:49:15 +0000 (23:49 +0000)]
TargetMachine: Move lib/CodeGen specific callbacks to LLVMTargetMachine; NFC

llvm-svn: 346184

6 years agoMachineFunction: Store more specific reference to LLVMTargetMachine; NFC
Matthias Braun [Mon, 5 Nov 2018 23:49:14 +0000 (23:49 +0000)]
MachineFunction: Store more specific reference to LLVMTargetMachine; NFC

MachineFunction can only be used in code using lib/CodeGen, hence we
can keep a more specific reference to LLVMTargetMachine rather than just
TargetMachine around.

Do the same for references in ScheduleDAG and RegUsageInfoCollector.

llvm-svn: 346183

6 years agoMachineModuleInfo: Store more specific reference to LLVMTargetMachine; NFC
Matthias Braun [Mon, 5 Nov 2018 23:49:13 +0000 (23:49 +0000)]
MachineModuleInfo: Store more specific reference to LLVMTargetMachine; NFC

MachineModuleInfo can only be used in code using lib/CodeGen, hence we
can keep a more specific reference to LLVMTargetMachine rather than just
TargetMachine around.

llvm-svn: 346182

6 years ago[DWARF] Support types CU list in .gdb_index dumping
Fangrui Song [Mon, 5 Nov 2018 23:27:53 +0000 (23:27 +0000)]
[DWARF] Support types CU list in .gdb_index dumping

Some executables have non-empty types CU list and -gdb-index would report "<error reporting>" before.

llvm-svn: 346181

6 years ago[TargetLowering] Change TargetLoweringBase::getPreferredVectorAction to take an MVT...
Craig Topper [Mon, 5 Nov 2018 23:26:13 +0000 (23:26 +0000)]
[TargetLowering] Change TargetLoweringBase::getPreferredVectorAction to take an MVT instead of an EVT. NFC

The main caller of this already has an MVT and several targets called getSimpleVT inside without checking isSimple. This makes the simpleness explicit.

llvm-svn: 346180

6 years agoAdjust the comment section of CreateSource to account for lines longer than 60
Nathan Lanza [Mon, 5 Nov 2018 22:55:30 +0000 (22:55 +0000)]
Adjust the comment section of CreateSource to account for lines longer than 60

Summary:
On rare occasions, the address, instruction and arguments of a line of
assembly in the CreateSource printout would reach > 60 characters. The
function would integer overflow and try to indent a line by `0xfff...`.

Change the calculated offset to be the maximum of 60 or
`line_strm.str().size()`

Reviewers: clayborg, xiaobai

Reviewed By: clayborg

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

llvm-svn: 346179

6 years agoAMDGPU: Add sram-ecc feature options
Konstantin Zhuravlyov [Mon, 5 Nov 2018 22:44:59 +0000 (22:44 +0000)]
AMDGPU: Add sram-ecc feature options

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

llvm-svn: 346178

6 years agoAMDGPU: Add sram-ecc feature
Konstantin Zhuravlyov [Mon, 5 Nov 2018 22:44:19 +0000 (22:44 +0000)]
AMDGPU: Add sram-ecc feature

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

llvm-svn: 346177

6 years ago[clang-tidy] fix example code-blocks indendation
Jonas Toth [Mon, 5 Nov 2018 22:30:17 +0000 (22:30 +0000)]
[clang-tidy] fix example code-blocks indendation

llvm-svn: 346176

6 years agoRevert "[GlobalISel] Refactor the artifact combiner a bit by using MIPatternMatch"
Volkan Keles [Mon, 5 Nov 2018 22:25:01 +0000 (22:25 +0000)]
Revert "[GlobalISel] Refactor the artifact combiner a bit by using MIPatternMatch"

This reverts r346166 as it breaks
test-suite-verify-machineinstrs-aarch64-globalisel-O0-g.

llvm-svn: 346175

6 years agoSet stdout/stdin to binary mode on Windows
Nathan Lanza [Mon, 5 Nov 2018 22:25:00 +0000 (22:25 +0000)]
Set stdout/stdin to binary mode on Windows

Summary:
A file opened in text mode on Windows will have `\n` automatically changed to `13,10` while Darwin and Linux leave it as `10`.

Set the file to binary mode to avoid this automatic conversion so that Darwin, Linux and Windows have equivalent treatment of `\r`.

Reviewers: clayborg, xiaobai

Reviewed By: clayborg

Subscribers: emaste, ki.stfu, mgorny, eraman, JDevlieghere, mgrang

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

llvm-svn: 346174

6 years ago[clang-tidy] doc removew hitespace in front of code-block-line
Jonas Toth [Mon, 5 Nov 2018 22:21:27 +0000 (22:21 +0000)]
[clang-tidy] doc removew hitespace in front of code-block-line

llvm-svn: 346173

6 years agoSkip this test on older versions of clang.
Adrian Prantl [Mon, 5 Nov 2018 22:19:22 +0000 (22:19 +0000)]
Skip this test on older versions of clang.

llvm-svn: 346172

6 years agoAdd a relocation to ObjectFileELF::ApplyRelocations and a test
Nathan Lanza [Mon, 5 Nov 2018 22:18:00 +0000 (22:18 +0000)]
Add a relocation to ObjectFileELF::ApplyRelocations and a test

Summary:
pcm files can end up being processed by lldb with relocations to be
made for the .debug_info section. When a R_AARCH64_ABS64 relocation
was required lldb would hit an `assert(false)` and die.

Add R_AARCH64_ABS64 relocations to the S+A 64 bit width code path. Add
a test for R_AARCH64_ABS64 and R_AARCH64_ABS32 .rela.debug_info
relocations in a pcm file.

Reviewers: sas, xiaobai, davide, javed.absar, espindola

Reviewed By: davide

Subscribers: labath, zturner, emaste, mgorny, arichardson, kristof.beyls

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

llvm-svn: 346171

6 years ago[X86] Don't turn any_extend from a mask register into a sign_extend during lowering...
Craig Topper [Mon, 5 Nov 2018 22:08:17 +0000 (22:08 +0000)]
[X86] Don't turn any_extend from a mask register into a sign_extend during lowering. Add patterns to match any_extend during isel instead.

SimplifyDemandedBits can turn a sign_extend back into an any_extend and trigger an infinite loop. So instead legalize it the same way as a sign_extend, but preserve the opcode. Then just pattern match it the same as sign_extend during isel.

I don't have a reduced test case for such an infinite loop yet.

llvm-svn: 346170

6 years ago[InstSimplify] fold select (fcmp X, Y), X, Y
Sanjay Patel [Mon, 5 Nov 2018 21:51:39 +0000 (21:51 +0000)]
[InstSimplify] fold select (fcmp X, Y), X, Y

This is NFCI for InstCombine because it calls InstSimplify,
so I left the tests for this transform there. As noted in
the code comment, we can allow this fold more often by using
FMF and/or value tracking.

llvm-svn: 346169

6 years ago[InstSimplify] add tests for select+fcmp; NFC
Sanjay Patel [Mon, 5 Nov 2018 21:42:01 +0000 (21:42 +0000)]
[InstSimplify] add tests for select+fcmp; NFC

These are translated from InstCombine's test file with the same name.
We should move the transform from InstCombine to InstSimplify.

llvm-svn: 346168

6 years ago[Driver] Reland again again: Default Android toolchains to libc++.
Dan Albert [Mon, 5 Nov 2018 20:57:46 +0000 (20:57 +0000)]
[Driver] Reland again again: Default Android toolchains to libc++.

Landed more fixes to the compiler-rt Android tests.

Original review was https://reviews.llvm.org/D53109.

llvm-svn: 346167

6 years ago[GlobalISel] Refactor the artifact combiner a bit by using MIPatternMatch
Volkan Keles [Mon, 5 Nov 2018 20:51:13 +0000 (20:51 +0000)]
[GlobalISel] Refactor the artifact combiner a bit by using MIPatternMatch

Reviewers: aditya_nandakumar

Reviewed By: aditya_nandakumar

Subscribers: rovka, kristof.beyls, llvm-commits

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

llvm-svn: 346166

6 years agoFix (and improve) the support for C99 variable length array types
Adrian Prantl [Mon, 5 Nov 2018 20:49:07 +0000 (20:49 +0000)]
Fix (and improve) the support for C99 variable length array types

Clang recently improved its DWARF support for C VLA types. The DWARF
now looks like this:

0x00000051:         DW_TAG_variable [4]
                     DW_AT_location( fbreg -32 )
                     DW_AT_name( "__vla_expr" )
                     DW_AT_type( {0x000000d3} ( long unsigned int ) )
                     DW_AT_artificial( true )
...
0x000000da:     DW_TAG_array_type [10] *
                 DW_AT_type( {0x000000cc} ( int ) )

0x000000df:         DW_TAG_subrange_type [11]
                     DW_AT_type( {0x000000e9} ( __ARRAY_SIZE_TYPE__ ) )
                     DW_AT_count( {0x00000051} )

Without this patch LLDB will naively interpret the DIE offset 0x51 as
the static size of the array, which is clearly wrong.  This patch
extends ValueObject::GetNumChildren to query the dynamic properties of
incomplete array types.

See the testcase for an example:

   4   int foo(int a) {
   5         int vla[a];
   6           for (int i = 0; i < a; ++i)
   7               vla[i] = i;
   8
-> 9            pause(); // break here
   10   return vla[a-1];
   11   }

(lldb) fr v vla
(int []) vla = ([0] = 0, [1] = 1, [2] = 2, [3] = 3)
(lldb) quit

rdar://problem/21814005

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

llvm-svn: 346165

6 years ago[lld][NFC] Update tests to use -S instead of -s when using llvm-readelf.
Jordan Rupprecht [Mon, 5 Nov 2018 20:39:06 +0000 (20:39 +0000)]
[lld][NFC] Update tests to use -S instead of -s when using llvm-readelf.

Summary: llvm-readobj/readelf accepts both -s and -S as aliases for --sections. However with GNU readelf only -S means --section, and -s means --symbols. I would like to make llvm-readelf more compatible.

Reviewers: MaskRay, espindola

Reviewed By: MaskRay

Subscribers: emaste, arichardson, steven_wu, dexonsmith, llvm-commits

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

llvm-svn: 346164

6 years agoDisable precomp test on Linux until I fix it.
Alexandre Ganea [Mon, 5 Nov 2018 20:39:02 +0000 (20:39 +0000)]
Disable precomp test on Linux until I fix it.

llvm-svn: 346163

6 years agoFix the Xcode project for the removal of the Go, Java & OCaml
Jim Ingham [Mon, 5 Nov 2018 20:15:27 +0000 (20:15 +0000)]
Fix the Xcode project for the removal of the Go, Java & OCaml
plugins.

llvm-svn: 346162

6 years ago[X86] Regenerate test checks in preparation for a patch. NFC
Craig Topper [Mon, 5 Nov 2018 19:45:37 +0000 (19:45 +0000)]
[X86] Regenerate test checks in preparation for a patch. NFC

I'm preparing a patch to avoid creating critical edges in cmov expansion. Updating these tests to make the changes by the next patch easier to see.

llvm-svn: 346161

6 years agoFix build breakerage on GCC 5.4:
Alexandre Ganea [Mon, 5 Nov 2018 19:43:34 +0000 (19:43 +0000)]
Fix build breakerage on GCC 5.4:

/home/buildslave/slave_as-bldslv8/lld-perf-testsuite/llvm/tools/lld/COFF/PDB.cpp:365:51: error: 'auto' not allowed in lambda parameter
  auto DbgIt = find_if(File->getDebugChunks(), [](auto &C) {
                                                  ^~~~

http://lab.llvm.org:8011/builders/lld-perf-testsuite/builds/8717/steps/build-bin%2Flld/logs/stdio

llvm-svn: 346160

6 years agoRemove OCaml debugger plugin
Jonas Devlieghere [Mon, 5 Nov 2018 19:34:03 +0000 (19:34 +0000)]
Remove OCaml debugger plugin

In January Davide sent an e-mail to the mailing list to suggest removing
unmaintained language plugins such as Go and Java. The plan was to have
some cool down period to allow users to speak up, however after that the
plugins were never actually removed.

This patch removes the OCaml debugger plugin.

The plugin can be added again in the future if it is mature enough both
in terms of testing and maintenance commitment.

Discussion on the mailing list:
http://lists.llvm.org/pipermail/lldb-dev/2018-January/013171.html

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

llvm-svn: 346159

6 years agoRemove Java debugger plugin
Jonas Devlieghere [Mon, 5 Nov 2018 19:34:02 +0000 (19:34 +0000)]
Remove Java debugger plugin

In January Davide sent an e-mail to the mailing list to suggest removing
unmaintained language plugins such as Go and Java. The plan was to have
some cool down period to allow users to speak up, however after that the
plugins were never actually removed.

This patch removes the Java debugger plugin.

The plugin can be added again in the future if it is mature enough both
in terms of testing and maintenance commitment.

Discussion on the mailing list:
http://lists.llvm.org/pipermail/lldb-dev/2018-January/013171.html

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

llvm-svn: 346158

6 years agoRemove Go debugger plugin
Jonas Devlieghere [Mon, 5 Nov 2018 19:33:59 +0000 (19:33 +0000)]
Remove Go debugger plugin

In January Davide sent an e-mail to the mailing list to suggest removing
unmaintained language plugins such as Go and Java. The plan was to have
some cool down period to allow users to speak up, however after that the
plugins were never actually removed.

This patch removes the Go debugger plugin.

The plugin can be added again in the future if it is mature enough both
in terms of testing and maintenance commitment.

Discussion on the mailing list:
http://lists.llvm.org/pipermail/lldb-dev/2018-January/013171.html

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

llvm-svn: 346157

6 years agoProperly cast from DeclContext to Decl.
Zachary Turner [Mon, 5 Nov 2018 19:25:39 +0000 (19:25 +0000)]
Properly cast from DeclContext to Decl.

Apparently there's a special procedure for doing this.  Not
following this silently breaks builds.

llvm-svn: 346156

6 years ago[Sanitizers] Disable SANITIZER_CAN_FAST_UNWIND on all SPARC targets
Rainer Orth [Mon, 5 Nov 2018 19:22:54 +0000 (19:22 +0000)]
[Sanitizers] Disable SANITIZER_CAN_FAST_UNWIND on all SPARC targets

While testing my to-be-submitted Solaris sanitizer support on gcc mainline, I ran into
an issue on Solaris/SPARC (sparc-sun-solaris2.11). Initially libasan.so failed to link:

  Undefined                       first referenced
   symbol                             in file
  __sanitizer::BufferedStackTrace::FastUnwindStack(unsigned long, unsigned long, unsigned long, unsigned long, unsigned int) /var/gcc/gcc-9.0.0-20181024/11.5-gcc-gas/sparc-sun-solaris2.11/./libsanitizer/asan/.libs/libasan.so

This happens because SANITIZER_CAN_FAST_UNWIND is enabled on non-Linux
SPARC targets (cf. sanitizer_stacktrace.h), but the guard around the SPARCv8-only
definition in sanitizer_stacktrace_sparc.cc only works with clang:

clang predefines __sparcv8__ on non-Solaris, and __sparcv8 only on Solaris
gcc predefines __sparcv8 on Solaris, but __sparc_v8__ on non-Solaris

The attached patch allows for all three variants.

However, disabling SANITIZER_CAN_FAST_UNWIND on all SPARC targets
fixes a couple of testsuite failures in the Solaris asan testsuite, so for now it's better
to keep it disabled everywhere.

This allowed the libsanitizer build to complete and gave reasonable (though slightly
worse than on Solaris/x86) testsuite results.

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

llvm-svn: 346155

6 years ago[COFF][LLD] Add link support for Microsoft precompiled headers OBJs
Alexandre Ganea [Mon, 5 Nov 2018 19:20:47 +0000 (19:20 +0000)]
[COFF][LLD] Add link support for Microsoft precompiled headers OBJs

This change allows for link-time merging of debugging information from
Microsoft precompiled types OBJs compiled with cl.exe /Z7 /Yc and /Yu.

This fixes llvm.org/PR34278

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

llvm-svn: 346154

6 years ago[Sanitizers] Solaris largefile fixes
Rainer Orth [Mon, 5 Nov 2018 19:19:15 +0000 (19:19 +0000)]
[Sanitizers] Solaris largefile fixes

While testing the Solaris libsanitizer port on GCC mainline, I found that
I'd messed up
the largefile checks in various ways, some of which showed as compile failures
(wrong structure sizes and member offsets), others at runtime, some of those only
on sparc as a big-endian target.

This patch fixes all of them:

- OFF_T is now correctly defined for 32-bit largefile and traditional
  environments, and 64-bit.

- The definition of __sanitizer_dirent now checks the correct conditionals.

- sanitizer_procmaps_solaris.cc undefines _FILE_OFFSET_BITS: before
  Solaris 11.4 <procfs.h> doesn't even compile with largefile support
  enabled, but the use at hand doesn't need it anyway while g++ 9 will
  define _FILE_OFFSET_BITS=64 out of the box.

- With full largefile support enabled, one needs to use e.g. mmap64
  instead of mmap; this is hidden behind macros.

With this patch I could bootstrap gcc mainline on both sparc-sun-solaris2.11 and
i386-pc-solaris2.11.  In addition, I've successfully built llvm on
i386-pc-solaris2.11.

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

llvm-svn: 346153

6 years agoOnly call FlushFileBuffers() when writing executables on Windows
Alexandre Ganea [Mon, 5 Nov 2018 19:14:10 +0000 (19:14 +0000)]
Only call FlushFileBuffers() when writing executables on Windows

This is a follow-up for "r325274: Call FlushFileBuffers on output files."

Previously, FlushFileBuffers() was called in all cases when writing a file. The objective was to go around a bug in the Windows kernel (as described here: https://randomascii.wordpress.com/2018/02/25/compiler-bug-linker-bug-windows-kernel-bug/). However that is required only when writing EXEs, any other file type doesn't need flushing.

This patch calls FlushFileBuffers() only for EXEs. In addition, we completly disable FlushFileBuffers() for known Windows 10 versions that do not exhibit the original kernel bug.

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

llvm-svn: 346152

6 years ago[MergeICmps] Do not perform the transformation if GEP is used outside of block
Taewook Oh [Mon, 5 Nov 2018 18:16:32 +0000 (18:16 +0000)]
[MergeICmps] Do not perform the transformation if GEP is used outside of block

Summary:
This patch prevents MergeICmps to performn the transformation if the address operand GEP of the load instruction has a use outside of the load's parent block. Without this patch, compiler crashes with the given test case because the use of `%first.i` is still around when the basic block is erased from https://github.com/llvm-mirror/llvm/blob/master/lib/Transforms/Scalar/MergeICmps.cpp#L620. I think checking `isUsedOutsideOfBlock` with `GEP` is the original intention of the code, as the checking for `LoadI` is already performed in the same function.

This patch is incomplete though, as this makes the pass overly conservative and fails the test `tuple-four-int8.ll`. I believe what needs to be done is checking if GEP has a use outside of block that is not the part of "Comparisons" chain. Submit the patch as of now to prevent compiler crash.

Reviewers: courbet, trentxintong

Reviewed By: courbet

Subscribers: llvm-commits

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

llvm-svn: 346151

6 years ago[InstCombine] add/adjust tests for fcmp+select substitution; NFC
Sanjay Patel [Mon, 5 Nov 2018 18:09:10 +0000 (18:09 +0000)]
[InstCombine] add/adjust tests for fcmp+select substitution; NFC

There was no coverage for at least 2 out of the 4 patterns because
of fcmp canonicalization. The tests and code should be moved to
InstSimplify in a follow-up because this doesn't create any new values.

llvm-svn: 346150

6 years agoAdd a target modules dump ast command.
Zachary Turner [Mon, 5 Nov 2018 17:40:28 +0000 (17:40 +0000)]
Add a target modules dump ast command.

This is useful for investigating the clang ast as you reconstruct
it via by parsing debug info.  It can also be used to write tests
against.

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

llvm-svn: 346149

6 years ago[Power9] Add support for stxvw4x.be and stxvd2x.be intrinsics
Zaara Syeda [Mon, 5 Nov 2018 17:31:26 +0000 (17:31 +0000)]
[Power9] Add support for stxvw4x.be and stxvd2x.be intrinsics

On Power9, we don't have patterns to select the following intrinsics:
llvm.ppc.vsx.stxvw4x.be
llvm.ppc.vsx.stxvd2x.be

This patch adds support for these.

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

llvm-svn: 346148

6 years ago[InstCombine] canonicalize -0.0 to +0.0 in fcmp
Sanjay Patel [Mon, 5 Nov 2018 17:26:42 +0000 (17:26 +0000)]
[InstCombine] canonicalize -0.0 to +0.0 in fcmp

As stated in IEEE-754 and discussed in:
https://bugs.llvm.org/show_bug.cgi?id=38086
...the sign of zero does not affect any FP compare predicate.

Known regressions were fixed with:
rL346097 (D54001)
rL346143

The transform will help reduce pattern-matching complexity to solve:
https://bugs.llvm.org/show_bug.cgi?id=39475
...as well as improve CSE and codegen (a zero constant is almost always
easier to produce than 0x80..00).

llvm-svn: 346147

6 years ago[AST] Get aliased type info from an aliased TemplateSpecialization.
Matt Davis [Mon, 5 Nov 2018 17:25:26 +0000 (17:25 +0000)]
[AST] Get aliased type info from an aliased TemplateSpecialization.

Summary:
Previously the TemplateSpecialization instance for 'template_alias', in the example below, returned the type info of the  canonical type (int).  This ignored the type alias if the template type happen to be aliased.

Before this patch, the assert would trigger with an  alignment of 4:
```
typedef int __attribute__(( aligned( 16 ) )) aligned_int;
template < typename >
using template_alias = aligned_int;
static_assert( alignof( template_alias<void>) == 16, "" );
```

This patch checks if the TemplateSpecialization type has an alias, and if so will return the type information for the aliased type, else the canonical type's info is returned (original behavior).  I believe that this is the desired behavior.

Reviewers: aaron.ballman, rjmccall

Reviewed By: rjmccall

Subscribers: cfe-commits

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

llvm-svn: 346146

6 years ago[UBsan] disable few tests for FreeBSD
David Carlier [Mon, 5 Nov 2018 17:18:23 +0000 (17:18 +0000)]
[UBsan] disable few tests for FreeBSD

Reviewers: krytarowsky, vitalybuka

Reviewed By: vitalybuka

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

llvm-svn: 346145

6 years ago[Format] Add debugging to ObjC language guesser
Ben Hamilton [Mon, 5 Nov 2018 16:59:33 +0000 (16:59 +0000)]
[Format] Add debugging to ObjC language guesser

Summary:
To handle diagnosing bugs where ObjCHeaderStyleGuesser guesses
wrong, this diff adds a bit more debug logging to the Objective-C
language guesser.

Reviewers: krasimir

Reviewed By: krasimir

Subscribers: cfe-commits

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

llvm-svn: 346144

6 years ago[InstCombine] loosen FP 0.0 constraint for fcmp+select substitution
Sanjay Patel [Mon, 5 Nov 2018 16:50:44 +0000 (16:50 +0000)]
[InstCombine] loosen FP 0.0 constraint for fcmp+select substitution

It looks like we correctly removed edge cases with 0.0 from D50714,
but we were a bit conservative because getBinOpIdentity() doesn't
distinguish between +0.0 and -0.0 and 'nsz' is effectively always
true for fcmp (see discussion in:
https://bugs.llvm.org/show_bug.cgi?id=38086

Without this change, we would get regressions by canonicalizing
to +0.0 in all fcmp, and that's a step towards solving:
https://bugs.llvm.org/show_bug.cgi?id=39475

llvm-svn: 346143

6 years ago[InstCombine] adjust tests for select with FP identity op; NFC
Sanjay Patel [Mon, 5 Nov 2018 16:27:03 +0000 (16:27 +0000)]
[InstCombine] adjust tests for select with FP identity op; NFC

These are mislabeled as negative tests.

llvm-svn: 346142

6 years ago[FPEnv] Add constrained CEIL/FLOOR/ROUND/TRUNC intrinsics
Cameron McInally [Mon, 5 Nov 2018 15:59:49 +0000 (15:59 +0000)]
[FPEnv] Add constrained CEIL/FLOOR/ROUND/TRUNC intrinsics

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

llvm-svn: 346141

6 years ago[ThinLTO] Add an option to disable (thin)lto internalization.
Xin Tong [Mon, 5 Nov 2018 15:49:46 +0000 (15:49 +0000)]
[ThinLTO] Add an option to disable (thin)lto internalization.

Summary:
LTO and ThinLTO optimizes the IR differently.

One source of differences is the amount of internalizations that
can happen.

Add an option to enable/disable internalization so that other
differences can be studied in isolation. e.g. inlining.

There are other things lto and thinlto do differently, I will add
flags to enable/disable them as needed.

Reviewers: tejohnson, pcc, steven_wu

Subscribers: mehdi_amini, inglorion, steven_wu, dexonsmith, dang, llvm-commits

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

llvm-svn: 346140

6 years ago[TargetLowering] Begin generalizing TargetLowering::expandFP_TO_SINT support. NFCI.
Simon Pilgrim [Mon, 5 Nov 2018 15:49:09 +0000 (15:49 +0000)]
[TargetLowering] Begin generalizing TargetLowering::expandFP_TO_SINT support. NFCI.

Prior to initial work to add vector expansion support, remove assumptions that we're working on scalar types.

llvm-svn: 346139

6 years ago[InstCombine] add/adjust tests for select with fsub identity op; NFC
Sanjay Patel [Mon, 5 Nov 2018 15:45:01 +0000 (15:45 +0000)]
[InstCombine] add/adjust tests for select with fsub identity op; NFC

llvm-svn: 346138

6 years ago[NFCI][FPEnv] Split constrained intrinsic tests
Cameron McInally [Mon, 5 Nov 2018 15:28:10 +0000 (15:28 +0000)]
[NFCI][FPEnv] Split constrained intrinsic tests

The constrained intrinsic tests have grown in number. Split off
the FMA tests into their own file to reduce double coverage.

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

llvm-svn: 346137

6 years ago[InstCombine] add tests for select with FP identity op; NFC
Sanjay Patel [Mon, 5 Nov 2018 15:08:36 +0000 (15:08 +0000)]
[InstCombine] add tests for select with FP identity op; NFC

llvm-svn: 346136

6 years ago[Tooling] Correct the total number of files being processed when `filter` is provided.
Haojian Wu [Mon, 5 Nov 2018 15:08:00 +0000 (15:08 +0000)]
[Tooling] Correct the total number of files being processed when `filter` is provided.

Reviewers: ioeric

Subscribers: cfe-commits

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

llvm-svn: 346135

6 years ago[Inliner] Penalise inlining of calls with loops at Oz
David Green [Mon, 5 Nov 2018 14:54:34 +0000 (14:54 +0000)]
[Inliner] Penalise inlining of calls with loops at Oz

We currently seem to underestimate the size of functions with loops in them,
both in terms of absolute code size and in the difficulties of dealing with
such code. (Calls, for example, can be tail merged to further reduce
codesize). At -Oz, we can then increase code size by inlining small loops
multiple times.

This attempts to penalise functions with loops at -Oz by adding a CallPenalty
for each top level loop in the function. It uses LI (and hence DT) to calculate
the number of loops. As we are dealing with minsize, the inline threshold is
small and functions at this point should be relatively small, making the
construction of these cheap.

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

llvm-svn: 346134

6 years ago[Mips] Supplement long branch pseudo instructions
Stefan Maksimovic [Mon, 5 Nov 2018 14:37:41 +0000 (14:37 +0000)]
[Mips] Supplement long branch pseudo instructions

Expand on LONG_BRANCH_LUi and LONG_BRANCH_(D)ADDiu pseudo
instructions by creating variants which support
less operands/accept GPR64Opnds as their operand in order
to appease the machine verifier pass.

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

llvm-svn: 346133

6 years ago[NFC][ARM] Adding extra test for ARM CGP
Sam Parker [Mon, 5 Nov 2018 14:17:27 +0000 (14:17 +0000)]
[NFC][ARM] Adding extra test for ARM CGP

Added a reproducer that I received a while ago.

llvm-svn: 346132

6 years ago[Tooling] Add "-filter" option to AllTUsExecution
Haojian Wu [Mon, 5 Nov 2018 13:42:05 +0000 (13:42 +0000)]
[Tooling] Add "-filter" option to AllTUsExecution

Summary: We can run the tools on a subset files of compilation database.

Reviewers: ioeric

Subscribers: cfe-commits

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

llvm-svn: 346131

6 years agoReapply "Fix regression in behavior of clang -x c++-header -fmodule-name=XXX"
Benjamin Kramer [Mon, 5 Nov 2018 12:46:02 +0000 (12:46 +0000)]
Reapply "Fix regression in behavior of clang -x c++-header -fmodule-name=XXX"

This reverts commit r345963. We have a path forward now.

Original commit message:
The driver accidentally stopped passing the input filenames on to -cc1
in this mode due to confusion over what action was being requested.

This change also fixes a couple of crashes I encountered when passing
multiple files to such a -cc1 invocation.

llvm-svn: 346130

6 years agoFix build on sparc64-linux-gnu.
Martin Liska [Mon, 5 Nov 2018 12:27:43 +0000 (12:27 +0000)]
Fix build on sparc64-linux-gnu.

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

llvm-svn: 346129

6 years ago[AMDGPU] Fix the new atomic optimizer in pixel shaders.
Neil Henning [Mon, 5 Nov 2018 12:04:48 +0000 (12:04 +0000)]
[AMDGPU] Fix the new atomic optimizer in pixel shaders.

The new atomic optimizer I previously added in D51969 did not work
correctly when a pixel shader was using derivatives, and had helper
lanes active.

To fix this we add an llvm.amdgcn.ps.live call that guards a branch
around the entire atomic operation - ensuring that all helper lanes are
inactive within the wavefront when we compute our atomic results.

I've added a test case that can cause derivatives, and exposes the
problem.

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

llvm-svn: 346128

6 years ago[CMake] Expose opt-remark tooling through libOptRemarks.dylib
Francis Visoiu Mistrih [Mon, 5 Nov 2018 11:57:44 +0000 (11:57 +0000)]
[CMake] Expose opt-remark tooling through libOptRemarks.dylib

* Create an install target for it
* Add it under tools/opt-remarks
* Add an export file for the dylib
* Install the llvm-c/OptRemarks.h header
* Add an API to query its version

rdar://45458839

llvm-svn: 346127

6 years ago[ARM] Turn assert into condition in ARMCGP
Sam Parker [Mon, 5 Nov 2018 11:26:04 +0000 (11:26 +0000)]
[ARM] Turn assert into condition in ARMCGP

Turn the assert in PrepareConstants into a conditon so that we can
handle mul instructions with negative immediates.

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

llvm-svn: 346126

6 years ago[ARM][ARMCGP] Remove unecessary zexts and truncs
Sam Parker [Mon, 5 Nov 2018 10:58:37 +0000 (10:58 +0000)]
[ARM][ARMCGP] Remove unecessary zexts and truncs

r345840 slightly changed the way promotion happens which could
result in zext and truncs having the same source and destination
types. This fixes that issue.

We can now also remove the zext and trunc in the following case:
(zext (trunc (promoted op)), i32)

This means that we can no longer treat a value, that is only used by
a sink, to be safe to promote.

I've also added in some extra asserts and replaced a cast for a
dyn_cast.

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

llvm-svn: 346125