]> granicus.if.org Git - llvm/log
llvm
5 years ago[x86] add tests for fdiv with variable operands; NFC
Sanjay Patel [Fri, 16 Aug 2019 13:23:52 +0000 (13:23 +0000)]
[x86] add tests for fdiv with variable operands; NFC

D66050 proposes to change the estimate sequence, but we
don't seem to have test coverage for the common case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369106 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert [CodeGen] Do the Simple Early Return in block-placement pass to optimize the...
Florian Hahn [Fri, 16 Aug 2019 13:19:29 +0000 (13:19 +0000)]
Revert [CodeGen] Do the Simple Early Return in block-placement pass to optimize the blocks

This reverts r368997 (git commit 2a903c0b679bae1919f9fc01f78e4bc6cff2add0)

It looks like this commit adds invalid predecessors to MBBs. The example
below fails the verifier after MachineBlockPlacement (run llc
-verify-machineinstrs):

@global.4 = external constant i8*

declare i32 @zot(...)

define i16* @snork.67() personality i8* bitcast (i32 (...)* @zot to i8*) {
bb:
  invoke void undef()
          to label %bb5 unwind label %bb4

bb4:                                              ; preds = %bb
  %tmp = landingpad { i8*, i32 }
          catch i8* null
  unreachable

bb5:                                              ; preds = %bb
  %tmp6 = load i32, i32* null, align 4
  %tmp7 = icmp eq i32 %tmp6, 0
  br i1 %tmp7, label %bb14, label %bb8

bb8:                                              ; preds = %bb11, %bb5
  invoke void undef()
          to label %bb9 unwind label %bb11

bb9:                                              ; preds = %bb8
  %tmp10 = invoke i16* undef()
          to label %bb14 unwind label %bb11

bb11:                                             ; preds = %bb9, %bb8
  %tmp12 = landingpad { i8*, i32 }
          cleanup
          catch i8* bitcast (i8** @global.4 to i8*)
  %tmp13 = icmp ult i64 undef, undef
  br i1 %tmp13, label %bb8, label %bb14

bb14:                                             ; preds = %bb11, %bb9, %bb5
  %tmp15 = phi i16* [ null, %bb5 ], [ null, %bb11 ], [ %tmp10, %bb9 ]
  ret i16* %tmp15
}

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369104 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DAGCombiner] Add simple folds for SMULFIX/UMULFIX/SMULFIXSAT
Bjorn Pettersson [Fri, 16 Aug 2019 13:16:48 +0000 (13:16 +0000)]
[DAGCombiner] Add simple folds for SMULFIX/UMULFIX/SMULFIXSAT

Summary:
Add the following DAGCombiner folds for mulfix being
one of SMULFIX/UMULFIX/SMULFIXSAT:
  (mulfix x, undef, scale) -> 0
  (mulfix x, 0, scale) -> 0

Also added canonicalization of constants to RHS.

Reviewers: RKSimon, craig.topper, spatel

Reviewed By: RKSimon

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369103 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Add test case for future MULFIX DAG combine folds. NFC
Bjorn Pettersson [Fri, 16 Aug 2019 13:16:38 +0000 (13:16 +0000)]
[X86] Add test case for future MULFIX DAG combine folds. NFC

Add some test cases displaying the lack of DAG combine
folds for SMULFIX/UMULFIX/SMULFIXSAT when either
multiplicand is undef or zero.

It seems like widening vector legalization for X86 can
introduce fixed point multiplication of undef values.
So that is one way that such operations could appear
during ISel.

Multiplication with zero is probably more unlikely, and
could potentially be handled by InstCombine. But I do
not think it would hurt to do such folds in DAGCombiner.

This patch only adds the test case. The folds will be
added in a follow up patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369102 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ARM] Don't pretend we know how to generate MVE VLDn
David Green [Fri, 16 Aug 2019 13:06:49 +0000 (13:06 +0000)]
[ARM] Don't pretend we know how to generate MVE VLDn

We don't yet know how to generate these instructions for MVE. And in the case
of VLD3, we don't even have the instruction. For the moment don't tell the
vectoriser that we have VLD4, just to end up serialising the results.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369101 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RISCV] Allow parsing of bare symbols with offsets
Lewis Revill [Fri, 16 Aug 2019 12:00:56 +0000 (12:00 +0000)]
[RISCV] Allow parsing of bare symbols with offsets

This patch allows symbols followed by an expression for an offset to be
parsed as bare symbols.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369097 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "[CallGraph] Refine call graph for indirect calls with !callees metadata"
Benjamin Kramer [Fri, 16 Aug 2019 10:59:18 +0000 (10:59 +0000)]
Revert "[CallGraph] Refine call graph for indirect calls with !callees metadata"

This reverts commit r369025. Crashes clang, test case is on the mailing
list.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369096 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RISCV] Lower inline asm constraint A for RISC-V
Lewis Revill [Fri, 16 Aug 2019 10:28:34 +0000 (10:28 +0000)]
[RISCV] Lower inline asm constraint A for RISC-V

This allows arguments with the constraint A to be lowered to input nodes
for RISC-V, which implies a memory address stored in a register.

This patch adds the minimal amount of code required to get operands with
the right constraints to compile.

https://reviews.llvm.org/D54296

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369095 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SLPVectorizer] Silence null dereference warning. NFCI.
Simon Pilgrim [Fri, 16 Aug 2019 10:28:23 +0000 (10:28 +0000)]
[SLPVectorizer] Silence null dereference warning. NFCI.

cppcheck + MSVC analyzer both over zealously warn that we might dereference a null Bundle pointer - add an assertion to check for null to silence the warning, plus its a good idea to check that we succeeded in finding a schedule bundle anyway....

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369094 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DebugInfo] Handle complex expressions with spills in LiveDebugValues
Jeremy Morse [Fri, 16 Aug 2019 10:04:17 +0000 (10:04 +0000)]
[DebugInfo] Handle complex expressions with spills in LiveDebugValues

In r369026 we disabled spill-recognition in LiveDebugValues for anything
that has a complex expression. This is because it's hard to recover the
complex expression once the spill location is baked into it.

This patch re-enables spill-recognition and slightly adjusts the DBG_VALUE
insts that LiveDebugValues tracks: instead of tracking the last DBG_VALUE
for a variable, it tracks the last _unspilt_ DBG_VALUE. The spill-restore
code is then able to access and copy the original complex expression; but
the rest of LiveDebugValues has to be aware of the slight semantic shift,
and produce a new spilt location if a spilt location is propagated between
blocks.

