platform/upstream/llvm.git
4 years ago[PowerPC] extend PPCPreIncPrep Pass for ds/dq form
czhengsz [Mon, 18 Nov 2019 02:32:26 +0000 (21:32 -0500)]
[PowerPC] extend PPCPreIncPrep Pass for ds/dq form

Now, PPCPreIncPrep pass changes a loop to update form and update all load/store
with same base accordingly. We can do more for load/store with same base, for
example, convert load/store with same base to ds/dq form.

Reviewed by: jsji

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

4 years ago[docs] Fix broken links in Kaleidoscope chapter 3
Brian Gesiak [Mon, 18 Nov 2019 02:35:02 +0000 (21:35 -0500)]
[docs] Fix broken links in Kaleidoscope chapter 3

Several links in this document referred to `LangImpl4.html` or
`LangImpl7.html`. However, now these pages use two digits, so for these
links to function they need to be modified to `LangImpl04.html`, and so
on -- note the extra `0`.

4 years agollvm/ObjCARC: Use continue to reduce some nesting, NFC
Duncan P. N. Exon Smith [Mon, 18 Nov 2019 00:29:44 +0000 (16:29 -0800)]
llvm/ObjCARC: Use continue to reduce some nesting, NFC

4 years agoMake it possible to redirect not only errs() but also outs()
Rui Ueyama [Fri, 15 Nov 2019 05:06:57 +0000 (14:06 +0900)]
Make it possible to redirect not only errs() but also outs()

This change is for those who use lld as a library. Context:
https://reviews.llvm.org/D70287

This patch adds a new parmeter to lld::*::link() so that we can pass
an raw_ostream object representing stdout. Previously, lld::*::link()
took only an stderr object.

Justification for making stdoutOS and stderrOS mandatory: I wanted to
make link() functions to take stdout and stderr in that order.
However, if we change the function signature from

  bool link(ArrayRef<const char *> args, bool canExitEarly,
            raw_ostream &stderrOS = llvm::errs());

to

  bool link(ArrayRef<const char *> args, bool canExitEarly,
            raw_ostream &stdoutOS = llvm::outs(),
            raw_ostream &stderrOS = llvm::errs());

, then the meaning of existing code that passes stderrOS silently
changes (stderrOS would be interpreted as stdoutOS). So, I chose to
make existing code not to compile, so that developers can fix their
code.

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

4 years ago[InstCombine] prevent crashing/assert on shift constant expression (PR44028)
Sanjay Patel [Sun, 17 Nov 2019 22:26:11 +0000 (17:26 -0500)]
[InstCombine] prevent crashing/assert on shift constant expression (PR44028)

The binary operator cast implies an instruction, but the matcher for shift does not:
https://bugs.llvm.org/show_bug.cgi?id=44028

4 years ago[LegalizeTypes] When expanding the integer result of LLROUND/LLRINT, also call GetSof...
Craig Topper [Sun, 17 Nov 2019 06:08:53 +0000 (22:08 -0800)]
[LegalizeTypes] When expanding the integer result of LLROUND/LLRINT, also call GetSoftenedFloat if the floating point input needs to be softened.

Before this we were emitting a bitcast to integer from the lowering
code that itself will need to be legalized. By calling
GetSoftenedFloat we get the integer conversion in one step without
needing to relegalize a bitcast.

4 years ago[LegalizeTypes] Remove PromoteFloat support form ExpandIntRes_LLROUND_LLRINT.
Craig Topper [Sun, 17 Nov 2019 03:46:53 +0000 (19:46 -0800)]
[LegalizeTypes] Remove PromoteFloat support form ExpandIntRes_LLROUND_LLRINT.

This code isn't exercised, and was in the wrong place. If we need
this, we would need to promote the type before figuring out which
libcall to use.

I'm choosing to remove it rather than fixing since we don't
support PromoteFloat for LRINT/LROUND/LLRINT/LLROUND when the
result type is legal so I don't see much reason to support it
for the case where the result type isn't legal.

4 years ago[LegalizeTypes] Merge ExpandIntRes_LLROUND and ExpandIntRes_LLRINT into one function...
Craig Topper [Sun, 17 Nov 2019 03:27:43 +0000 (19:27 -0800)]
[LegalizeTypes] Merge ExpandIntRes_LLROUND and ExpandIntRes_LLRINT into one function that handles both. NFC

These too functions are were the same except for which libcall gets
emitted. Just merge them into one.

This is prep work for some other work including strict fp support.

4 years ago[ConstantFold] Handle identity folds at top of ConstantFoldBinaryInst
Florian Hahn [Sun, 17 Nov 2019 21:29:55 +0000 (21:29 +0000)]
[ConstantFold] Handle identity folds at top of ConstantFoldBinaryInst

Currently we miss folds with undef and identity values for binary ops
that do not fold to undef in general.

We can generalize the identity simplifications and do them before
checking for undef in particular.

Alive checks:
 * OR - https://rise4fun.com/Alive/8OsK
 * AND - https://rise4fun.com/Alive/e3tE

This will also allow us to remove some now redundant cases throughout
the function, but I would like to do this as follow-up. That should make
tracking down potential issues easier.

Reviewers: spatel, RKSimon, lebedev.ri

Reviewed By: spatel

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

4 years ago[ConstantFold] Add some tests for binops with constants and undefs.
Florian Hahn [Wed, 13 Nov 2019 10:20:59 +0000 (10:20 +0000)]
[ConstantFold] Add some tests for binops with constants and undefs.

Precommit tests for D70169.

4 years ago[Attributor] Use nofree argument attribute for heap-to-stack conversion
Stefan Stipanovic [Sun, 17 Nov 2019 20:35:04 +0000 (21:35 +0100)]
[Attributor] Use nofree argument attribute for heap-to-stack conversion

Reviewers: jdoerfert, uenoku

Subscribers:

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

4 years ago[SimplifyCFG] propagate fast-math-flags (FMF) from phi to select
Sanjay Patel [Sun, 17 Nov 2019 16:23:44 +0000 (11:23 -0500)]
[SimplifyCFG] propagate fast-math-flags (FMF) from phi to select

Similar to/extension of D70208 (rGee0882bdf866), but this one
may finally allow closing motivating bugs.

