platform/upstream/llvm.git
4 years ago[lldb] Add test for executing static initializers in expression command
Raphael Isemann [Mon, 21 Oct 2019 16:07:45 +0000 (16:07 +0000)]
[lldb] Add test for executing static initializers in expression command

llvm-svn: 375422

4 years agoFix Polly
Guillaume Chatelet [Mon, 21 Oct 2019 15:48:42 +0000 (15:48 +0000)]
Fix Polly

llvm-svn: 375421

4 years ago[NFC] Cleanup with variable name IsPPC64 & IsDarwin
Xiangling Liao [Mon, 21 Oct 2019 15:36:13 +0000 (15:36 +0000)]
[NFC] Cleanup with variable name IsPPC64 & IsDarwin

Clean up PPCAsmPrinter with IsPPC64 and IsDarwin.

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

llvm-svn: 375420

4 years ago[Alignment][NFC] Finish transition for `Loads`
Guillaume Chatelet [Mon, 21 Oct 2019 15:10:26 +0000 (15:10 +0000)]
[Alignment][NFC] Finish transition for `Loads`

Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

Subscribers: hiraditya, asbirlea, llvm-commits

Tags: #llvm

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

llvm-svn: 375419

4 years agoPre-commit test cases for D64713.
Jay Foad [Mon, 21 Oct 2019 15:01:59 +0000 (15:01 +0000)]
Pre-commit test cases for D64713.

llvm-svn: 375418

4 years ago[Types] Define a getWithNewBitWidth for Types and make use of it
David Green [Mon, 21 Oct 2019 14:51:49 +0000 (14:51 +0000)]
[Types] Define a getWithNewBitWidth for Types and make use of it

This is designed to change the bitwidth of a type without altering the number
of vector lanes. Also useful in D68651. Otherwise an NFC.

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

llvm-svn: 375417

4 years ago[Alignment][NFC] Instructions::getLoadStoreAlignment
Guillaume Chatelet [Mon, 21 Oct 2019 14:49:28 +0000 (14:49 +0000)]
[Alignment][NFC] Instructions::getLoadStoreAlignment

Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 375416

4 years ago[lldb] drop .symtab removal in minidebuginfo tests
Konrad Kleine [Mon, 21 Oct 2019 14:11:21 +0000 (14:11 +0000)]
[lldb] drop .symtab removal in minidebuginfo tests

Summary:
After D69041, we no longer have to manually remove the .symtab section
once yaml2obj was run.

Reviewers: espindola, alexshap

Subscribers: emaste, arichardson, MaskRay, lldb-commits

Tags: #lldb

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

llvm-svn: 375415

4 years ago[ARM] Extra qdadd patterns
David Green [Mon, 21 Oct 2019 14:06:49 +0000 (14:06 +0000)]
[ARM] Extra qdadd patterns

This adds some new qdadd patterns to go along with the other recently added
qadd's.

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

llvm-svn: 375414

4 years ago[Alignment][NFC] Add a helper function to DataLayout
Guillaume Chatelet [Mon, 21 Oct 2019 13:58:33 +0000 (13:58 +0000)]
[Alignment][NFC] Add a helper function to DataLayout

Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 375413

4 years ago[docs][llvm-ar] Update llvm-ar command guide
Owen Reynolds [Mon, 21 Oct 2019 13:13:31 +0000 (13:13 +0000)]
[docs][llvm-ar] Update llvm-ar command guide

The llvm-ar command guide had not been updated in some time, it was
missing current functionality and contained information that was out
of date. This change:
- Updates the use of reStructuredText directives, as seen in other tools
  command guides.
- Updates the command synopsis.
- Updates the descriptions of the tool behaviour.
- Updates the options section.
- Adds details of MRI script functionality.
- Removes the sections "Standards" and "File Format"

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

llvm-svn: 375412

4 years ago[ARM] Add qadd lowering from a sadd_sat
David Green [Mon, 21 Oct 2019 12:33:46 +0000 (12:33 +0000)]
[ARM] Add qadd lowering from a sadd_sat

This lowers a sadd_sat to a qadd by treating it as legal. Also adds qsub at the
same time.

The qadd instruction sets the q flag, but we already have many cases where we
do not model this in llvm.

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

llvm-svn: 375411

4 years ago[Alignment][NFC] TargetCallingConv::setByValAlign
Guillaume Chatelet [Mon, 21 Oct 2019 12:05:33 +0000 (12:05 +0000)]
[Alignment][NFC] TargetCallingConv::setByValAlign

Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 375410

4 years agoSimplify usage of setFPAttrs.
Jay Foad [Mon, 21 Oct 2019 11:32:41 +0000 (11:32 +0000)]
Simplify usage of setFPAttrs.

In some cases using the return value of setFPAttrs simplifies the code.
In other cases it complicates the code with ugly casts, so stop doing
it. NFC.

llvm-svn: 375409

4 years ago[llvm/Object] - Make ELFObjectFile::getRelocatedSection return Expected<section_iterator>
George Rimar [Mon, 21 Oct 2019 11:06:38 +0000 (11:06 +0000)]
[llvm/Object] - Make ELFObjectFile::getRelocatedSection return Expected<section_iterator>

It returns just a section_iterator currently and have a report_fatal_error call inside.
This change adds a way to return errors and handle them on caller sides.

The patch also changes/improves current users and adds test cases.

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

llvm-svn: 375408

4 years ago[Alignment][NFC] TargetCallingConv::setOrigAlign and TargetLowering::getABIAlignmentF...
Guillaume Chatelet [Mon, 21 Oct 2019 11:01:55 +0000 (11:01 +0000)]
[Alignment][NFC] TargetCallingConv::setOrigAlign and TargetLowering::getABIAlignmentForCallingConv

Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

Subscribers: sdardis, hiraditya, jrtc27, atanasyan, llvm-commits

Tags: #llvm

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

llvm-svn: 375407

4 years agoFix llvm signal tests build.
David Carlier [Mon, 21 Oct 2019 10:44:20 +0000 (10:44 +0000)]
Fix llvm signal tests build.

llvm-svn: 375406

4 years ago[obj2yaml] - Fix a comment. NFC.
George Rimar [Mon, 21 Oct 2019 10:40:43 +0000 (10:40 +0000)]
[obj2yaml] - Fix a comment. NFC.

I forgot to address this nit before committing..

llvm-svn: 375405