The test added produces an incorrect variable location (see FIXME), which
will be the subject of future work.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369092 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAssumptionCache: remove old affected values after RAUW.
Tim Northover [Fri, 16 Aug 2019 09:34:27 +0000 (09:34 +0000)]
AssumptionCache: remove old affected values after RAUW.

If they're left in the cache then they can't be removed efficiently when the
cache is notified to unlink a @llvm.assume call, and that can lead to values
from different functions entirely remaining there.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369091 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ValueTracking] Fix recurrence detection to check both PHI operands.
Florian Hahn [Fri, 16 Aug 2019 09:15:02 +0000 (09:15 +0000)]
[ValueTracking] Fix recurrence detection to check both PHI operands.

Summary:
Currently we fail to compute known bits for recurrences where the
first incoming value is the start value of the recurrence.

Instead of exiting the loop when the first incoming value is not
the step of the recurrence, continue to check the second incoming
value.

The original code uses a loop to handle both cases, but incorrectly
exits instead of continuing.

Reviewers: lebedev.ri, spatel, nikic

Reviewed By: lebedev.ri

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369088 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Manually reimplement getTargetInsertSubreg in X86DAGToDAGISel::matchBitExtract...
Craig Topper [Fri, 16 Aug 2019 04:47:44 +0000 (04:47 +0000)]
[X86] Manually reimplement getTargetInsertSubreg in X86DAGToDAGISel::matchBitExtract so we can call insertDAGNode on the target constant.

This is needed to maintain the topological sort order.

Fixes PR42992.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369084 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRemove the temporary code. NFC.
Igor Kudrin [Fri, 16 Aug 2019 03:40:04 +0000 (03:40 +0000)]
Remove the temporary code. NFC.

That should have been done in rL368156 but somehow was missed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369082 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert r368987, it caused PR43016.
Nico Weber [Fri, 16 Aug 2019 02:21:21 +0000 (02:21 +0000)]
Revert r368987, it caused PR43016.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369080 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[PowerPC] add testcases for folding frame offset - NFC
Chen Zheng [Fri, 16 Aug 2019 01:52:50 +0000 (01:52 +0000)]
[PowerPC] add testcases for folding frame offset - NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369077 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogn build: Merge r369064
Nico Weber [Fri, 16 Aug 2019 00:04:48 +0000 (00:04 +0000)]
gn build: Merge r369064

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369074 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogn build: Merge r369061
Nico Weber [Fri, 16 Aug 2019 00:04:42 +0000 (00:04 +0000)]
gn build: Merge r369061

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369073 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DebugLine] Don't try to guess the path style
Jonas Devlieghere [Thu, 15 Aug 2019 23:53:15 +0000 (23:53 +0000)]
[DebugLine] Don't try to guess the path style

In r368879 I made an attempt to guess the path style from the files in
the line table. After some consideration I now think this is a poor
idea. This patch undoes that behavior and instead adds an optional
argument to specify the path style. This allows us to make that decision
elsewhere where we have more information. In case of LLDB based on the
Unit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369072 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[GlobalISel] CSEMIRBuilder: Add support for G_GEP
Volkan Keles [Thu, 15 Aug 2019 23:45:45 +0000 (23:45 +0000)]
[GlobalISel] CSEMIRBuilder: Add support for G_GEP

Summary:
This patch adds G_GEP to `shouldCSEOpc` so that it can be CSEd. It also refactors
`translateGetElementPtr` by replacing `createGenericVirtualRegister` calls with types.

Reviewers: aditya_nandakumar, arsenm, dsanders, paquette, aemerson

Reviewed By: aditya_nandakumar

Subscribers: wdng, rovka, javed.absar, hiraditya, Petar.Avramovic, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369070 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ARM][LowOverheadLoops] Fix generated code for "revert".
Eli Friedman [Thu, 15 Aug 2019 23:35:53 +0000 (23:35 +0000)]
[ARM][LowOverheadLoops] Fix generated code for "revert".

Two issues:

1. t2CMPri shouldn't use CPSR if it isn't predicated. This doesn't
really have any visible effect at the moment, but it might matter in the
future.
2. The t2CMPri generated for t2WhileLoopStart might need to use a
register that isn't LR.

My team found this because we have a patch to track register liveness
late in the pass pipeline. I'll look into upstreaming it to help catch
issues like this earlier.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369069 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NewPM][PassInstrumentation] Fix test added in r369024.
David L. Jones [Thu, 15 Aug 2019 23:24:14 +0000 (23:24 +0000)]
[NewPM][PassInstrumentation] Fix test added in r369024.

llvm-lto2 doesn't treat "-" as stdout, so the test added in r369024 creates a
file named "-.0". This patch makes the test look more like other tests that use
llvm-lto2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369066 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Support] Re-introduce the RWMutexImpl for macOS < 10.12
Jonas Devlieghere [Thu, 15 Aug 2019 23:07:20 +0000 (23:07 +0000)]
[Support] Re-introduce the RWMutexImpl for macOS < 10.12

In r369018, Benjamin replaced the custom RWMutex implementation with
their C++14 counterpart. Unfortunately, std::shared_timed_mutex is only
available on macOS 10.12 and later. This prevents LLVM from compiling
even on newer versions of the OS when you have an older deployment
target. This patch reintroduced the old RWMutexImpl but guards it by the
macOS availability macro.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369064 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoMove isPointerOffset function to ValueTracking (NFC).
Evgeniy Stepanov [Thu, 15 Aug 2019 22:58:28 +0000 (22:58 +0000)]
Move isPointerOffset function to ValueTracking (NFC).

Summary: To be reused in MemTag sanitizer.

Reviewers: pcc, vitalybuka, ostannard

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369062 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Bugpoint redesign] Added Pass to Remove Global Variables
Diego Trevino Ferrer [Thu, 15 Aug 2019 22:54:09 +0000 (22:54 +0000)]
[Bugpoint redesign] Added Pass to Remove Global Variables

Summary:
This pass tries to remove Global Variables, as well as their derived uses. For example if a variable `@x` is used by `%call1` and `%call2`, both these uses and the definition of `@x` are deleted. Moreover if `%call1` or `%call2` are used elsewhere those uses are also deleted, and so on recursively.