This is another step towards having FMF apply only to FP values
rather than those + fcmp. See PR38086 for one of the original
discussions/motivations:
https://bugs.llvm.org/show_bug.cgi?id=38086

And the test here is derived from PR39535:
https://bugs.llvm.org/show_bug.cgi?id=39535

Currently, we lose FMF when converting any phi to select in
SimplifyCFG. There are a small number of similar changes needed
to correct within SimplifyCFG, so it should be quick to patch
this pass up.

FMF was extended to select and phi with:
D61917
D67564

4 years ago[SimplifyCFG] add fast-math-flags to tests for better coverage; NFC
Sanjay Patel [Sun, 17 Nov 2019 15:37:42 +0000 (10:37 -0500)]
[SimplifyCFG] add fast-math-flags to tests for better coverage; NFC

The conversion to select fails to propagate FMF.

4 years ago[SimplifyCFG] add tests for possible FP speculative select; NFC
Sanjay Patel [Sun, 17 Nov 2019 15:27:47 +0000 (10:27 -0500)]
[SimplifyCFG] add tests for possible FP speculative select; NFC

It doesn't seem that there are any perf/param knobs that can be turned
to create selects for the FP variants of the tests, but that may not
always be true in the future. If it changes, we should propagate FMF.

4 years ago[InstCombine] Canonicalize ssub.with.overflow with clamp to ssub.sat
David Green [Sun, 17 Nov 2019 10:45:00 +0000 (10:45 +0000)]
[InstCombine] Canonicalize ssub.with.overflow with clamp to ssub.sat

Working on top of D69252, this adds canonicalisation patterns for ssub.with.overflow to ssub.sats.

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

4 years ago[InstCombine] Canonicalize sadd.with.overflow with clamp to sadd.sat
David Green [Sun, 17 Nov 2019 10:40:26 +0000 (10:40 +0000)]
[InstCombine] Canonicalize sadd.with.overflow with clamp to sadd.sat

This adds to D69245, adding extra signed patterns for folding from a
sadd_with_overflow to a sadd_sat. These are more complex than the
unsigned patterns, as the overflow can occur in either direction.

For the add case, the positive overflow can only occur if both of the
values are positive (same for both the values being negative). So there
is an extra select on whether to use the positive or negative overflow
limit.

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

4 years ago[InstCombine] Add extra tests for overflow_to_sat.ll. NFC
David Green [Sun, 17 Nov 2019 10:32:12 +0000 (10:32 +0000)]
[InstCombine] Add extra tests for overflow_to_sat.ll. NFC

4 years agoRevert "[NFC] Refactor representation of materialized temporaries"
Nico Weber [Sun, 17 Nov 2019 07:09:25 +0000 (02:09 -0500)]
Revert "[NFC] Refactor representation of materialized temporaries"

This reverts commit 08ea1ee2db5f9d6460fef1d79d0d1d1a5eb78982.
It broke ./ClangdTests/FindExplicitReferencesTest.All
on the bots, see comments on https://reviews.llvm.org/D69360

4 years ago[MIRNamer]: Make the check lines in the test robust with regex.
Aditya Nandakumar [Sun, 17 Nov 2019 06:58:45 +0000 (22:58 -0800)]
[MIRNamer]: Make the check lines in the test robust with regex.

Previously we were checking for specific hashes. Make it check for
regexes.

Should fix failure caused by: 72768685567b

4 years ago[libc++] Add _ITER_CONCEPT and _ITER_TRAITS implementations from C++20
Eric Fiselier [Sun, 17 Nov 2019 01:24:39 +0000 (20:24 -0500)]
[libc++] Add _ITER_CONCEPT and _ITER_TRAITS implementations from C++20

These traits are currently unused because we don't implement ranges.
However, their addition is part of ongoing work to allow libc++
to optimize on user-provided contiguous iterators.

4 years ago[libc++] Add C++20 contiguous_iterator_tag.
Eric Fiselier [Sun, 17 Nov 2019 01:12:48 +0000 (20:12 -0500)]
[libc++] Add C++20 contiguous_iterator_tag.

This work is part of an ongoing effort to allow libc++ to
optimize user provided contiguous iterators.

4 years ago[Docs] Remove stray :doc: directive.
kristina [Sat, 16 Nov 2019 23:32:48 +0000 (23:32 +0000)]
[Docs] Remove stray :doc: directive.

4 years ago[Docs] Fix sphinx warning.
kristina [Sat, 16 Nov 2019 23:23:26 +0000 (23:23 +0000)]
[Docs] Fix sphinx warning.

Fix sphinx warning over an ambigious reference.

4 years ago[Docs] Try fixing the tutorial toctree
kristina [Sat, 16 Nov 2019 23:06:50 +0000 (23:06 +0000)]
[Docs] Try fixing the tutorial toctree

Unorphan the old tutorial and reference every page in the index
explicitly. This should hopefully make Sphinx generate correct
hyperlinks now.

4 years agoMake it possible to run MIRCanonicalizer in pipeline.
Aditya Nandakumar [Sat, 16 Nov 2019 22:14:20 +0000 (14:14 -0800)]
Make it possible to run MIRCanonicalizer in pipeline.

https://reviews.llvm.org/D70321

4 years ago[libc++] Rename __to_raw_pointer to __to_address.
Eric Fiselier [Sat, 16 Nov 2019 22:13:26 +0000 (17:13 -0500)]
[libc++] Rename __to_raw_pointer to __to_address.

This function has the same behavior as the now-standand std::to_address.
Re-using the name makes the behavior more clear, and in the future it
will allow us to correctly get the raw pointer for user provided pointer
types.

4 years ago[Docs] Fix relative links in tutorial.
kristina [Sat, 16 Nov 2019 20:58:08 +0000 (20:58 +0000)]
[Docs] Fix relative links in tutorial.

Update relative links in Kaleidoscope tutorial.

4 years ago[mips] Remove redundant cast. NFC
Simon Atanasyan [Sat, 16 Nov 2019 07:09:01 +0000 (10:09 +0300)]
[mips] Remove redundant cast. NFC

4 years ago[mips] Remove old FIXME comment. NFC
Simon Atanasyan [Sat, 16 Nov 2019 06:19:58 +0000 (09:19 +0300)]
[mips] Remove old FIXME comment. NFC

The issue was fixed at r275050.