4 years ago[obj2yaml] - Stop triggering UB when dumping corrupted strings.
George Rimar [Mon, 21 Oct 2019 10:38:03 +0000 (10:38 +0000)]
[obj2yaml] - Stop triggering UB when dumping corrupted strings.

We have a following code to find quote type:

if (isspace(S.front()) || isspace(S.back()))
...

Problem is that:

"int isspace( int ch ): The behavior is undefined if the value of
ch is not representable as unsigned char and is not equal to EOF."
(https://en.cppreference.com/w/cpp/string/byte/isspace)

This patch shows how this UB can be triggered and fixes an issue.

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

llvm-svn: 375404

4 years ago[MemCpyOpt] Fixing Incorrect Code Motion while Handling Aggregate Type Values
Sam Elliott [Mon, 21 Oct 2019 10:00:34 +0000 (10:00 +0000)]
[MemCpyOpt] Fixing Incorrect Code Motion while Handling Aggregate Type Values

Summary:
When MemCpyOpt is handling aggregate type values, if an instruction (let's call it P) between the targeting load (L) and store (S) clobbers the source pointer of L, it will try to hoist S before P. This process will also hoist S's data dependency instructions.

However, the current implementation has a bug that if one of S's dependency instructions is //also// a user of P, MemCpyOpt will not prevent it from being hoisted above P and cause a use-before-define error. For example, in the newly added test file (i.e. `aggregate-type-crash.ll`), it will try to hoist both `store %my_struct %1, %my_struct* %3` and its dependent, `%3 = bitcast i8* %2 to %my_struct*`, above `%2 = call i8* @my_malloc(%my_struct* %0)`. Creating the following BB:
```
entry:
  %1 = bitcast i8* %4 to %my_struct*
  %2 = bitcast %my_struct* %1 to i8*
  %3 = bitcast %my_struct* %0 to i8*
  call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %2, i8* align 4 %3, i64 8, i1 false)
  %4 = call i8* @my_malloc(%my_struct* %0)
  ret void
```
Where there is a use-before-define error between `%1` and `%4`.

Update: The compiler for the Pony Programming Language [also encounter the same bug](https://github.com/ponylang/ponyc/issues/3140)

Patch by Min-Yih Hsu (myhsu)

Reviewers: eugenis, pcc, dblaikie, dneilson, t.p.northover, lattner

Reviewed By: eugenis

Subscribers: lenary, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 375403

4 years ago[ARM] Lower sadd_sat to qadd8 and qadd16
David Green [Mon, 21 Oct 2019 09:53:38 +0000 (09:53 +0000)]
[ARM] Lower sadd_sat to qadd8 and qadd16

Lower the target independent signed saturating intrinsics to qadd8 and qadd16.
This custom lowers them from a sadd_sat, catching the node early before it is
promoted. It also adds a QADD8b and QADD16b node to mean the bottom "lane" of a
qadd8/qadd16, so that we can call demand bits on it to show that it does not
use the upper bits.

Also handles QSUB8 and QSUB16.

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

llvm-svn: 375402

4 years ago[ARM] Add and adjust saturation tests for upcoming qadd changes. NFC
David Green [Mon, 21 Oct 2019 09:43:37 +0000 (09:43 +0000)]
[ARM] Add and adjust saturation tests for upcoming qadd changes. NFC

llvm-svn: 375401

4 years ago[LLD] [COFF] Fix use of uninitialized memory since SVN r375390
Martin Storsjo [Mon, 21 Oct 2019 09:35:34 +0000 (09:35 +0000)]
[LLD] [COFF] Fix use of uninitialized memory since SVN r375390

llvm-svn: 375400

4 years agoUse Align for TFL::TransientStackAlignment
Guillaume Chatelet [Mon, 21 Oct 2019 08:31:25 +0000 (08:31 +0000)]
Use Align for TFL::TransientStackAlignment

Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

Subscribers: arsenm, dschuff, jyknight, sdardis, jvesely, nhaehnle, sbc100, jgravelle-google, hiraditya, aheejin, fedor.sergeev, jrtc27, atanasyan, llvm-commits

Tags: #llvm

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

llvm-svn: 375398

4 years ago[NFC][InstCombine] Fixup comments
Roman Lebedev [Mon, 21 Oct 2019 08:21:54 +0000 (08:21 +0000)]
[NFC][InstCombine] Fixup comments

As noted in post-commit review of rL375378375378.

llvm-svn: 375397

4 years ago[CVP] Deduce no-wrap on `mul`
Roman Lebedev [Mon, 21 Oct 2019 08:21:44 +0000 (08:21 +0000)]
[CVP] Deduce no-wrap on `mul`

Summary:
`ConstantRange::makeGuaranteedNoWrapRegion()` knows how to deal with `mul`
since rL335646, there is exhaustive test coverage.
This is already used by CVP's `processOverflowIntrinsic()`,
and by SCEV's `StrengthenNoWrapFlags()`

That being said, currently, this doesn't help much in the end:
| statistic                              |     old |     new | delta | percentage |
| correlated-value-propagation.NumMulNSW |       4 |     275 |   271 |   6775.00% |
| correlated-value-propagation.NumMulNUW |       4 |    1323 |  1319 |  32975.00% |
| correlated-value-propagation.NumMulNW  |       8 |    1598 |  1590 |  19875.00% |
| correlated-value-propagation.NumNSW    |    5715 |    5986 |   271 |      4.74% |
| correlated-value-propagation.NumNUW    |    9193 |   10512 |  1319 |     14.35% |
| correlated-value-propagation.NumNW     |   14908 |   16498 |  1590 |     10.67% |
| instcount.NumAddInst                   |  275871 |  275869 |    -2 |      0.00% |
| instcount.NumBrInst                    |  708234 |  708232 |    -2 |      0.00% |
| instcount.NumMulInst                   |   43812 |   43810 |    -2 |      0.00% |
| instcount.NumPHIInst                   |  316786 |  316784 |    -2 |      0.00% |
| instcount.NumTruncInst                 |   62165 |   62167 |     2 |      0.00% |
| instcount.NumUDivInst                  |    2528 |    2526 |    -2 |     -0.08% |
| instcount.TotalBlocks                  |  842995 |  842993 |    -2 |      0.00% |
| instcount.TotalInsts                   | 7376486 | 7376478 |    -8 |      0.00% |
(^ test-suite plain, tests still pass)

Reviewers: nikic, reames, luqmana, sanjoy, timshen

Reviewed By: reames

Subscribers: hiraditya, javed.absar, llvm-commits

Tags: #llvm

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

llvm-svn: 375396

4 years ago[InstCombine] Allow values with multiple users in SimplifyDemandedVectorElts
Piotr Sobczak [Mon, 21 Oct 2019 08:12:47 +0000 (08:12 +0000)]
[InstCombine] Allow values with multiple users in SimplifyDemandedVectorElts

Summary:
Allow for ignoring the check for a single use in SimplifyDemandedVectorElts
to be able to simplify operands if DemandedElts is known to contain
the union of elements used by all users.
It is a responsibility of a caller of SimplifyDemandedVectorElts to
supply correct DemandedElts.

Simplify a series of extractelement instructions if only a subset of
elements is used.

Reviewers: reames, arsenm, majnemer, nhaehnle

Reviewed By: nhaehnle

Subscribers: wdng, jvesely, nhaehnle, llvm-commits

Tags: #llvm

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

llvm-svn: 375395

4 years agogn build: Merge r375390
GN Sync Bot [Mon, 21 Oct 2019 08:06:38 +0000 (08:06 +0000)]
gn build: Merge r375390

llvm-svn: 375393

4 years ago[LLDB] [Windows] Initial support for ARM register contexts
Martin Storsjo [Mon, 21 Oct 2019 08:02:34 +0000 (08:02 +0000)]
[LLDB] [Windows] Initial support for ARM register contexts

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

llvm-svn: 375392

4 years ago[LLD] [COFF] Use the local dwarf code instead of Symbolizer for resolving code locati...
Martin Storsjo [Mon, 21 Oct 2019 08:01:59 +0000 (08:01 +0000)]
[LLD] [COFF] Use the local dwarf code instead of Symbolizer for resolving code locations. NFC.

As we now have code that parses the dwarf info for variable locations,
we can use that instead of relying on the higher level Symbolizer library,
reducing the previous two different dwarf codepaths into one.

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

llvm-svn: 375391

4 years ago[LLD] Move duplicated dwarf parsing code to the Common library. NFC.
Martin Storsjo [Mon, 21 Oct 2019 08:01:52 +0000 (08:01 +0000)]
[LLD] Move duplicated dwarf parsing code to the Common library. NFC.

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

llvm-svn: 375390

4 years ago[IR] Fix mayReadFromMemory() for writeonly calls
Yevgeny Rouban [Mon, 21 Oct 2019 06:52:08 +0000 (06:52 +0000)]
[IR] Fix mayReadFromMemory() for writeonly calls

Current implementation of Instruction::mayReadFromMemory()
returns !doesNotAccessMemory() which is !ReadNone. This
does not take into account that the writeonly attribute
also indicates that the call does not read from memory.

The patch changes the predicate to !doesNotReadMemory()
that reflects the intended behavior.

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

llvm-svn: 375389

4 years ago[BPF] fix indirect call assembly code
Yonghong Song [Mon, 21 Oct 2019 03:22:03 +0000 (03:22 +0000)]
[BPF] fix indirect call assembly code

Currently, for indirect call, the assembly code printed out as
  callx <imm>
This is not right, it should be
  callx <reg>

Fixed the issue with proper format.

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

llvm-svn: 375386

4 years ago[Attributor][FIX] Silence sign-compare warning
Johannes Doerfert [Mon, 21 Oct 2019 01:29:10 +0000 (01:29 +0000)]
[Attributor][FIX] Silence sign-compare warning

llvm-svn: 375384

4 years ago[Attributor] Teach AANoCapture to use information in-flight more aggressively
Johannes Doerfert [Mon, 21 Oct 2019 00:48:42 +0000 (00:48 +0000)]
[Attributor] Teach AANoCapture to use information in-flight more aggressively

AAReturnedValues, AAMemoryBehavior, and AANoUnwind, can provide
information that helps during the tracking or even justifies no-capture.
We now use this information and enable no-capture in some test cases
designed a long while a ago for these cases.

llvm-svn: 375382

4 years ago[X86] Check Subtarget.hasSSE3() before calling shouldUseHorizontalOp and emitting...
Craig Topper [Sun, 20 Oct 2019 23:54:19 +0000 (23:54 +0000)]
[X86] Check Subtarget.hasSSE3() before calling shouldUseHorizontalOp and emitting X86ISD::FHADD in LowerUINT_TO_FP_i64.

This was a regression from r375341.

Fixes PR43729.

llvm-svn: 375381

4 years ago[IndVars] Add a todo to reflect a further oppurtunity identified in D69009
Philip Reames [Sun, 20 Oct 2019 23:44:01 +0000 (23:44 +0000)]
[IndVars] Add a todo to reflect a further oppurtunity identified in D69009

Nikita pointed out an oppurtunity, might as well document it in the code.

llvm-svn: 375380

4 years ago[IndVars] Eliminate loop exits with equivalent exit counts
Philip Reames [Sun, 20 Oct 2019 23:38:02 +0000 (23:38 +0000)]
[IndVars] Eliminate loop exits with equivalent exit counts

We can end up with two loop exits whose exit counts are equivalent, but whose textual representation is different and non-obvious. For the sub-case where we have a series of exits which dominate one another (common), eliminate any exits which would iterate *after* a previous exit on the exiting iteration.

As noted in the TODO being removed, I'd always thought this was a good idea, but I've now seen this in a real workload as well.

Interestingly, in review, Nikita pointed out there's let another oppurtunity to leverage SCEV's reasoning.  If we kept track of the min of dominanting exits so far, we could discharge exits with EC >= MDE.  This is less powerful than the existing transform (since later exits aren't considered), but potentially more powerful for any case where SCEV can prove a >= b, but neither a == b or a > b.  I don't have an example to illustrate that oppurtunity, but won't be suprised if we find one and return to handle that case as well.

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

llvm-svn: 375379

4 years ago[InstCombine] conditional sign-extend of high-bit-extract: 'or' pattern.
Roman Lebedev [Sun, 20 Oct 2019 20:52:06 +0000 (20:52 +0000)]
[InstCombine] conditional sign-extend of high-bit-extract: 'or' pattern.

In this pattern, all the "magic" bits that we'd `add` are all
high sign bits, and in the value we'd be adding to they are all unset,
not unexpectedly, so we can have an `or` there:
https://rise4fun.com/Alive/ups

It is possible that `haveNoCommonBitsSet()` should be taught about this
pattern so that we never have an `add` variant, but the reasoning would
need to be recursive (because of that `select`), so i'm not really sure
that would be worth it just yet.

llvm-svn: 375378

4 years ago[NFC][InstCombine] conditional sign-extend of high-bit-extract: 'and' pat. can be...
Roman Lebedev [Sun, 20 Oct 2019 20:51:37 +0000 (20:51 +0000)]
[NFC][InstCombine] conditional sign-extend of high-bit-extract: 'and' pat. can be 'or' pattern.

In this pattern, all the "magic" bits that we'd add are all
high sign bits, and in the value we'd be adding to they are all unset,
not unexpectedly, so we can have an `or` there:
https://rise4fun.com/Alive/ups

llvm-svn: 375377

4 years agogn build: Merge r375375
GN Sync Bot [Sun, 20 Oct 2019 20:44:56 +0000 (20:44 +0000)]
gn build: Merge r375375

llvm-svn: 375376

4 years agoReverted r375254 as it has broken some build bots for a long time.
Vladimir Vereschaka [Sun, 20 Oct 2019 20:39:33 +0000 (20:39 +0000)]
Reverted r375254 as it has broken some build bots for a long time.

llvm-svn: 375375

4 years ago[InstCombine] Fold uadd.sat(a, b) == 0 and usub.sat(a, b) == 0
Nikita Popov [Sun, 20 Oct 2019 20:19:42 +0000 (20:19 +0000)]
[InstCombine] Fold uadd.sat(a, b) == 0 and usub.sat(a, b) == 0

This adds folds for comparing uadd.sat/usub.sat with zero:

 * uadd.sat(a, b) == 0 => a == 0 && b == 0 => (a | b) == 0
 * usub.sat(a, b) == 0 => a <= b

And inverted forms for !=.

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

llvm-svn: 375374

4 years agoFix buildbot error in SIRegisterInfo.cpp.
Zinovy Nis [Sun, 20 Oct 2019 20:01:16 +0000 (20:01 +0000)]
Fix buildbot error in SIRegisterInfo.cpp.

llvm-svn: 375373

4 years ago[InstCombine] Add tests for uadd/sub.sat(a, b) == 0; NFC
Nikita Popov [Sun, 20 Oct 2019 19:50:31 +0000 (19:50 +0000)]
[InstCombine] Add tests for uadd/sub.sat(a, b) == 0; NFC

llvm-svn: 375372

4 years ago[InstCombine] Shift amount reassociation in shifty sign bit test (PR43595)
Roman Lebedev [Sun, 20 Oct 2019 19:38:50 +0000 (19:38 +0000)]
[InstCombine] Shift amount reassociation in shifty sign bit test (PR43595)

Summary:
This problem consists of several parts:
* Basic sign bit extraction - `trunc? (?shr %x, (bitwidth(x)-1))`.
  This is trivial, and easy to do, we have a fold for it.
* Shift amount reassociation - if we have two identical shifts,
  and we can simplify-add their shift amounts together,
  then we likely can just perform them as a single shift.
  But this is finicky, has one-use restrictions,
  and shift opcodes must be identical.

But there is a super-pattern where both of these work together.
to produce sign bit test from two shifts + comparison.
We do indeed already handle this in most cases.
But since we get that fold transitively, it has one-use restrictions.
And what's worse, in this case the right-shifts aren't required to be
identical, and we can't handle that transitively:

If the total shift amount is bitwidth-1, only a sign bit will remain
in the output value. But if we look at this from the perspective of
two shifts, we can't fold - we can't possibly know what bit pattern
we'd produce via two shifts, it will be *some* kind of a mask
produced from original sign bit, but we just can't tell it's shape:
https://rise4fun.com/Alive/cM0 https://rise4fun.com/Alive/9IN

But it will *only* contain sign bit and zeros.
So from the perspective of sign bit test, we're good:
https://rise4fun.com/Alive/FRz https://rise4fun.com/Alive/qBU
Superb!

So the simplest solution is to extend `reassociateShiftAmtsOfTwoSameDirectionShifts()` to also have a
sudo-analysis mode that will ignore extra-uses, and will only check
whether a) those are two right shifts and b) they end up with bitwidth(x)-1
shift amount and return either the original value that we sign-checking,
or null.

This does not have any functionality change for
the existing `reassociateShiftAmtsOfTwoSameDirectionShifts()`.

All that being said, as disscussed in the review, this yet again
increases usage of instsimplify in instcombine as utility.
Some day that may need to be reevaluated.

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

Reviewers: spatel, efriedma, vsk

Reviewed By: spatel

Subscribers: xbolva00, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 375371

4 years ago[ConstantRange] makeGuaranteedNoWrapRegion(): `shl` support
Roman Lebedev [Sun, 20 Oct 2019 19:36:55 +0000 (19:36 +0000)]
[ConstantRange] makeGuaranteedNoWrapRegion(): `shl` support

Summary:
If all the shifts amount are already poison-producing,
then we can add more poison-producing flags ontop:
https://rise4fun.com/Alive/Ocwi

Otherwise, we should only consider the possible range of shift amts that don't result in poison.

For unsigned range not not overflow, we must not shift out any set bits,
and the actual limit for `x` can be computed by backtransforming
the maximal value we could ever get out of the `shl` - `-1` through
`lshr`. If the `x` is any larger than that then it will overflow.

Likewise for signed range, but just in signed domain..

This is based on the general idea outlined by @nikic in https://reviews.llvm.org/D68672#1714990

Reviewers: nikic, sanjoy

Reviewed By: nikic

Subscribers: hiraditya, llvm-commits, nikic

Tags: #llvm

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

llvm-svn: 375370

4 years ago[ConstantRange] Optimize nowrap region test, remove redundant tests; NFC
Nikita Popov [Sun, 20 Oct 2019 18:59:14 +0000 (18:59 +0000)]
[ConstantRange] Optimize nowrap region test, remove redundant tests; NFC

Enumerate one less constant range in TestNoWrapRegionExhaustive,
which was unnecessary. This allows us to bump the bit count from
3 to 5 while keeping reasonable timing.

Drop four tests for multiply nowrap regions, as these cover subsets
of the exhaustive test. They do use a wider bitwidth, but I don't
think it's worthwhile to have them additionally now.

llvm-svn: 375369

4 years agoAMDGPU: Increase vcc liveness scan threshold
Matt Arsenault [Sun, 20 Oct 2019 17:44:17 +0000 (17:44 +0000)]
AMDGPU: Increase vcc liveness scan threshold

Avoids a test regression in a future patch. Also add debug printing on
this case, so I waste less time debugging folds in the future.

llvm-svn: 375367

4 years agoAMDGPU: Split flat offsets that don't fit in DAG
Matt Arsenault [Sun, 20 Oct 2019 17:34:44 +0000 (17:34 +0000)]
AMDGPU: Split flat offsets that don't fit in DAG

We handle it this way for some other address spaces.

Since r349196, SILoadStoreOptimizer has been trying to do this. This
is after SIFoldOperands runs, which can change the addressing
patterns. It's simpler to just split this earlier.

llvm-svn: 375366

4 years agoAMDGPU: Fix missing OPERAND_IMMEDIATE
Matt Arsenault [Sun, 20 Oct 2019 16:56:10 +0000 (16:56 +0000)]
AMDGPU: Fix missing OPERAND_IMMEDIATE

llvm-svn: 375365

4 years agoAMDGPU: Add baseline tests for flat offset splitting
Matt Arsenault [Sun, 20 Oct 2019 16:33:21 +0000 (16:33 +0000)]
AMDGPU: Add baseline tests for flat offset splitting

llvm-svn: 375364

4 years agoAMDGPU: Don't re-get the subtarget
Matt Arsenault [Sun, 20 Oct 2019 16:26:26 +0000 (16:26 +0000)]
AMDGPU: Don't re-get the subtarget

It's already available in the class.

llvm-svn: 375363

4 years ago[AMDGPU] Fix assertion due to initializer list
Yaxun Liu [Sun, 20 Oct 2019 15:02:22 +0000 (15:02 +0000)]
[AMDGPU] Fix assertion due to initializer list

Sometimes a global var is replaced by a different llvm value. clang use GetAddrOfGlobalVar to get the original llvm global variable.
For most targets, GetAddrOfGlobalVar returns either the llvm global variable or a bitcast of the llvm global variable.
However, for AMDGPU target, GetAddrOfGlobalVar returns the addrspace cast or addrspace cast plus bitcast of the llvm global variable.
To get the llvm global variable, these casts need to be stripped, otherwise there is assertion.

This patch fixes that.

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

llvm-svn: 375362

4 years ago[yaml2obj][obj2yaml] - Do not create a symbol table by default.
George Rimar [Sun, 20 Oct 2019 14:47:17 +0000 (14:47 +0000)]
[yaml2obj][obj2yaml] - Do not create a symbol table by default.

This patch tries to resolve problems faced in D68943
and uses some of the code written by Konrad Wilhelm Kleine
in that patch.

Previously, yaml2obj tool always created a .symtab section.
This patch changes that. With it we only create it when
have a "Symbols:" tag in the YAML document or when
we need to create it because it is used by another section(s).

obj2yaml follows the new behavior and does not print "Symbols:"
anymore when there is no symbol table.

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

llvm-svn: 375361

4 years ago[LLD][ELF] - Update tests after yaml2obj tool update.
George Rimar [Sun, 20 Oct 2019 14:47:09 +0000 (14:47 +0000)]
[LLD][ELF] - Update tests after yaml2obj tool update.

yaml2obj doesn't create .symtab by default anymore.

llvm-svn: 375360

4 years agoFix minor warning in DWARFVerifier.
Zinovy Nis [Sun, 20 Oct 2019 07:55:50 +0000 (07:55 +0000)]
Fix minor warning in DWARFVerifier.

llvm-svn: 375357

4 years agoAMDGPU: Don't error on calls to null or undef
Matt Arsenault [Sun, 20 Oct 2019 07:46:04 +0000 (07:46 +0000)]
AMDGPU: Don't error on calls to null or undef

Calls to constants should probably be generally handled.

llvm-svn: 375356

4 years agoeliminate nontrivial Reset(...) from TypedPythonObject
Lawrence D'Anna [Sat, 19 Oct 2019 18:43:49 +0000 (18:43 +0000)]
eliminate nontrivial Reset(...) from TypedPythonObject

Summary:
This deletes `Reset(...)`, except for the no-argument form `Reset()`
from `TypedPythonObject`, and therefore from `PythonString`, `PythonList`,
etc.

It updates the various callers to use assignment, `As<>`, `Take<>`,
and `Retain<>`, as appropriate.

followon to https://reviews.llvm.org/D69080

Reviewers: JDevlieghere, clayborg, labath, jingham

Reviewed By: labath

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 375350

4 years ago[SCEV] Simplify umin/max of zext and sext of the same value
Philip Reames [Sat, 19 Oct 2019 17:23:02 +0000 (17:23 +0000)]
[SCEV] Simplify umin/max of zext and sext of the same value

This is a common idiom which arises after induction variables are widened, and we have two or more exit conditions.  Interestingly, we don't have instcombine or instsimplify support for this either.

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

llvm-svn: 375349

4 years ago[X86] Pulled out helper to decode target shuffle element sentinel values to 'Zeroable...
Simon Pilgrim [Sat, 19 Oct 2019 16:58:24 +0000 (16:58 +0000)]
[X86] Pulled out helper to decode target shuffle element sentinel values to 'Zeroable' known undef/zero bits. NFCI.

Renamed 'resolveTargetShuffleAndZeroables' to 'resolveTargetShuffleFromZeroables' to match.

llvm-svn: 375348

4 years ago[TargetLowering][DAGCombine][MSP430] add/use hook for Shift Amount Threshold (1/2)
Sanjay Patel [Sat, 19 Oct 2019 16:57:02 +0000 (16:57 +0000)]
[TargetLowering][DAGCombine][MSP430] add/use hook for Shift Amount Threshold (1/2)

Provides a TLI hook to allow targets to relax the emission of shifts, thus enabling
codegen improvements on targets with no multiple shift instructions and cheap selects
or branches.

Contributes to a Fix for PR43559:
https://bugs.llvm.org/show_bug.cgi?id=43559

Patch by: @joanlluch (Joan LLuch)

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

llvm-svn: 375347

4 years ago[ARM] Add dependency on GlobalISel for unit tests to fix shared libs build
Nemanja Ivanovic [Sat, 19 Oct 2019 16:40:26 +0000 (16:40 +0000)]
[ARM] Add dependency on GlobalISel for unit tests to fix shared libs build

The unit test uses GlobalISel but the dependency is not listed in the
CMakeLists.txt file which causes failures in shared libs build with GCC.

This just adds the dependency.

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

llvm-svn: 375346

4 years ago[MSP430] Shift Amount Threshold in DAGCombine (Baseline Tests); NFC
Sanjay Patel [Sat, 19 Oct 2019 16:29:32 +0000 (16:29 +0000)]
[MSP430] Shift Amount Threshold in DAGCombine (Baseline Tests); NFC

Patch by: @joanlluch (Joan LLuch)

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

llvm-svn: 375345

4 years ago[X86][SSE] lowerV16I8Shuffle - tryToWidenViaDuplication - undef unpack args
Simon Pilgrim [Sat, 19 Oct 2019 13:18:02 +0000 (13:18 +0000)]
[X86][SSE] lowerV16I8Shuffle - tryToWidenViaDuplication - undef unpack args

tryToWidenViaDuplication lowers using the shuffle_v8i16(unpack_v16i8(shuffle_v8i16(x),shuffle_v8i16(x))) pattern, but the unpack only needs the even/odd 16i8 args if the original v16i8 shuffle mask references the even/odd elements - which isn't true for many extension style shuffles.

llvm-svn: 375342

4 years ago[X86][SSE] LowerUINT_TO_FP_i64 - only use HADDPD for size/fast-hops
Simon Pilgrim [Sat, 19 Oct 2019 11:53:48 +0000 (11:53 +0000)]
[X86][SSE] LowerUINT_TO_FP_i64 - only use HADDPD for size/fast-hops

We were always generating a single source HADDPD, but really we should only do this if shouldUseHorizontalOp says its a good idea.

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

llvm-svn: 375341

4 years agoRefine check for `_LIBCPP_C_HAS_NO_GETS` on FreeBSD
Dimitry Andric [Sat, 19 Oct 2019 10:59:23 +0000 (10:59 +0000)]
Refine check for `_LIBCPP_C_HAS_NO_GETS` on FreeBSD

Summary:
In D67316 we added `_LIBCPP_C_HAS_NO_GETS` to signal that the C library
does not provide `gets()`, and added a test for FreeBSD 13 or higher,
using the compiler-defined `__FreeBSD__` macro.

Unfortunately this did not work that well for FreeBSD's own CI process,
since the gcc compilers used for some architectures define `__FreeBSD__`
to match the build host, not the target.

Instead, we should use the `__FreeBSD_version` macro from the userland
header `<osreldate.h>`, which is more fine-grained.  See also
<https://reviews.freebsd.org/D22034>.

Reviewers: EricWF, mclow.lists, emaste, ldionne

Reviewed By: emaste, ldionne

Subscribers: dexonsmith, bsdjhb, krytarowski, christof, ldionne, libcxx-commits

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

llvm-svn: 375340

4 years agoExplicit in the doc the current list of projects (with easy copy and paste)
Sylvestre Ledru [Sat, 19 Oct 2019 09:55:24 +0000 (09:55 +0000)]
Explicit in the doc the current list of projects (with easy copy and paste)

llvm-svn: 375339

4 years agoRevert "[Implicit Modules] Add -cc1 option -fmodules-strict-context-hash which includ...
Michael J. Spencer [Sat, 19 Oct 2019 09:45:28 +0000 (09:45 +0000)]
Revert "[Implicit Modules] Add -cc1 option -fmodules-strict-context-hash which includes search paths and diagnostics." and "[Docs] Fix header level."

The test doesn't work on Windows. I'll fix it and recommit later.

llvm-svn: 375338

4 years agoMake it clear in the doc that 'all' in LLVM_ENABLE_PROJECTS does install ALL projects
Sylvestre Ledru [Sat, 19 Oct 2019 09:27:14 +0000 (09:27 +0000)]
Make it clear in the doc that 'all' in LLVM_ENABLE_PROJECTS does install ALL projects

llvm-svn: 375337

4 years agoconvert LLDBSwigPythonCallTypeScript to ArgInfo::max_positional_args
Lawrence D'Anna [Sat, 19 Oct 2019 07:05:39 +0000 (07:05 +0000)]
convert LLDBSwigPythonCallTypeScript to ArgInfo::max_positional_args

Summary:
This patch converts another user of ArgInfo::count over to
use ArgInfo::max_positional_args instead.   I also add a test
to make sure both documented signatures for python type formatters
work.

Reviewers: JDevlieghere, clayborg, labath, jingham

Reviewed By: labath

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 375334

4 years ago[LLDB] bugfix: command script add -f doesn't work for some callables
Lawrence D'Anna [Sat, 19 Oct 2019 07:05:33 +0000 (07:05 +0000)]
[LLDB] bugfix: command script add -f doesn't work for some callables

Summary:
When users define a debugger command from python, they provide a callable
object.   Because the signature of the function has been extended, LLDB
needs to inspect the number of parameters the callable can take.

The rule it was using to decide was weird, apparently not tested, and
giving wrong results for some kinds of python callables.

This patch replaces the weird rule with a simple one: if the callable can
take 5 arguments, it gets the 5 argument version of the signature.
Otherwise it gets the old 4 argument version.

It also adds tests with a bunch of different kinds of python callables
with both 4 and 5 arguments.

Reviewers: JDevlieghere, clayborg, labath, jingham

Reviewed By: labath

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 375333

4 years ago[analyzer] PR43551: Do not dereferce void* in UndefOrNullArgVisitor.
Artem Dergachev [Sat, 19 Oct 2019 01:50:46 +0000 (01:50 +0000)]
[analyzer] PR43551: Do not dereferce void* in UndefOrNullArgVisitor.

Patch by Kristóf Umann!

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

llvm-svn: 375329

4 years ago[analyzer] Fix a crash on tracking Objective-C 'self' as a control dependency.
Artem Dergachev [Sat, 19 Oct 2019 01:50:43 +0000 (01:50 +0000)]
[analyzer] Fix a crash on tracking Objective-C 'self' as a control dependency.

'self' was previously never tracked, but now it can be tracked
because it may be part of a condition.

llvm-svn: 375328

4 years ago[Docs] Fix header level.
Michael J. Spencer [Sat, 19 Oct 2019 01:48:57 +0000 (01:48 +0000)]
[Docs] Fix header level.

llvm-svn: 375327

4 years agoAdd -Wbitwise-conditional-parentheses to warn on mixing '|' and '&' with "?:"
Richard Trieu [Sat, 19 Oct 2019 01:47:49 +0000 (01:47 +0000)]
Add -Wbitwise-conditional-parentheses to warn on mixing '|' and '&' with "?:"

Extend -Wparentheses to cover mixing bitwise-and and bitwise-or with the
conditional operator. There's two main cases seen with this:

unsigned bits1 = 0xf0 | cond ? 0x4 : 0x1;
unsigned bits2 = cond1 ? 0xf0 : 0x10 | cond2 ? 0x5 : 0x2;

// Intended order of evaluation:
unsigned bits1 = 0xf0 | (cond ? 0x4 : 0x1);
unsigned bits2 = (cond1 ? 0xf0 : 0x10) | (cond2 ? 0x5 : 0x2);

// Actual order of evaluation:
unsigned bits1 = (0xf0 | cond) ? 0x4 : 0x1;
unsigned bits2 = cond1 ? 0xf0 : ((0x10 | cond2) ? 0x5 : 0x2);

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

llvm-svn: 375326

4 years agoAvoid including CodeView/SymbolRecord.h from MCStreamer.h
Reid Kleckner [Sat, 19 Oct 2019 01:44:09 +0000 (01:44 +0000)]
Avoid including CodeView/SymbolRecord.h from MCStreamer.h

Move the types needed out so they can be forward declared instead.

llvm-svn: 375325

4 years ago[Implicit Modules] Add -cc1 option -fmodules-strict-context-hash which includes searc...
Michael J. Spencer [Sat, 19 Oct 2019 01:36:37 +0000 (01:36 +0000)]
[Implicit Modules] Add -cc1 option -fmodules-strict-context-hash which includes search paths and diagnostics.

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

llvm-svn: 375322

4 years agoAMDGPU: Remove optnone from a test
Matt Arsenault [Sat, 19 Oct 2019 01:34:59 +0000 (01:34 +0000)]
AMDGPU: Remove optnone from a test

It's not clear why the test had this. I'm unable to break the original
case with the original patch reverted with or without optnone.

This avoids a failure in a future commit.

llvm-svn: 375321

4 years agoPrune a LegacyDivergenceAnalysis and MachineLoopInfo include each
Reid Kleckner [Sat, 19 Oct 2019 01:31:09 +0000 (01:31 +0000)]
Prune a LegacyDivergenceAnalysis and MachineLoopInfo include each

Now X86ISelLowering doesn't depend on many IR analyses.

llvm-svn: 375320

4 years agoPrune Analysis includes from SelectionDAG.h
Reid Kleckner [Sat, 19 Oct 2019 01:07:48 +0000 (01:07 +0000)]
Prune Analysis includes from SelectionDAG.h

Only forward declarations are needed here. Follow-on to r375311.

llvm-svn: 375319

4 years agoNew tautological warning for bitwise-or with non-zero constant always true.
Richard Trieu [Sat, 19 Oct 2019 00:57:23 +0000 (00:57 +0000)]
New tautological warning for bitwise-or with non-zero constant always true.

Taking a value and the bitwise-or it with a non-zero constant will always
result in a non-zero value. In a boolean context, this is always true.

if (x | 0x4) {}  // always true, intended '&'

This patch creates a new warning group -Wtautological-bitwise-compare for this
warning. It also moves in the existing tautological bitwise comparisons into
this group. A few other changes were needed to the CFGBuilder so that all bool
contexts would be checked. The warnings in -Wtautological-bitwise-compare will
be off by default due to using the CFG.

Fixes: https://bugs.llvm.org/show_bug.cgi?id=42666
Differential Revision: https://reviews.llvm.org/D66046

llvm-svn: 375318

4 years ago[profile] Use -fPIC -shared in a test instead of -dynamiclib
Vedant Kumar [Sat, 19 Oct 2019 00:51:27 +0000 (00:51 +0000)]
[profile] Use -fPIC -shared in a test instead of -dynamiclib

This is more portable than -dynamiclib. Also, fix the path to an input
file that broke when the test was moved in r375315.

llvm-svn: 375317

4 years agoMove endian constant from Host.h to SwapByteOrder.h, prune include
Reid Kleckner [Sat, 19 Oct 2019 00:48:11 +0000 (00:48 +0000)]
Move endian constant from Host.h to SwapByteOrder.h, prune include

Works on this dependency chain:
  ArrayRef.h ->
  Hashing.h -> --CUT--
  Host.h ->
  StringMap.h / StringRef.h

ArrayRef is very popular, but Host.h is rarely needed. Move the
IsBigEndianHost constant to SwapByteOrder.h. Clients of that header are
more likely to need it.

llvm-svn: 375316

4 years ago[profile] Disable instrprof-get-filename-merge-mode.c on Windows
Vedant Kumar [Sat, 19 Oct 2019 00:46:53 +0000 (00:46 +0000)]
[profile] Disable instrprof-get-filename-merge-mode.c on Windows

The Windows bots are failing with:

clang: warning: argument unused during compilation: '-dynamiclib' [-Wunused-command-line-argument]
llvm-svn: 375315

4 years agoSema: Create a no-op implicit cast for lvalue function conversions.
Peter Collingbourne [Sat, 19 Oct 2019 00:34:54 +0000 (00:34 +0000)]
Sema: Create a no-op implicit cast for lvalue function conversions.

This fixes an assertion failure in the case where an implicit conversion for a
function call involves an lvalue function conversion, and makes the AST for
initializations involving implicit lvalue function conversions more accurate.

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

llvm-svn: 375313

4 years agoSkip (more) PExpect tests under ASAN, I can't get them to work reliably.
Adrian Prantl [Sat, 19 Oct 2019 00:30:30 +0000 (00:30 +0000)]
Skip (more) PExpect tests under ASAN, I can't get them to work reliably.

llvm-svn: 375312

4 years agoPrune two MachineInstr.h includes, fix up deps
Reid Kleckner [Sat, 19 Oct 2019 00:22:07 +0000 (00:22 +0000)]
Prune two MachineInstr.h includes, fix up deps

MachineInstr.h included AliasAnalysis.h, which includes a world of IR
constructs mostly unneeded in CodeGen. Prune it. Same for
DebugInfoMetadata.h.

Noticed with -ftime-trace.

llvm-svn: 375311

4 years ago[clang][driver] Print compilation phases with indentation.
Michael Liao [Sat, 19 Oct 2019 00:17:00 +0000 (00:17 +0000)]
[clang][driver] Print compilation phases with indentation.

Reviewers: tra, sfantao, echristo

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 375310

4 years ago[hip][cuda] Fix the extended lambda name mangling issue.
Michael Liao [Sat, 19 Oct 2019 00:15:19 +0000 (00:15 +0000)]
[hip][cuda] Fix the extended lambda name mangling issue.

Summary:
- HIP/CUDA host side needs to use device kernel symbol name to match the
  device side binaries. Without a consistent naming between host- and
  device-side compilations, it's risky that wrong device binaries are
  executed. Consistent naming is usually not an issue until unnamed
  types are used, especially the lambda. In this patch, the consistent
  name mangling is addressed for the extended lambdas, i.e. the lambdas
  annotated with `__device__`.
- In [Itanium C++ ABI][1], the mangling of the lambda is generally
  unspecified unless, in certain cases, ODR rule is required to ensure
  consisent naming cross TUs. The extended lambda is such a case as its
  name may be part of a device kernel function, e.g., the extended
  lambda is used as a template argument and etc. Thus, we need to force
  ODR for extended lambdas as they are referenced in both device- and
  host-side TUs. Furthermore, if a extended lambda is nested in other
  (extended or not) lambdas, those lambdas are required to follow ODR
  naming as well. This patch revises the current lambda mangle numbering
  to force ODR from an extended lambda to all its parent lambdas.
- On the other side, the aforementioned ODR naming should not change
  those lambdas' original linkages, i.e., we cannot replace the original
  `internal` with `linkonce_odr`; otherwise, we may violate ODR in
  general. This patch introduces a new field `HasKnownInternalLinkage`
  in lambda data to decouple the current linkage calculation based on
  mangling number assigned.

[1]: https://itanium-cxx-abi.github.io/cxx-abi/abi.html

Reviewers: tra, rsmith, yaxunl, martong, shafik

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 375309

4 years ago[analyzer] Specify the C++ standard in more tests.
Artem Dergachev [Sat, 19 Oct 2019 00:08:17 +0000 (00:08 +0000)]
[analyzer] Specify the C++ standard in more tests.

Makes life easier for downstream developers with different default standard.

llvm-svn: 375308

4 years agoP1152R4: Fix deprecation warnings in libc++ testsuite and in uses of is_invocable...
Richard Smith [Sat, 19 Oct 2019 00:06:00 +0000 (00:06 +0000)]
P1152R4: Fix deprecation warnings in libc++ testsuite and in uses of is_invocable that would internally conjure up a deprecated function type.

Summary: The implementation of P1152R4 in Clang has resulted in some deprecation warnings appearing in the libc++ and libc++abi test suite. Fix or suppress these warnings.

Reviewers: mclow.lists, EricWF

Subscribers: christof, ldionne, libcxx-commits

Tags: #libc

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

llvm-svn: 375307

4 years ago[c++20] Add rewriting from comparison operators to <=> / ==.
Richard Smith [Sat, 19 Oct 2019 00:04:43 +0000 (00:04 +0000)]
[c++20] Add rewriting from comparison operators to <=> / ==.

This adds support for rewriting <, >, <=, and >= to a normal or reversed
call to operator<=>, for rewriting != to a normal or reversed call to
operator==, and for rewriting <=> and == to reversed forms of those same
operators.

Note that this is a breaking change for various C++17 code patterns,
including some in use in LLVM. The most common patterns (where an
operator== becomes ambiguous with a reversed form of itself) are still
accepted under this patch, as an extension (with a warning). I'm hopeful
that we can get the language rules fixed before C++20 ships, and the
extension warning is aimed primarily at providing data to inform that
decision.

llvm-svn: 375306

4 years ago[c++20] Add CXXRewrittenBinaryOperator to represent a comparison
Richard Smith [Sat, 19 Oct 2019 00:04:38 +0000 (00:04 +0000)]
[c++20] Add CXXRewrittenBinaryOperator to represent a comparison
operator that is rewritten as a call to multiple other operators.

No functionality change yet: nothing creates these expressions.

llvm-svn: 375305

4 years agoDebugInfo: Render the canonical name of a class template specialization, even when...
David Blaikie [Fri, 18 Oct 2019 23:58:34 +0000 (23:58 +0000)]
DebugInfo: Render the canonical name of a class template specialization, even when nested in another class template specialization

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

llvm-svn: 375304

4 years ago[profile] Do not cache __llvm_profile_get_filename result
Vedant Kumar [Fri, 18 Oct 2019 23:33:40 +0000 (23:33 +0000)]
[profile] Do not cache __llvm_profile_get_filename result

When the %m filename pattern is used, the filename is unique to each
image, so the cached value is wrong.

It struck me that the full filename isn't something that's recomputed
often, so perhaps it doesn't need to be cached at all. David Li pointed
out we can go further and just hide lprofCurFilename. This may regress
workflows that depend on using the set-filename API to change filenames
across all loaded DSOs, but this is expected to be very rare.

rdar://55137071

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

llvm-svn: 375301

4 years agoLiveIntervals: Fix handleMoveUp with subreg def moving across a def
Matt Arsenault [Fri, 18 Oct 2019 23:24:25 +0000 (23:24 +0000)]
LiveIntervals: Fix handleMoveUp with subreg def moving across a def

If a subregister def was moved across another subregister def and
another use, the main range was not correctly updated. The end point
of the moved interval ended too early and missed the use from theh
other lanes in the subreg def.

llvm-svn: 375300

4 years agogn build: Build compiler-rt code with -fvisibility=hidden.
Peter Collingbourne [Fri, 18 Oct 2019 22:52:17 +0000 (22:52 +0000)]
gn build: Build compiler-rt code with -fvisibility=hidden.

This matches the CMake build.

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

llvm-svn: 375299

4 years agohwasan: Add missing SANITIZER_INTERFACE_ATTRIBUTE on __hwasan_personality_wrapper.
Peter Collingbourne [Fri, 18 Oct 2019 22:51:38 +0000 (22:51 +0000)]
hwasan: Add missing SANITIZER_INTERFACE_ATTRIBUTE on __hwasan_personality_wrapper.

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

llvm-svn: 375298

4 years ago[AMDGPU] move PHI nodes to AGPR class
Stanislav Mekhanoshin [Fri, 18 Oct 2019 22:48:45 +0000 (22:48 +0000)]
[AMDGPU] move PHI nodes to AGPR class

If all uses of a PHI are in AGPR register class we should
avoid unneeded copies via VGPRs.

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

llvm-svn: 375297