I'm still uncertain if this pass should remove derived uses, I'm open to suggestions.

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

llvm-svn: 368918

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369061 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Bugpoint redesign] Output option can now print to STDOUT
Diego Trevino Ferrer [Thu, 15 Aug 2019 22:39:43 +0000 (22:39 +0000)]
[Bugpoint redesign] Output option can now print to STDOUT

Summary:
This also changes all the outs() statements to errs() so the output and
progress streams don't get mixed.

This has been added because D64176 had flaky tests, which I believe were because the reduced file was being catted into `FileCheck`, instead of being pass from STDOUT directly.

Reviewers: chandlerc, dblaikie, xbolva00

Subscribers: llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369060 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "[Support] Re-introduce the RWMutexImpl for macOS < 10.12"
Jonas Devlieghere [Thu, 15 Aug 2019 22:24:21 +0000 (22:24 +0000)]
Revert "[Support] Re-introduce the RWMutexImpl for macOS < 10.12"

This doesn't work (yet).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369059 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AIX] For XL, pick GCC-compatible std & default warning options
Hubert Tong [Thu, 15 Aug 2019 22:23:53 +0000 (22:23 +0000)]
[AIX] For XL, pick GCC-compatible std & default warning options

Summary:
LLVM now requires C++14. For IBM XL compilers with C++14 support, this
can be done with the GCC-style options. The relevant block in the CMake
file is split up into smaller parts as part of this patch to allow the
common cases to be shared.

Reviewers: jfb, jasonliu, daltenty, xingxue

Reviewed By: jfb, xingxue

Subscribers: mstorsjo, mgorny, dexonsmith, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369058 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SDAG] Minor code cleanup/standardization of atomic accessors [NFC]
Philip Reames [Thu, 15 Aug 2019 22:21:14 +0000 (22:21 +0000)]
[SDAG] Minor code cleanup/standardization of atomic accessors [NFC]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369057 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Support] Re-introduce the RWMutexImpl for macOS < 10.12
Jonas Devlieghere [Thu, 15 Aug 2019 22:19:38 +0000 (22:19 +0000)]
[Support] Re-introduce the RWMutexImpl for macOS < 10.12

In r369018, Benjamin replaced the custom RWMutex implementation with
their C++14 counterpart. Unfortunately, std::shared_timed_mutex is only
available on macOS 10.12 and later. This prevents LLVM from compiling
even on newer versions of the OS when you have an older deployment
target. This patch reintroduced the old RWMutexImpl but guards it by the
macOS availability macro.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369056 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Utils][NFC] Copy bisect usage documents from commit msg into script.
Jinsong Ji [Thu, 15 Aug 2019 22:07:59 +0000 (22:07 +0000)]
[Utils][NFC] Copy bisect usage documents from commit msg into script.

Copy the message into script, so that new users won't need to dig into
commit messages to figure out how to use.

The message are copied directly from Michael's commit message in
https://reviews.llvm.org/rL214610.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369054 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd missing MIR serialization text for AArch64II::MO_TAGGED.
Evgeniy Stepanov [Thu, 15 Aug 2019 22:03:55 +0000 (22:03 +0000)]
Add missing MIR serialization text for AArch64II::MO_TAGGED.

Reviewers: pcc

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

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369053 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MemorySSA] Remove restrictive asserts.
Alina Sbirlea [Thu, 15 Aug 2019 21:20:08 +0000 (21:20 +0000)]
[MemorySSA] Remove restrictive asserts.

The verification I added has overly restrictive asserts.
Unreachable blocks can have any incoming value in practice, after an
update due to a "replaceAllUses" call when the repalced entry is
LiveOnEntry.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369050 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogn build: Merge r369039
Nico Weber [Thu, 15 Aug 2019 21:00:33 +0000 (21:00 +0000)]
gn build: Merge r369039

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369047 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogn build: Merge r369018
Nico Weber [Thu, 15 Aug 2019 21:00:26 +0000 (21:00 +0000)]
gn build: Merge r369018

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369046 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix nm on GCC 5.1 after the C++14 move
JF Bastien [Thu, 15 Aug 2019 20:38:42 +0000 (20:38 +0000)]
Fix nm on GCC 5.1 after the C++14 move

Summary:
As in D66306, fix the invocation of std::sort with std::function by not using
std::function, since it's easier to read and is broken in libstdc++ from GCC 5.1
(see https://gcc.gnu.org/PR65942).

Reviewers: thakis

Subscribers: jkorous, mgrang, dexonsmith, rupprecht, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369045 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoApply llvm-prefer-register-over-unsigned from clang-tidy to LLVM
Daniel Sanders [Thu, 15 Aug 2019 19:22:08 +0000 (19:22 +0000)]
Apply llvm-prefer-register-over-unsigned from clang-tidy to LLVM

Summary:
This clang-tidy check is looking for unsigned integer variables whose initializer
starts with an implicit cast from llvm::Register and changes the type of the
variable to llvm::Register (dropping the llvm:: where possible).

Partial reverts in:
X86FrameLowering.cpp - Some functions return unsigned and arguably should be MCRegister
X86FixupLEAs.cpp - Some functions return unsigned and arguably should be MCRegister
X86FrameLowering.cpp - Some functions return unsigned and arguably should be MCRegister
HexagonBitSimplify.cpp - Function takes BitTracker::RegisterRef which appears to be unsigned&
MachineVerifier.cpp - Ambiguous operator==() given MCRegister and const Register
PPCFastISel.cpp - No Register::operator-=()
PeepholeOptimizer.cpp - TargetInstrInfo::optimizeLoadInstr() takes an unsigned&
MachineTraceMetrics.cpp - MachineTraceMetrics lacks a suitable constructor

Manual fixups in:
ARMFastISel.cpp - ARMEmitLoad() now takes a Register& instead of unsigned&
HexagonSplitDouble.cpp - Ternary operator was ambiguous between unsigned/Register
HexagonConstExtenders.cpp - Has a local class named Register, used llvm::Register instead of Register.
PPCFastISel.cpp - PPCEmitLoad() now takes a Register& instead of unsigned&

Depends on D65919

Reviewers: arsenm, bogner, craig.topper, RKSimon

Reviewed By: arsenm

Subscribers: RKSimon, craig.topper, lenary, aemerson, wuzish, jholewinski, MatzeB, qcolombet, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, wdng, nhaehnle, sbc100, jgravelle-google, kristof.beyls, hiraditya, aheejin, kbarton, fedor.sergeev, javed.absar, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, tpr, PkmX, jocewei, jsji, Petar.Avramovic, asbirlea, Jim, s.egerton, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369041 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Hexagon] Fix instruction selection for vselect v4i8
Krzysztof Parzyszek [Thu, 15 Aug 2019 19:20:09 +0000 (19:20 +0000)]
[Hexagon] Fix instruction selection for vselect v4i8

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369040 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert [Bugpoint redesign] Added Pass to Remove Global Variables
Diego Trevino Ferrer [Thu, 15 Aug 2019 19:08:15 +0000 (19:08 +0000)]
Revert [Bugpoint redesign] Added Pass to Remove Global Variables