4 years ago[NFC] Refactor representation of materialized temporaries
Tyker [Sat, 16 Nov 2019 16:04:34 +0000 (17:04 +0100)]
[NFC] Refactor representation of materialized temporaries

Summary:
this patch refactor representation of materialized temporaries to prevent an issue raised by rsmith in https://reviews.llvm.org/D63640#inline-612718

Reviewers: rsmith, martong, shafik

Reviewed By: rsmith

Subscribers: rnkovacs, arphaman, cfe-commits

Tags: #clang

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

4 years ago[DWARF5]Addition of alignment atrribute in typedef DIE.
Sourabh Singh Tomar [Fri, 15 Nov 2019 20:44:34 +0000 (02:14 +0530)]
[DWARF5]Addition of alignment atrribute in typedef DIE.

This patch, adds support for DW_AT_alignment[DWARF5] attribute, to be emitted with typdef DIE.
When explicit alignment is specified.

Patch by Awanish Pandey <Awanish.Pandey@amd.com>

Reviewers: aprantl, dblaikie, jini.susan.george, SouraVX, alok,
deadalinx

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

4 years ago[clangd] Improve long and confusing preamble log message.
Sam McCall [Sat, 16 Nov 2019 16:11:54 +0000 (17:11 +0100)]
[clangd] Improve long and confusing preamble log message.

4 years agoMCObjectStreamer: assign MCSymbols in the dummy fragment to offset 0.
James Y Knight [Sun, 10 Nov 2019 21:12:29 +0000 (16:12 -0500)]
MCObjectStreamer: assign MCSymbols in the dummy fragment to offset 0.

In MCObjectStreamer, when there is no current fragment, initially
symbols are created in a "pending" state and assigned to a dummy
empty fragment.

Previously, they were not being assigned an offset, and thus
evaluateAbsolute would fail if trying to evaluate an expression 'a -
b', where both 'a' and 'b' were in this pending state.

Also slightly refactored the EmitLabel overload which takes an
MCFragment for clarity.

Fixes: https://llvm.org/PR41825

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

4 years ago[clang-format] fix regression in middle pointer alignment
mydeveloperday [Sat, 16 Nov 2019 14:36:40 +0000 (14:36 +0000)]
[clang-format] fix regression in middle pointer alignment

Summary:
a75f8d98d7ac introduced a regression with Middle pointer alignment,
which this patch fixes.

Reviewers: MyDeveloperDay, klimek, sammccall

Reviewed By: MyDeveloperDay, sammccall

Subscribers: cfe-commits, merge_guards_bot

Patch by: Typz

Tags: #clang

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

4 years agoRemove +x permission on some files
Sylvestre Ledru [Sat, 16 Nov 2019 13:46:38 +0000 (14:46 +0100)]
Remove +x permission on some files

4 years agoRemove +x permission on clang/lib/Format/Format.cpp
Sylvestre Ledru [Sat, 16 Nov 2019 13:44:35 +0000 (14:44 +0100)]
Remove +x permission on clang/lib/Format/Format.cpp

4 years agoFix a build failure with perf: Add a missing include to llvm/Support/ManagedStatic.h
Sylvestre Ledru [Sat, 16 Nov 2019 13:39:59 +0000 (14:39 +0100)]
Fix a build failure with perf: Add a missing include to llvm/Support/ManagedStatic.h

It was failing with
PerfJITEventListener.cpp:489:7: error: 'ManagedStatic' in namespace 'llvm' does not name a template type
 llvm::ManagedStatic<PerfJITEventListener> PerfListener;

4 years ago[ELF] Fix lld build on Windows/MinGW
Ayke van Laethem [Fri, 15 Nov 2019 19:13:36 +0000 (20:13 +0100)]
[ELF] Fix lld build on Windows/MinGW

The patch in https://reviews.llvm.org/D64077 causes a build failure
because both the Defined and SharedSymbol classes are bigger than 80
bytes on MinGW 8.

This patch fixes this build failure by changing the type of the
bitfields. It is a similar change to the bitfield changes in
https://reviews.llvm.org/D64238, but instead of changing to bool I
decided to use uint8_t because one of the bitfields takes up two bits
instead of one.

Note: the patch is slightly different from the one reviewed in
Phabricator, but it is a trivial change to align it with LLVM master
instead of LLVM 9. Also, it passes all lld tests.

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

4 years ago[clang-format] Add SpaceBeforeBrackets
mydeveloperday [Sat, 16 Nov 2019 11:54:21 +0000 (11:54 +0000)]
[clang-format] Add SpaceBeforeBrackets

Summary: Adds a new option SpaceBeforeBrackets to add spaces before brackets (i.e. int a[23]; -> int a [23];)  This is present as an option in the Visual Studio C++ code formatting settings, but there was no matching setting in clang-format.

Reviewers: djasper, MyDeveloperDay, mitchell-stellar

Reviewed By: MyDeveloperDay

Subscribers: llvm-commits, cfe-commits, klimek

Patch by: Anteru

Tags: #clang, #clang-format, #llvm

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

4 years agoAdd support of the next Ubuntu (Ubuntu 20.04 - Focal Fossa)
Sylvestre Ledru [Sat, 16 Nov 2019 11:20:47 +0000 (12:20 +0100)]
Add support of the next Ubuntu (Ubuntu 20.04 - Focal Fossa)

4 years agoAMDGPU/SILoadStoreOptimizer: fix a likely bug introduced recently
Nicolai Hähnle [Wed, 9 Oct 2019 10:53:17 +0000 (12:53 +0200)]
AMDGPU/SILoadStoreOptimizer: fix a likely bug introduced recently

Summary:
We should check for same instruction class before checking whether they
have the same base address, else we might iterate out of bounds of a
MachineInstr operands list. The InstClass check is also cheaper.

This was introduced in SVN r373630.

Reviewers: tstellar

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

Tags: #llvm

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

4 years ago[RISCV] Handle variable sized objects with the stack need to be realigned
Shiva Chen [Tue, 15 Oct 2019 07:11:35 +0000 (15:11 +0800)]
[RISCV] Handle variable sized objects with the stack need to be realigned

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

4 years agoDebugInfo: Use loclistx for DWARFv5 location lists to reduce the number of relocations
David Blaikie [Tue, 12 Nov 2019 22:15:37 +0000 (14:15 -0800)]
DebugInfo: Use loclistx for DWARFv5 location lists to reduce the number of relocations