This reverts r368918 because it was unstable!

It broke these builds:
 * http://lab.llvm.org:8011/builders/lld-x86_64-ubuntu-fast/builds/4649
 * http://lab.llvm.org:8011/builders/clang-ppc64be-linux-lnt/builds/29966
 * http://lab.llvm.org:8011/builders/clang-ppc64be-linux-lnt/builds/29964

But surprisingly this passed:
 * http://lab.llvm.org:8011/builders/clang-ppc64be-linux-lnt/builds/29965

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369039 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoMVT: Add v3i16/v3f16 vectors
Matt Arsenault [Thu, 15 Aug 2019 18:58:25 +0000 (18:58 +0000)]
MVT: Add v3i16/v3f16 vectors

AMDGPU has some buffer intrinsics which theoretically could use
this. Some of the generated tables include the 3 and 4 element vector
versions of these rounded to 64-bits, which is ambiguous. Add these to
help the table disambiguate these.

Assertion change is for the path odd sized vectors now take for R600.
v3i16 is widened to v4i16, which then needs to be promoted to v4i32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369038 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC] Add a couple of dump routines for RegisterPressure helper classes
Philip Reames [Thu, 15 Aug 2019 18:49:39 +0000 (18:49 +0000)]
[NFC] Add a couple of dump routines for RegisterPressure helper classes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369037 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ValueTracking] Look through ptrmask intrinsics during getUnderlyingObject.
Florian Hahn [Thu, 15 Aug 2019 18:39:56 +0000 (18:39 +0000)]
[ValueTracking] Look through ptrmask intrinsics during getUnderlyingObject.

Reviewers: nlopes, efriedma, hfinkel, sanjoy, aqjune, jdoerfert

Reviewed By: jdoerfert

Subscribers: jdoerfert, hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369036 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC] Added tests for 'select with ctlz to cttz' fold
David Bolvansky [Thu, 15 Aug 2019 18:23:37 +0000 (18:23 +0000)]
[NFC] Added tests for 'select with ctlz to cttz' fold

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369032 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Add custom type legalization for bitcasting mmx to v2i32/v4i16/v8i8 to use...
Craig Topper [Thu, 15 Aug 2019 18:23:37 +0000 (18:23 +0000)]
[X86] Add custom type legalization for bitcasting mmx to v2i32/v4i16/v8i8 to use movq2dq instead of going through memory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369031 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd LLVMLibC proposal to docs/index.rst.
Siva Chandra [Thu, 15 Aug 2019 18:08:11 +0000 (18:08 +0000)]
Add LLVMLibC proposal to docs/index.rst.

Reviewers: rupprecht

Subscribers: arphaman, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369030 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoLink libpthread into LLVMCore.so
Benjamin Kramer [Thu, 15 Aug 2019 18:06:30 +0000 (18:06 +0000)]
Link libpthread into LLVMCore.so

After r369018 the compiler can inline pthread calls into users of
RWMutex.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369029 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "MemoryBuffer: Add a missing error-check to getOpenFileImpl"
Pavel Labath [Thu, 15 Aug 2019 17:52:40 +0000 (17:52 +0000)]
Revert "MemoryBuffer: Add a missing error-check to getOpenFileImpl"

This reverts commit r368977 because it broke a couple of tests in lldb.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369027 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DebugInfo] Avoid crash from dropped fragments in LiveDebugValues
Jeremy Morse [Thu, 15 Aug 2019 17:49:46 +0000 (17:49 +0000)]
[DebugInfo] Avoid crash from dropped fragments in LiveDebugValues

This patch avoids a crash caused by DW_OP_LLVM_fragments being dropped
from DIExpressions by LiveDebugValues spill-restore code. The appearance
of a previously unseen fragment configuration confuses LDV, as documented
in PR42773, and reproduced by the test function this patch adds (Crashes
on a x86_64 debug build).

To avoid this, on spill restore, we now use fragment information from the
spilt-location-expression.

In addition, when spilling, we now don't spill any DBG_VALUE with a complex
expression, as it can't be safely restored and will definitely lead to an
incorrect variable location. The discussion of this is in D65368.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369026 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CallGraph] Refine call graph for indirect calls with !callees metadata
Mark Lacey [Thu, 15 Aug 2019 17:47:53 +0000 (17:47 +0000)]
[CallGraph] Refine call graph for indirect calls with !callees metadata

For indirect call sites having a small set of possible callees,
!callees metadata can be used to indicate what those callees are.
This patch updates the call graph and lazy call graph analyses so
that they consider this metadata when encountering call sites. For
the call graph, it adds a new external call graph node to the graph
for each unique !callees metadata node. A call graph edge connects
an indirect call site with the external node associated with the
!callees metadata that is attached to it. And there is an edge from
this external node to each of the callees indicated by the metadata.
Similarly, for the lazy call graph, the patch adds Ref edges from a
caller to the possible callees indicated by the metadata.

The primary purpose of the patch is to facilitate iterating over the
functions in a module such that all of the callees indicated by a
given !callees metadata node will be visited prior to the functions
containing call sites annotated by that node. This property is
required by optimizations performing a bottom-up traversal of the
SCC DAG. For example, the inliner can be made to inline through an
indirect call. If the call site is annotated with !callees metadata,
this patch ensures that the inliner will have visited all of the
callees prior to the caller, allowing it to reliably compute the
cost of inlining one or more of the potential callees.

Original patch by @mssimpso. I've made some small changes to get it
to apply, build, and pass tests on the top of tree, as well as
some minor tweaks to formatting and functionality.

Subscribers: mehdi_amini, hiraditya, llvm-commits, mssimpso

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369025 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NewPM][PassInstrumentation] IR printing support for (Thin)LTO
Taewook Oh [Thu, 15 Aug 2019 17:47:44 +0000 (17:47 +0000)]
[NewPM][PassInstrumentation] IR printing support for (Thin)LTO

Summary: IR printing has not been correctly supported with (Thin)LTO if the new pass manager is enabled. Previously we only get outputs from backend(codegen) passes, as they are still under legacy pass manager even when the new pass manager is enabled. This patch addresses the issue and enables IR printing for optimization passes with new pass manager + (Thin)LTO setting.

Reviewers: fedor.sergeev, philip.pfaffe

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

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369024 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Improve cost model for subvector extraction of less than 128-bit vectors
Craig Topper [Thu, 15 Aug 2019 17:29:42 +0000 (17:29 +0000)]
[X86] Improve cost model for subvector extraction of less than 128-bit vectors

Now that we're using widening legalization. We need to improve our extract_subvector cost model for these types. This patch begins by modeling these as a subvector extract followed by a permute. I've left FIXMEs in the code for future improvements.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369022 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Support] Base RWMutex on std::shared_timed_mutex (C++14)
Benjamin Kramer [Thu, 15 Aug 2019 16:55:23 +0000 (16:55 +0000)]
[Support] Base RWMutex on std::shared_timed_mutex (C++14)

This should have the same semantics. We use std::shared_mutex instead on
MSVC and C++17, std::shared_timed_mutex is less efficient than our
custom implementation on Windows, std::shared_mutex should be faster.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369018 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[LLVM][Alignment] Fix MSVC potential division by 0 warning (PR42911)
Simon Pilgrim [Thu, 15 Aug 2019 16:34:23 +0000 (16:34 +0000)]
[LLVM][Alignment] Fix MSVC potential division by 0 warning (PR42911)

Original Patch by @gchatelet (Guillaume Chatelet)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369016 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Hexagon] Generate vector min/max for HVX
Krzysztof Parzyszek [Thu, 15 Aug 2019 16:13:17 +0000 (16:13 +0000)]
[Hexagon] Generate vector min/max for HVX

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369014 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm] Migrate llvm::make_unique to std::make_unique
Jonas Devlieghere [Thu, 15 Aug 2019 15:54:37 +0000 (15:54 +0000)]
[llvm] Migrate llvm::make_unique to std::make_unique

Now that we've moved to C++14, we no longer need the llvm::make_unique
implementation from STLExtras.h. This patch is a mechanical replacement
of (hopefully) all the llvm::make_unique instances across the monorepo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369013 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd a proposal for a libc project under the LLVM umbrella.
Siva Chandra [Thu, 15 Aug 2019 15:50:42 +0000 (15:50 +0000)]
Add a proposal for a libc project under the LLVM umbrella.

Reviewers: chandlerc, dlj, echristo, hfinkel, jfb, zturner

Subscribers: dexonsmith, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369012 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[cmake] install_symlink should obey DESTDIR unconditionally
Justin Bogner [Thu, 15 Aug 2019 15:36:13 +0000 (15:36 +0000)]
[cmake] install_symlink should obey DESTDIR unconditionally

Setting DESTDIR was erroneously buried under a condition here - if
it's set it should always be used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369011 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MCA] Slightly refactor class RetireControlUnit, and add the ability to override...
Andrea Di Biagio [Thu, 15 Aug 2019 15:27:40 +0000 (15:27 +0000)]
[MCA] Slightly refactor class RetireControlUnit, and add the ability to override the mask of used buffered resources in class mca::Instruction. NFCI

This patch teaches the RCU how to peek 'next' RCUTokens. A new method has been
added to the RetireControlUnit class with the goal of minimizing the complexity
of follow-up patches that will enable macro-fusion support in mca.

This patch also adds method Instruction::getNumMicroOpcodes() to simplify common
interactions with the instruction descriptor (a pattern quite common in some
pipeline stages).

Added the ability to override the default set of consumed scheduler resources
(this -again- is to simplify future patches that add support for macro-op fusion).

No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369010 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRemove SmallBitVector.h include. NFCI.
Simon Pilgrim [Thu, 15 Aug 2019 14:40:37 +0000 (14:40 +0000)]
Remove SmallBitVector.h include. NFCI.

SmallBitVector/BitVector types aren't used at all in the cpp file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369008 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRemove BitVector.h include. NFCI.
Simon Pilgrim [Thu, 15 Aug 2019 14:39:28 +0000 (14:39 +0000)]
Remove BitVector.h include. NFCI.

BitVector type isn't used at all in the cpp file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369007 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[PowerPC] Use xxleqv to set all one vector IMM(-1).
Jinsong Ji [Thu, 15 Aug 2019 14:32:51 +0000 (14:32 +0000)]
[PowerPC] Use xxleqv to set all one vector IMM(-1).

Summary:
xxspltib/vspltisb are 3 cycle PM instructions,
xxleqv is 2 cycle ALU instruction.

We should use xxleqv to set all one vectors.

Reviewers: hfinkel, nemanjai, steven.zhang

Subscribers: hiraditya, kbarton, MaskRay, shchenz, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369006 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[lib/Object] - Remove objdump-file-header.test
George Rimar [Thu, 15 Aug 2019 13:39:58 +0000 (13:39 +0000)]
[lib/Object] - Remove objdump-file-header.test

objdump-file-header.test is placed in the wrong folder.
I removed it and updated the existent llvm-objdump test cases with
the updated content of the file removed.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369004 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DAGCombine] MergeConsecutiveStores - fix cppcheck/MSVC extension warning. NFCI.
Simon Pilgrim [Thu, 15 Aug 2019 13:07:14 +0000 (13:07 +0000)]
[DAGCombine] MergeConsecutiveStores - fix cppcheck/MSVC extension warning. NFCI.

Set the StartIdx type to size_t so that it matches the StoreNodes SmallVector size() and index types.

Silences the MSVC analyzer warning that unsigned increment might overflow before exceeding size_t on 64-bit targets - this isn't likely to happen but it means we use consistent types and reduces the warning "noise" a little.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368998 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CodeGen] Do the Simple Early Return in block-placement pass to optimize the blocks
Kang Zhang [Thu, 15 Aug 2019 13:05:16 +0000 (13:05 +0000)]
[CodeGen] Do the Simple Early Return in block-placement pass to optimize the blocks

Summary:

This patch has trigger a bug of r368339, and the r368339 has been reverted, So upstream this patch again.

In `block-placement` pass, it will create some patterns for unconditional we can do the simple early retrun.
But the `early-ret` pass is before `block-placement`, we don't want to run it again.
This patch is to do the simple early return to optimize the blocks at the last of `block-placement`.

Reviewed By: efriedma

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368997 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ARM] Fix alignment checks for BE VLDRH
David Green [Thu, 15 Aug 2019 12:54:47 +0000 (12:54 +0000)]
[ARM] Fix alignment checks for BE VLDRH

We need to allow any alignment at least 2, not just exactly 2, so that the big
endian loads and stores can be selected successfully. I've also added extra BE
testing for the load and store tests.

Thanks to Oliver for the report.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368996 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SDAG][x86] check for relaxed math when matching an FP reduction
Sanjay Patel [Thu, 15 Aug 2019 12:43:15 +0000 (12:43 +0000)]
[SDAG][x86] check for relaxed math when matching an FP reduction

If the last step in an FP add reduction allows reassociation and doesn't care
about -0.0, then we are free to recognize that computation as a reduction
that may reorder the intermediate steps.

This is requested directly by PR42705:
https://bugs.llvm.org/show_bug.cgi?id=42705
and solves PR42947 (if horizontal math instructions are actually faster than
the alternative):
https://bugs.llvm.org/show_bug.cgi?id=42947

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368995 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MCA] Slightly refactor the logic in ResourceManager. NFCI
Andrea Di Biagio [Thu, 15 Aug 2019 12:39:55 +0000 (12:39 +0000)]
[MCA] Slightly refactor the logic in ResourceManager. NFCI

This patch slightly changes the API in the attempt to simplify resource buffer
queries. It is done in preparation for a patch that will enable support for
macro fusion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368994 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ValueTracking] Add MustPreserveNullness arg to functions analyzing calls. (NFC)
Florian Hahn [Thu, 15 Aug 2019 12:13:02 +0000 (12:13 +0000)]
[ValueTracking] Add MustPreserveNullness arg to functions analyzing calls. (NFC)

Some uses of getArgumentAliasingToReturnedPointer and
isIntrinsicReturningPointerAliasingArgumentWithoutCapturing require the
calls/intrinsics to preserve the nullness of the argument.

For alias analysis, the nullness property does not really come into
play.

This patch explicitly sets it to true. In D61669, the alias analysis
uses will be switched to not require preserving nullness.

Reviewers: nlopes, efriedma, hfinkel, sanjoy, aqjune, jdoerfert

Reviewed By: jdoerfert

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368993 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ADT] PointerUnion: Use C++14 constexpr std::min
Benjamin Kramer [Thu, 15 Aug 2019 11:49:00 +0000 (11:49 +0000)]
[ADT] PointerUnion: Use C++14 constexpr std::min

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368992 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoReplace llvm::integer_sequence and friends with the C++14 standard version
Benjamin Kramer [Thu, 15 Aug 2019 10:56:05 +0000 (10:56 +0000)]
Replace llvm::integer_sequence and friends with the C++14 standard version

The implementation in libc++ takes O(1) compile time, ours was O(n).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368990 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoBump llvm-go to C++14
Benjamin Kramer [Thu, 15 Aug 2019 10:55:25 +0000 (10:55 +0000)]
Bump llvm-go to C++14

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368989 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ARM] MVE predicate store patterns
David Green [Thu, 15 Aug 2019 10:41:42 +0000 (10:41 +0000)]
[ARM] MVE predicate store patterns

Stack loads and stores were already working, but direct stores were not. This
adds the patterns for them, same as predicate loads.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368988 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AArch64] Change location of frame-record within callee-save area.
Sander de Smalen [Thu, 15 Aug 2019 10:34:16 +0000 (10:34 +0000)]
[AArch64] Change location of frame-record within callee-save area.

This patch changes the location of the frame-record (FP, LR) to the
bottom of the callee-saved area. According to the AAPCS the location of
the frame-record within the stackframe is unspecified (section 5.2.3 The
Frame Pointer), so the compiler should be free to choose a different
location.

The reason for changing the location of the frame-record is to prepare
the frame for allocating an SVE area below the callee-saves. This way the
compiler can use the VL-scaled addressing modes to directly access SVE
objects from the frame-pointer.

            :                :
        | stack |        | stack |
        |  args |        |  args |
        +-------+        +-------+
        |  x30  |        |  x19  |
        |  x29  |        |  x20  |
  FP -> |- - - -|        |  x21  |
        |  x19  |   ==>  |  x22  |
        |  x20  |        |- - - -|
        |  x21  |        |  x30  |
        |  x22  |        |  x29  |
        +-------+        +-------+ <- FP
        |///////|        |///////|         // realignment gap
        |- - - -|        |- - - -|
        |spills/|        |spills/|
        | locals|        | locals|
  SP -> +-------+        +-------+ <- SP

Things to point out:
- The algorithm to find a paired register should be prevented from
  accidentally pairing some callee-saved register with LR that is not
  FP, since they should always be paired together when the frame
  has a frame-record.
- For Darwin platforms the location of the frame-record is unchanged,
  since the unwind encoding does not allow for encoding this position
  dynamically and other tools currently depend on the former layout.

Reviewers: efriedma, rovka, rengolin, thegameg, greened, t.p.northover

Reviewed By: efriedma

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368987 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd ptrmask intrinsic
Florian Hahn [Thu, 15 Aug 2019 10:12:26 +0000 (10:12 +0000)]
Add ptrmask intrinsic

This patch adds a ptrmask intrinsic which allows masking out bits of a
pointer that must be zero when accessing it, because of ABI alignment
requirements or a restriction of the meaningful bits of a pointer
through the data layout.

This avoids doing a ptrtoint/inttoptr round trip in some cases (e.g. tagged
pointers) and allows us to not lose information about the underlying
object.

Reviewers: nlopes, efriedma, hfinkel, sanjoy, jdoerfert, aqjune

Reviewed by: sanjoy, jdoerfert

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368986 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert rL368939 "Remove LVALUE / RVALUE workarounds"
Russell Gallop [Thu, 15 Aug 2019 10:12:11 +0000 (10:12 +0000)]
Revert rL368939 "Remove LVALUE / RVALUE workarounds"

This reverts commit cad8356d699b36c73abb267f65db575ddacbd652.