This only implements the non-dwo part, but loclistx is necessary to use
location lists in DWARFv5, so it's a precursor to that work - and
generally reduces relocations (only using one reloc, then
indexes/relative offsets for all location list references) in non-split
DWARF.

4 years ago[llvm-cov] Fix illegal cast from uint64_t to int64_t
Sajjad Mirza [Sat, 16 Nov 2019 02:09:53 +0000 (18:09 -0800)]
[llvm-cov] Fix illegal cast from uint64_t to int64_t

Summary:
Counters are stored as uint64_t in the coverage mapping, but
exporting in JSON requires signed integers. Clamp the values to the
smaller range to make the conversion safe.

Reviewers: Dor1s, vsk

Reviewed By: Dor1s

Subscribers: llvm-commits

Tags: #llvm

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

4 years ago[lldb-vscode] support the completion request
Walter Erquinigo [Wed, 30 Oct 2019 23:46:06 +0000 (16:46 -0700)]
[lldb-vscode] support the completion request

Summary:
The DAP has a completion request that has been unimplemented. It allows showing autocompletion tokens inside the Debug Console.
I implemented it in a very simple fashion mimicking what the user would see when autocompleting an expression inside the CLI.
There are two cases: normal variables and commands. The latter occurs when a text is prepepended with ` in the Debug Console.
These two cases work well and have tests.

Reviewers: clayborg, aadsm

Subscribers: lldb-commits

Tags: #lldb

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

4 years agoAvoid including Builtins.h in Preprocessor.h
Reid Kleckner [Sat, 16 Nov 2019 00:36:00 +0000 (16:36 -0800)]
Avoid including Builtins.h in Preprocessor.h

Builtins are rarely if ever accessed via the Preprocessor. They are
typically found on the ASTContext, so there should be no performance
penalty to using a pointer indirection to store the builtin context.

4 years agoFix -Wunused-result warnings in LLDB
Reid Kleckner [Thu, 14 Nov 2019 23:27:49 +0000 (15:27 -0800)]
Fix -Wunused-result warnings in LLDB

Three uses of try_lock intentionally ignore the result, as explained in
the comment. Make that explicit with a void cast.

Add what appears to be a missing return in the clang expression parser
code. It's a functional change, but presumably the right one.

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

4 years agoAdd a testcase for Clang modules being updated within one LLDB session.
Adrian Prantl [Sat, 16 Nov 2019 00:25:46 +0000 (16:25 -0800)]
Add a testcase for Clang modules being updated within one LLDB session.

This actually works as expected, but wasn't explicitly tested before.

4 years agoDebugInfo: Templatize rnglist header parsing to setup for reuse with loclist header...
David Blaikie [Fri, 15 Nov 2019 23:48:31 +0000 (15:48 -0800)]
DebugInfo: Templatize rnglist header parsing to setup for reuse with loclist header parsing

4 years ago[WebAssembly] Fix miscompile of select with and
Thomas Lively [Fri, 15 Nov 2019 23:30:48 +0000 (15:30 -0800)]
[WebAssembly] Fix miscompile of select with and

Summary:
Rolls back the remaining bad optimizations introduced in
eb15d00193f. Some of them were already rolled back in e661f946a7db and
this finishes the job.

Fixes https://bugs.llvm.org/show_bug.cgi?id=44012.

Reviewers: dschuff, aheejin

Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

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

4 years ago[COFF] Don't error if the only inputs are from /wholearchive:
Reid Kleckner [Thu, 7 Nov 2019 21:50:31 +0000 (13:50 -0800)]
[COFF] Don't error if the only inputs are from /wholearchive:

Fixes PR43744

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

4 years agoDon't add optnone or noinline if the function is already marked as
Akira Hatanaka [Fri, 15 Nov 2019 23:27:56 +0000 (15:27 -0800)]
Don't add optnone or noinline if the function is already marked as
always_inline.

The assertion in SetLLVMFunctionAttributesForDefinition used to fail
when there was attribute OptimizeNone on the AST function and attribute
always_inline on the IR function. This happens because base destructors
are annotated with always_inline when the code is compiled with
-fapple-kext (see r124757).

rdar://problem/57169694

4 years agodotest: Add a way for the run_to_* helpers to register dylibs
Fred Riss [Fri, 8 Nov 2019 01:32:29 +0000 (17:32 -0800)]
dotest: Add a way for the run_to_* helpers to register dylibs

Summary:
To run the testsuite remotely the executable needs to be uploaded to
the target system. The Target takes care of this by default.

When the test uses additional shared libraries, those won't be handled
by default and need to be registered with the target using
test.registerSharedLibrariesWithTarget(target, dylib).

Calling this API requires a target, so it doesn't mesh well with the
run_to_* helpers that we've been advertising as the right way to write
tests.

This patch adds an extra_images argument to all the helpers and does
the registration automatically when running a remote
testsuite. TestWeakSymbols.py was converted to use this new scheme.

Reviewers: jingham

Subscribers: lldb-commits

Tags: #lldb

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

4 years ago[clang-tidy] Give readability-redundant-string-init a customizable list of string...
Mitchell Balan [Fri, 15 Nov 2019 23:09:27 +0000 (18:09 -0500)]
[clang-tidy] Give readability-redundant-string-init a customizable list of string types to fix

Summary:
This patch adds a feature requested in https://reviews.llvm.org/D69238 to enable `readability-redundant-string-init` to take a list of strings to apply the fix to rather than hard-coding `basic_string`. It adds a `StringNames` option of semicolon-delimited names of string classes to which to apply this fix. Tests ensure this works with test class out::TestString as well as std::string and std::wstring as before. It should be applicable to llvm::StringRef, QString, etc.

Note: This commit was previously reverted due to a failing unit test. That test has been fixed in this version.

Reviewers: MyDeveloperDay, aaron.ballman, hokein, alexfh, JonasToth, gribozavr2

Patch by: poelmanc

Subscribers: gribozavr2, xazax.hun, Eugene.Zelenko, cfe-commits

Tags: #clang-tools-extra, #clang

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

4 years ago[clang-tidy] Fix readability-redundant-string-init for c++17/c++2a
Mitchell Balan [Fri, 15 Nov 2019 22:00:32 +0000 (17:00 -0500)]
[clang-tidy] Fix readability-redundant-string-init for c++17/c++2a

Summary:
`readability-redundant-string-init` was one of several clang-tidy checks documented as failing for C++17. (The failure mode in C++17 is that it changes `std::string Name = ""`; to `std::string Name = Name;`, which actually compiles but crashes at run-time.)

Analyzing the AST with `clang -Xclang -ast-dump` showed that the outer `CXXConstructExprs` that previously held the correct SourceRange were being elided in C++17/2a, but the containing `VarDecl` expressions still had all the relevant information. So this patch changes the fix to get its source ranges from `VarDecl`.

It adds one test `std::string g = "u", h = "", i = "uuu", j = "", k;` to confirm proper warnings and fixit replacements in a single `DeclStmt` where some strings require replacement and others don't. The readability-redundant-string-init.cpp and readability-redundant-string-init-msvc.cpp tests now pass for C++11/14/17/2a.

Reviewers: gribozavr, etienneb, alexfh, hokein, aaron.ballman, gribozavr2

Patch by: poelmanc

Subscribers: NoQ, MyDeveloperDay, Eugene.Zelenko, dylanmckay, cfe-commits

Tags: #clang, #clang-tools-extra

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

4 years agoDon't use end-of-line comments for the DebugInfoKind enum, NFC
Reid Kleckner [Fri, 15 Nov 2019 22:06:23 +0000 (14:06 -0800)]
Don't use end-of-line comments for the DebugInfoKind enum, NFC

These are long comments, and I find the new structure easier to read.

4 years ago[GISel][CombinerHelper] Use uses() instead of operands() when traversing use operands.
Quentin Colombet [Fri, 15 Nov 2019 21:33:35 +0000 (13:33 -0800)]
[GISel][CombinerHelper] Use uses() instead of operands() when traversing use operands.

NFC

4 years ago[GISel][CombinerHelper] Add support for scalar type for the result of shuffle vector
Quentin Colombet [Fri, 15 Nov 2019 21:24:27 +0000 (13:24 -0800)]
[GISel][CombinerHelper] Add support for scalar type for the result of shuffle vector

LLVM IR of 1-element vectors get lower into scalar in GISel. As a
result, shuffle vector may also produce a scalar.

This patch teaches the shuffle combiner how to deal with scalars when
they are in the destination type of a shuffle vector.

For now, we just support the easy case where this can be lowered to
a plain copy. For other cases, we leave the shuffle vector as is.

This type of IR are seen in O0 pipelines. E.g., as produced with
SingleSource/UnitTests/Vector/AArch64/aarch64_neon_intrinsics.c.

rdar://problem/57198904

4 years agoRevert "[clang-tidy] Give readability-redundant-string-init a customizable list of...
Mitchell Balan [Fri, 15 Nov 2019 21:46:58 +0000 (16:46 -0500)]
Revert "[clang-tidy] Give readability-redundant-string-init a customizable list of string types to fix"

This reverts commit 96fbc32cb9ea23b1e7e3ff6906ec3ccda9500982.

4 years ago[clang-tidy] Give readability-redundant-string-init a customizable list of string...
Mitchell Balan [Fri, 15 Nov 2019 21:42:43 +0000 (16:42 -0500)]
[clang-tidy] Give readability-redundant-string-init a customizable list of string types to fix

Summary:
This patch adds a feature requested in https://reviews.llvm.org/D69238 to enable `readability-redundant-string-init` to take a list of strings to apply the fix to rather than hard-coding `basic_string`. It adds a `StringNames` option of semicolon-delimited names of string classes to which to apply this fix. Tests ensure this works with test class out::TestString as well as std::string and std::wstring as before. It should be applicable to llvm::StringRef, QString, etc.

Reviewers: MyDeveloperDay, aaron.ballman, hokein, alexfh, JonasToth, gribozavr2

Patch by: poelmanc

Subscribers: gribozavr2, xazax.hun, Eugene.Zelenko, cfe-commits

Tags: #clang-tools-extra, #clang

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

4 years agogn build: Merge 631be5c0d41
LLVM GN Syncbot [Fri, 15 Nov 2019 21:34:55 +0000 (21:34 +0000)]
gn build: Merge 631be5c0d41

4 years agoRemove Support/Options.h, it is unused
Reid Kleckner [Thu, 14 Nov 2019 22:47:11 +0000 (14:47 -0800)]
Remove Support/Options.h, it is unused

It was added in 2014 in 732e0aa9fb84f1 with one use in Scalarizer.cpp.
That one use was then removed when porting to the new pass manager in
2018 in b6f76002d9158628e78.

While the RFC and the desire to get off of static initializers for
cl::opt all still stand, this code is now dead, and I think we should
delete this code until someone is ready to do the migration.

There were many clients of CommandLine.h that were it transitively
through LLVMContext.h, so I cleaned that up in 4c1a1d3cf97e1ede466.

Reviewers: beanz

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

4 years agoRevert "re-land [DebugInfo] Add debug location to stubs generated by CGDeclCXX and...
Alexandre Ganea [Fri, 15 Nov 2019 21:21:17 +0000 (16:21 -0500)]
Revert "re-land [DebugInfo] Add debug location to stubs generated by CGDeclCXX and mark them as artificial"

This reverts commit 9c1baa23526c6d7d06eafefbf82d73bfe9bb3aaf.

4 years ago[clang-tidy] modernize-use-override new option AllowOverrideAndFinal
Mitchell Balan [Fri, 15 Nov 2019 21:13:48 +0000 (16:13 -0500)]
[clang-tidy] modernize-use-override new option AllowOverrideAndFinal

Summary:
In addition to adding `override` wherever possible, clang-tidy's `modernize-use-override` nicely removes `virtual` when `override` or `final` is specified, and further removes override when final is specified. While this is great default behavior, when code needs to be compiled with gcc at high warning levels that include `gcc -Wsuggest-override` or `gcc -Werror=suggest-override`, clang-tidy's removal of the redundant `override` keyword causes gcc to emit a warning or error. This discrepancy / conflict has been noted by others including a comment on Stack Overflow and by Mozilla's Firefox developers.

This patch adds an AllowOverrideAndFinal option defaulting to 0 - thus preserving current behavior - that when enabled allows both `override` and `final` to co-exist, while still fixing all other issues.

The patch includes a test file verifying all combinations of virtual/override/final, and mentions the new option in the release notes.

Reviewers: alexfh, djasper, JonasToth

Patch by: poelmanc

Subscribers: JonasToth, cfe-commits

Tags: #clang

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

4 years ago[SimplifyCFG] propagate fast-math-flags (FMF) from phi to select
Sanjay Patel [Fri, 15 Nov 2019 21:06:43 +0000 (16:06 -0500)]
[SimplifyCFG] propagate fast-math-flags (FMF) from phi to select

This is another step towards having FMF apply only to FP values
rather than those + fcmp. See PR38086 for one of the original
discussions/motivations:
https://bugs.llvm.org/show_bug.cgi?id=38086

And the test here is derived from PR39535:
https://bugs.llvm.org/show_bug.cgi?id=39535

Currently, we lose FMF when converting any phi to select in
SimplifyCFG. There are a small number of similar changes needed
to correct within SimplifyCFG, so it should be quick to patch
this pass up.

FMF was extended to select and phi with:
D61917
D67564

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

4 years ago[clang-tidy] modernize-use-using work with multi-argument templates
Mitchell Balan [Fri, 15 Nov 2019 19:30:41 +0000 (14:30 -0500)]
[clang-tidy] modernize-use-using work with multi-argument templates

Summary:
If clang-tidy's modernize-use-using feature finds any commas that are not within parentheses, it won't create a fix. That means it won't change lines like:
  typedef std::pair<int, int> Point;
to
  using Point = std::pair<int, int>;
or even:
  typedef std::map<std::string, Foo> MyMap;
  typedef std::vector<int,MyCustomAllocator<int>> MyVector;

This patch allows the fix to apply to lines with commas if they are within parentheses or angle brackets that were not themselves within parentheses.

Reviewers: alexfh, hokein, aaron.ballman

Patch by: poelmanc

Subscribers: jonathanmeier, cfe-commits

Tags: #clang, #clang-tools-extra

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

4 years agore-land [DebugInfo] Add debug location to stubs generated by CGDeclCXX and mark them...
Alexandre Ganea [Fri, 15 Nov 2019 21:01:25 +0000 (16:01 -0500)]
re-land [DebugInfo] Add debug location to stubs generated by CGDeclCXX and mark them as artificial

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

4 years agogn build: Merge d6de5f12d48
LLVM GN Syncbot [Fri, 15 Nov 2019 20:50:43 +0000 (20:50 +0000)]
gn build: Merge d6de5f12d48

4 years agoRevert "[LoadStoreVectorize] Use '||' instead of '|' between sides with function...
Richard Smith [Fri, 15 Nov 2019 20:49:35 +0000 (12:49 -0800)]
Revert "[LoadStoreVectorize] Use '||' instead of '|' between sides with function calls. NFCI."

This broke two tests. Presumably the non-short-circuting '|' was
intentional here.

This reverts commit f7efea0ded8e16c7751b378523407a491016edd6.

4 years ago[mips] Enable `la` pseudo instruction on 64-bit arch.
Simon Atanasyan [Mon, 11 Nov 2019 21:10:31 +0000 (00:10 +0300)]
[mips] Enable `la` pseudo instruction on 64-bit arch.

This patch makes LLVM compatible with GAS. It accepts `la` pseudo
instruction on arch with 64-bit pointers and just shows a warning.

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

4 years ago[mips] Do not emit R_MIPS_JALR for sym+offset in case of O32 ABI
Simon Atanasyan [Sat, 9 Nov 2019 06:29:42 +0000 (09:29 +0300)]
[mips] Do not emit R_MIPS_JALR for sym+offset in case of O32 ABI

O32 ABI uses relocations in REL format. Relocation's addend is written
in place. R_MIPS_JALR relocation points to the `jalr` instruction which
does not have a place to store the relocation addend. So it's impossible
to save non-zero "offset". This patch blocks emission of `R_MIPS_JALR`
relocations in such cases.

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

4 years agoAdd a missing triple in ast-dump-decl-json.m
Alex Richardson [Fri, 15 Nov 2019 20:14:06 +0000 (20:14 +0000)]
Add a missing triple in ast-dump-decl-json.m

Since there was no triple argument this test started failing on macOS bots,
where the mangled names are prefixed with an underscore.

4 years ago[LoopCacheAnalysis]: Fix assertion failure during cost computation
Rachel Craik [Fri, 15 Nov 2019 19:56:26 +0000 (14:56 -0500)]
[LoopCacheAnalysis]: Fix assertion failure during cost computation

Ensure the stride and trip count have the same type before multiplying them during reference cost calculation

Reviewed By: jdoefert

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

4 years ago[-gmodules] Let LLDB log a warning if the Clang module hash mismatches.
Adrian Prantl [Thu, 14 Nov 2019 21:57:49 +0000 (13:57 -0800)]
[-gmodules] Let LLDB log a warning if the Clang module hash mismatches.

This feature is mostly there to aid debugging of Clang module issues,
since the only useful actual the end-user can to is to recompile their
program.

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

4 years agoAdd RTTI support to the SymbolFile class hierarchy
Adrian Prantl [Fri, 15 Nov 2019 18:13:16 +0000 (10:13 -0800)]
Add RTTI support to the SymbolFile class hierarchy

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

4 years agoRename posix/FileSystem.cpp to FileSystemPosix.cpp
Adrian Prantl [Fri, 15 Nov 2019 19:47:55 +0000 (11:47 -0800)]
Rename posix/FileSystem.cpp to FileSystemPosix.cpp

to avoid a linker warning on Darwin about two files having the same name.

4 years ago[GCOV] Skip artificial functions from being emitted
Alexandre Ganea [Fri, 15 Nov 2019 19:23:05 +0000 (14:23 -0500)]
[GCOV] Skip artificial functions from being emitted

This is a patch to support  D66328, which was reverted until this lands.

Enable a compiler-rt test that used to fail previously with D66328.

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

4 years ago[OpenMP 5.0] - Extend defaultmap, by Chi Chun Chen.
cchen [Fri, 15 Nov 2019 18:02:06 +0000 (13:02 -0500)]
[OpenMP 5.0] - Extend defaultmap, by Chi Chun Chen.

Summary:
For the extended defaultmap, most of the work is inside sema.
The only difference for codegen is to set different initial
maptype for different implicit-behavior.

Reviewers: jdoerfert, ABataev

Reviewed By: ABataev

Subscribers: dreachem, sandoval, cfe-commits

Tags: #clang, #openmp

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

4 years ago[SVFS] Inject TLI Mappings in VFABI attribute.
Francesco Petrogalli [Mon, 11 Nov 2019 19:42:18 +0000 (19:42 +0000)]
[SVFS] Inject TLI Mappings in VFABI attribute.

This patch introduces a function pass to inject the scalar-to-vector
mappings stored in the TargetLIbraryInfo (TLI) into the Vector
Function ABI (VFABI) variants attribute.

The test is testing the injection for three vector libraries supported
by the TLI (Accelerate, SVML, MASSV).

The pass does not change any of the analysis associated to the
function.

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

4 years ago[clangd] Don't repeat class template args when printing constructor definitions
Sam McCall [Fri, 15 Nov 2019 18:23:04 +0000 (19:23 +0100)]
[clangd] Don't repeat class template args when printing constructor definitions

This fixes part of https://github.com/clangd/clangd/issues/76

4 years ago[AST] Let DeclarationNameInfo printing use PrintingPolicy, and fix const-correctness
Sam McCall [Fri, 15 Nov 2019 18:19:17 +0000 (19:19 +0100)]
[AST] Let DeclarationNameInfo printing use PrintingPolicy, and fix const-correctness

4 years ago[llvm-objcopy][MachO] Implement --redefine-sym and --redefine-syms
Fangrui Song [Wed, 13 Nov 2019 21:10:15 +0000 (13:10 -0800)]
[llvm-objcopy][MachO] Implement --redefine-sym and --redefine-syms

Similar to D46029 (ELF) and D70036 (COFF), but for MachO.
Note, when --strip-symbol (not implemented for MachO) is also specified,
--redefine-sym executes before --strip-symbol.

Reviewed By: jhenderson, seiya

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

4 years ago[ThinLTO] Fix -Wunused-function in NDEBUG builds after llvmorg-10-init-9933-g3d708bf5c26
Fangrui Song [Fri, 15 Nov 2019 18:00:23 +0000 (10:00 -0800)]
[ThinLTO] Fix -Wunused-function in NDEBUG builds after llvmorg-10-init-9933-g3d708bf5c26

4 years ago[DebugInfo] Allow spill slots in call site parameter descriptions
Vedant Kumar [Thu, 14 Nov 2019 17:20:58 +0000 (09:20 -0800)]
[DebugInfo] Allow spill slots in call site parameter descriptions

Allow call site paramter descriptions to reference spill slots. Spill
slots are not visible to high-level LLVM IR, so they can safely be
referenced during entry value evaluation (as they cannot be clobbered by
some other function).

This gives a 5% increase in the number of call site parameter DIEs in an
LTO x86_64 build of the xnu kernel.

This reverts commit eb4c98ca3d2590bad9f6542afbf3a7824d2b53fa (
[DebugInfo] Exclude memory location values as parameter entry values),
effectively reintroducing the portion of D60716 which dealt with memory
locations (authored by Djordje, Nikola, Ananth, and Ivan).

This partially addresses llvm.org/PR43343. However, not all memory
operands forwarded to callees live in spill slots. In the xnu build, it
may be possible to use an escape analysis to increase the number of call
site parameter by another 15% (more details in PR43343).

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

4 years ago[LoadStoreVectorize] Use '||' instead of '|' between sides with function calls. NFCI.
Dávid Bolvanský [Fri, 15 Nov 2019 17:50:36 +0000 (18:50 +0100)]
[LoadStoreVectorize] Use '||' instead of '|' between sides with function calls. NFCI.

Fixes warning from PVS Studio

4 years ago[CMake] Configure the Info.plist so it contains a real version number.
Jonas Devlieghere [Fri, 15 Nov 2019 17:46:27 +0000 (09:46 -0800)]
[CMake] Configure the Info.plist so it contains a real version number.

Use CMake to configure the Info.plist file so that we have a real
version number in things like crash reporter.

4 years ago[libc++] [chrono] Fix year_month_weekday::ok() implementation.
Marek Kurdej [Fri, 15 Nov 2019 12:04:47 +0000 (13:04 +0100)]
[libc++] [chrono] Fix year_month_weekday::ok() implementation.

Reviewers: ldionne, EricWF, mclow.lists

Reviewed By: mclow.lists

Subscribers: christof, dexonsmith, libcxx-commits

Tags: #libc

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

4 years ago[libcxx] use __builtin_isnan in std::isnan.
Ilya Tokar [Fri, 15 Nov 2019 17:29:02 +0000 (12:29 -0500)]
[libcxx] use __builtin_isnan in std::isnan.

Summary: This allows std::isnan to be fully inlined, instead of generating calls.

Reviewers: EricWF

Reviewed By: EricWF

Subscribers: christof, ldionne

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

4 years agoComment the fact that DWARFDebugInfoEntry isn't copyable.
Adrian Prantl [Fri, 15 Nov 2019 17:14:30 +0000 (09:14 -0800)]
Comment the fact that DWARFDebugInfoEntry isn't copyable.

4 years ago[clang-format] Flexible line endings
Cameron Desrochers [Fri, 15 Nov 2019 16:48:06 +0000 (11:48 -0500)]
[clang-format] Flexible line endings

Line ending detection is now set with the `DeriveLineEnding` option.
CRLF can now be used as the default line ending by setting `UseCRLF`.
When line ending detection is disabled, all line endings are converted
according to the `UseCRLF` option.

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

4 years ago[MirNamer][Canonicalizer]: Perform instruction semantic based renaming
Aditya Nandakumar [Fri, 15 Nov 2019 16:23:32 +0000 (08:23 -0800)]
[MirNamer][Canonicalizer]: Perform instruction semantic based renaming

https://reviews.llvm.org/D70210

Previously:

Due to sensitivity of the algorithm with gaps, and extra instructions,
when diffing, often we see naming being off by a few. Makes the diff
unreadable even for tests with 7 and 8 instructions respectively.
Naming can change depending on candidates (and order of picking
candidates). Suddenly if there's one extra instruction somewhere, the
entire subtree would be named completely differently.
No consistent naming of similar instructions which occur in different
functions. If we try to do something like count the frequency
distribution of various differences across suite, then the above
sensitivity issues are going to result in poor results.
Instead:

Name instruction based on semantics of the instruction (hash of the
opcode and operands). Essentially for a given instruction that occurs in
any module/function it'll be named similarly (ie semantic). This has
some nice properties
Can easily look at many instructions and just check the hash and if
they're named similarly, then it's the same instruction. Makes it very
easy to spot the same instruction both multiple times, as well as across
many functions (useful for frequency distribution).
Independent of traversal/candidates/depth of graph. No need to keep
track of last index/gaps/skip count etc.
No off by few issues with diffs. I've tried the old vs new
implementation in files ranging from 30 to 700 instructions. In both
cases with the old algorithm, diffs are a sea of red, where as for the
semantic version, in both cases, the diffs line up beautifully.
Simplified implementation of the main loop (simple iteration) , no keep
track of what's visited and not.
Handle collision just by incrementing a counter. Roughly
bb[N]_hash_[CollisionCount].
Additionally with the new implementation, we can probably avoid doing
the hoisting of instructions to various places, as they'll likely be
named the same resulting in differences only based on collision (ie
regardless of whether the instruction is hoisted or not/close to use or
not, it'll be named the same hash which should result in use of the
instruction be identical with the only change being the collision count)
which is very easy to spot visually.

4 years ago[clangd] Fix typo in symbol kind conversion
Sam McCall [Fri, 15 Nov 2019 14:46:17 +0000 (15:46 +0100)]
[clangd] Fix typo in symbol kind conversion

Reviewers: hokein

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

Tags: #clang

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

4 years ago[scudo][standalone] Enabled SCUDO_DEBUG for tests + fixes
Kostya Kortchinsky [Thu, 14 Nov 2019 22:33:23 +0000 (14:33 -0800)]
[scudo][standalone] Enabled SCUDO_DEBUG for tests + fixes

Summary:
`SCUDO_DEBUG` was not enabled for unit tests, meaning the `DCHECK`s
were never tripped. While turning this on, I discovered that a few
of those not-exercised checks were actually wrong. This CL addresses
those incorrect checks.

Not that to work in tests `CHECK_IMPL` has to explicitely use the
`scudo` namespace. Also changes a C cast to a C++ cast.

Reviewers: hctim, pcc, cferris, eugenis, vitalybuka

Subscribers: mgorny, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

4 years ago[clangd] Don't consider class template params part of constructor name.
Sam McCall [Fri, 15 Nov 2019 14:08:16 +0000 (15:08 +0100)]
[clangd] Don't consider class template params part of constructor name.

Summary:
This is shorter and usually the extra info is noise.
There are cases where the params become type-parameter-0-0 that are hard to fix.

This affects a few features:
 - 'name' field in structured hover API (not exposed yet)
 - 'name' field in locateSymbolAt (not exposed in LSP)
 - 'document/symbol' - the symbol is hierarchically nested in the class
   template, or written as foo<t>::foo when defined out-of-line.

Added a test case for hover from https://github.com/clangd/clangd/issues/76.
This patch fixes one field, but no fewer than four others are wrong!
I'll fix them...

Reviewers: hokein

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

Tags: #clang

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

4 years ago[clangd] Fix SelectionTree behavior on constructor init-lists.
Sam McCall [Fri, 15 Nov 2019 15:07:34 +0000 (16:07 +0100)]
[clangd] Fix SelectionTree behavior on constructor init-lists.

Summary:
For the constructor Foo() : classmember(arg) {}

The AST looks like:
 - CXXCtorInitializer  classmember(arg)
   - CXXConstructExpr  classmember(arg)
     - DeclRefExpr:                arg

We want the 'classmember' to be associated with the CXXCtorInitializer, not the
CXXConstructExpr. (CXXConstructExpr is known to have bad ranges).
So just early-claim it.

Thanks @hokein for tracking down/reducing the bug.

Reviewers: hokein

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

Tags: #clang

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

4 years agoAdd read-only data assembly writing for aix
diggerlin [Fri, 15 Nov 2019 16:30:19 +0000 (11:30 -0500)]
Add read-only data assembly writing for aix

SUMMARY:
The patch will emit read-only variable assembly code for aix.

Reviewers: daltenty,Xiangling_Liao
Subscribers: rupprecht, seiyai,hiraditya

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

4 years ago[llvm-objcopy][NFC] Use generated object file in COFF/add-section.test
Sergey Dmitriev [Wed, 13 Nov 2019 04:19:17 +0000 (20:19 -0800)]
[llvm-objcopy][NFC] Use generated object file in COFF/add-section.test

Updated LIT test from D70205 to use generated object file with extended relocation table.

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

4 years ago[X86][SSE] Add test for extractelement from volatile vector load
Simon Pilgrim [Fri, 15 Nov 2019 15:59:33 +0000 (15:59 +0000)]
[X86][SSE] Add test for extractelement from volatile vector load

Mentioned in D70267

4 years agoImplement target(branch-protection) attribute for AArch64
Momchil Velikov [Fri, 15 Nov 2019 11:34:47 +0000 (11:34 +0000)]
Implement target(branch-protection) attribute for AArch64

This patch implements `__attribute__((target("branch-protection=...")))`
in a manner, compatible with the analogous GCC feature:

https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/AArch64-Function-Attributes.html#AArch64-Function-Attributes

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

4 years agoclang: enable unwind tables on FreeBSD !amd64
Ed Maste [Fri, 15 Nov 2019 14:30:24 +0000 (09:30 -0500)]
clang: enable unwind tables on FreeBSD !amd64

There doesn't seem to be much sense in defaulting "on" unwind tables on
amd64 and not on other arches. It causes surprising differences between
platforms, such as the PR below[1].

Prior to this change, FreeBSD inherited the default implementation of the
method from the Gnu.h Generic_Elf => Generic_GCC parent class, which
returned true only for amd64 targets.  Override that and opt on always,
similar to, e.g., NetBSD's driver.

[1] https://bugs.freebsd.org/241562

Patch by cem (Conrad Meyer).

Reviewed By: dim

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