To unbreak Windows bots

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368985 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Support] Fix Wundef warning
Sven van Haastregt [Thu, 15 Aug 2019 10:05:22 +0000 (10:05 +0000)]
[Support] Fix Wundef warning

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368984 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-objcopy] Allow 'protected' visibility to be set when using
Chris Jackson [Thu, 15 Aug 2019 09:45:09 +0000 (09:45 +0000)]
[llvm-objcopy] Allow 'protected' visibility to be set when using
add-symbol

Reviewers: Maskray, rupprecht

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368982 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ARM] MVE trunc to i1 vectors
David Green [Thu, 15 Aug 2019 09:26:51 +0000 (09:26 +0000)]
[ARM] MVE trunc to i1 vectors

This adds patterns for selecting trunc instructions from full vectors to i1's
vectors.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368981 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] Precommit test case for D66216
Florian Hahn [Thu, 15 Aug 2019 08:42:12 +0000 (08:42 +0000)]
[InstCombine] Precommit test case for D66216

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368978 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoMemoryBuffer: Add a missing error-check to getOpenFileImpl
Pavel Labath [Thu, 15 Aug 2019 08:20:15 +0000 (08:20 +0000)]
MemoryBuffer: Add a missing error-check to getOpenFileImpl

Summary:
In case the function was called with a desired read size *and* the file
was not an "mmap()" candidate, the function was falling back to a
"pread()", but it was failing to check the result of that system call.
This meant that the function would return "success" even though the read
operation failed, and it returned a buffer full of uninitialized memory.

Reviewers: rnk, dblaikie

Subscribers: kristina, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368977 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-readobj][MachO] Fix section type printing
Seiya Nuta [Thu, 15 Aug 2019 07:22:04 +0000 (07:22 +0000)]
[llvm-readobj][MachO] Fix section type printing

Summary:
Currently, llvm-readobj mistakenly decodes section type as section attribute.

This patch fixes the bug and affected tests.

Reviewers: JDevlieghere, jhenderson, rupprecht, alexshap, echristo

Reviewed By: jhenderson, rupprecht, alexshap, echristo

Subscribers: javed.absar, rupprecht, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368974 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[LV] fold-tail predication should be respected even with assume_safety
Dorit Nuzman [Thu, 15 Aug 2019 07:12:14 +0000 (07:12 +0000)]
[LV] fold-tail predication should be respected even with assume_safety

assume_safety implies that loads under "if's" can be safely executed
speculatively (unguarded, unmasked). However this assumption holds only for the
original user "if's", not those introduced by the compiler, such as the
fold-tail "if" that guards us from loading beyond the original loop trip-count.
Currently the combination of fold-tail and assume-safety pragmas results in
ignoring the fold-tail predicate that guards the loads, generating unmasked
loads. This patch fixes this behavior.

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

Reviewers: Ayal, hsaito, fhahn

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368973 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Add isel pattern to match VZEXT_MOVL and a v2i64 scalar_to_vector bitcasted...
Craig Topper [Thu, 15 Aug 2019 06:46:30 +0000 (06:46 +0000)]
[X86] Add isel pattern to match VZEXT_MOVL and a v2i64 scalar_to_vector bitcasted from x86mmx to MOVQ2DQ.

We already had the pattern for just the scalar to vector and bitcast,
but not the case where we wanted zeroes in the high half of the xmm.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368972 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Make sure load is non-volatile in the MMX_X86movdq2q (loadv2i64) isel pattern.
Craig Topper [Thu, 15 Aug 2019 06:46:26 +0000 (06:46 +0000)]
[X86] Make sure load is non-volatile in the MMX_X86movdq2q (loadv2i64) isel pattern.

This pattern will narrow the load so we should make sure its not
volatile.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368971 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Remove unneeded isel pattern for v4f32->v4i32 fp_to_sint and conversion to...
Craig Topper [Thu, 15 Aug 2019 05:52:02 +0000 (05:52 +0000)]
[X86] Remove unneeded isel pattern for v4f32->v4i32 fp_to_sint and conversion to MMX.

fp_to_sint is turned into X86cvttp2si during isel preprocessing.
The other redundant isel patterns were removed previously, but I
missed this one because its in the MMX td file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368968 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Disable custom type legalization for v2i32/v4i16/v8i8->i64.
Craig Topper [Thu, 15 Aug 2019 05:51:58 +0000 (05:51 +0000)]
[X86] Disable custom type legalization for v2i32/v4i16/v8i8->i64.

The default legalization can take care of this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368967 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Disable custom type legalization for v2i32/v4i16/v8i8->f64 bitcast.
Craig Topper [Thu, 15 Aug 2019 05:51:54 +0000 (05:51 +0000)]
[X86] Disable custom type legalization for v2i32/v4i16/v8i8->f64 bitcast.

The generic legalization handles this in the same way so just use
that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368966 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Remove some unreachable code from LowerBITCAST.
Craig Topper [Thu, 15 Aug 2019 05:51:50 +0000 (05:51 +0000)]
[X86] Remove some unreachable code from LowerBITCAST.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368965 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-objdump] Add warning messages if disassembly + source for problematic inputs
Michael Pozulp [Thu, 15 Aug 2019 05:15:22 +0000 (05:15 +0000)]
[llvm-objdump] Add warning messages if disassembly + source for problematic inputs

Summary: Addresses https://bugs.llvm.org/show_bug.cgi?id=41905

Reviewers: jhenderson, rupprecht, grimar

Reviewed By: jhenderson, grimar

Subscribers: RKSimon, MaskRay, hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368963 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-objcopy] Move duplicate tablegen from objcopy and strip into one file
Michael Pozulp [Thu, 15 Aug 2019 04:45:41 +0000 (04:45 +0000)]
[llvm-objcopy] Move duplicate tablegen from objcopy and strip into one file

Summary: This avoids maintaining the same options in two different places.

Reviewers: jhenderson, alexshap, rupprecht, MaskRay

Reviewed By: jhenderson, rupprecht, MaskRay

Subscribers: MaskRay, wolfgangp, jakehehrlich, abrachet, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368961 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC] Remove documentation comment to fix warning.
Jonas Devlieghere [Thu, 15 Aug 2019 04:09:00 +0000 (04:09 +0000)]
[NFC] Remove documentation comment to fix warning.

Remove the @return to fix the warning: '@returns' command used in a
comment that is attached to a function returning void [-Wdocumentation]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368957 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Remove some dead code and combine some repeated code that's left.
Craig Topper [Thu, 15 Aug 2019 04:07:43 +0000 (04:07 +0000)]
[X86] Remove some dead code and combine some repeated code that's left.

If the width is 256 bits, then we must have AVX so the else here
was unnecessary. Once that's removed then the >= 256 bit code is
identical to the 128 bit code with a different VT so combine them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368956 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "Expose TailCallKind via the LLVM C API"
Jonas Devlieghere [Thu, 15 Aug 2019 03:49:51 +0000 (03:49 +0000)]
Revert "Expose TailCallKind via the LLVM C API"

This is failing on several build bots. Reverting as discussed in
https://reviews.llvm.org/D66061.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368953 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogn build: Merge r368918
Vitaly Buka [Thu, 15 Aug 2019 01:38:30 +0000 (01:38 +0000)]
gn build: Merge r368918

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368951 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[coroutine] Fixes "cannot move instruction since its users are not dominated by CoroB...
Gor Nishanov [Thu, 15 Aug 2019 00:48:51 +0000 (00:48 +0000)]
[coroutine] Fixes "cannot move instruction since its users are not dominated by CoroBegin" problem.

Summary:
Fixes https://bugs.llvm.org/show_bug.cgi?id=36578 and https://bugs.llvm.org/show_bug.cgi?id=36296.
Supersedes: https://reviews.llvm.org/D55966

One of the fundamental transformation that CoroSplit pass performs before splitting the coroutine is to find which values need to survive between suspend and resume and provide a slot for them in the coroutine frame to spill and restore the value as needed.

Coroutine frame becomes available once the storage for it was allocated and that point is marked in the pre-split coroutine with a llvm.coro.begin intrinsic.

FE normally puts all of the user-authored code that would be accessing those values after llvm.coro.begin, however, sometimes instructions accessing those values would end up prior to coro.begin. For example, writing out a value of the parameter into the alloca done by the FE or instructions that are added by the optimization passes such as SROA when it rewrites allocas.

Prior to this change, CoroSplit pass would try to move instructions that may end up accessing the values in the coroutine frame after CoroBegin. However it would run into problems (report_fatal_error) if some of the values would be used both in the allocation function (for example allocator is passed as a parameter to a coroutine) and in the use-authored body of the coroutine.

To handle this case and to simplify the instruction moving logic, this change removes all of the instruction moving. Instead, we only change the uses of the spilled values that are dominated by coro.begin and leave other instructions intact.

Before:

```
%var = alloca i32
%1 = getelementptr .. %var; ; will move this one after coro.begin
%f = call i8* @llvm.coro.begin(
```

After:

```
%var = alloca i32
%1 = getelementptr .. %var; stays put
%f = call i8* @llvm.coro.begin(
```
If we discover that there is a potential write into an alloca, prior to coro.begin we would copy its value from the alloca into the spill slot in the coroutine frame.

Before:

```
%var = alloca i32
store .. %var ; will move this one after coro.begin
%f = call i8* @llvm.coro.begin(
```

After:

```
%var = alloca i32
store .. %var ;stays put
%f = call i8* @llvm.coro.begin(
%tmp = load %var
store %tmp, %spill.slot.for.var
```

Note: This change does not handle array allocas as that is something that C++ FE does not produce, but, it can be added in the future if need arises

Reviewers: llvm-commits, modocache, ben-clayton, tks2103, rjmccall

Reviewed By: modocache

Subscribers: bartdesmet

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368949 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoExpose TailCallKind via the LLVM C API
Robert Widmann [Wed, 14 Aug 2019 23:54:35 +0000 (23:54 +0000)]
Expose TailCallKind via the LLVM C API

Summary: This exposes `CallInst`'s tail call kind via new `LLVMGetTailCallKind` and `LLVMSetTailCallKind` functions. The motivation for this is to be able to see `musttail` for languages that require mandatory tail calls for correctness. Today only the weaker `LLVMSetTail` is exposed and there is no way to set `GuaranteedTailCallOpt` via the C API.

Reviewers: CodaFi, jyknight, deadalnix, rnk

Reviewed By: CodaFi

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368945 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRemove LVALUE / RVALUE workarounds
JF Bastien [Wed, 14 Aug 2019 22:48:12 +0000 (22:48 +0000)]
Remove LVALUE / RVALUE workarounds

Summary: LLVM_HAS_RVALUE_REFERENCE_THIS and LLVM_LVALUE_FUNCTION shouldn't be needed anymore because the minimum compiler versions support them.

Subscribers: jkorous, dexonsmith, cfe-commits, llvm-commits, hans, thakis, chandlerc, rnk

Tags: #clang, #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368939 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Attributor] Try to fix "missing field 'RetInsts' initializer" warning
Johannes Doerfert [Wed, 14 Aug 2019 22:32:29 +0000 (22:32 +0000)]
[Attributor] Try to fix "missing field 'RetInsts' initializer" warning

http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/35674/steps/build_Lld/logs/stdio

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368938 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Bugpoint redesign] Modified Functions pass to consider declarations
Diego Trevino Ferrer [Wed, 14 Aug 2019 22:22:37 +0000 (22:22 +0000)]
[Bugpoint redesign] Modified Functions pass to consider declarations

Summary: This modification was put in place so the `ReduceMetadata` pass doesn't have to consider debug functions

Reviewers: dblaikie

Subscribers: llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368934 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[docs] Fix sphinx doc generation errors
Jordan Rupprecht [Wed, 14 Aug 2019 22:18:01 +0000 (22:18 +0000)]
[docs] Fix sphinx doc generation errors

Summary:
Errors fixed:
 - GettingStarted: Duplicate explicit target name: "cmake"
 - GlobalISel: Unexpected indentation
 - LoopTerminology: Explicit markup ends without a blank line; unexpected unindent
 - ORCv2: Definition list ends without a blank line; unexpected unindent
 - Misc: document isn't included in any toctree

Verified that a clean docs build (`rm -rf docs/ && ninja docs-llvm-html`) passes with no errors. Spot checked the individual pages to make sure they look OK.

Reviewers: thakis, dsanders

Reviewed By: dsanders

Subscribers: arphaman, llvm-commits, lhames, rovka, dsanders, reames

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368932 91177308-0d34-0410-b5e6-96231b3b80d8