platform/upstream/llvm.git
4 years agoPR45063: Fix crash on invalid processing an elaborated class template-id
Richard Smith [Sat, 14 Mar 2020 01:53:08 +0000 (18:53 -0700)]
PR45063: Fix crash on invalid processing an elaborated class template-id
with an invalid scope specifier.

4 years ago[X86] Remove isel patterns for X86VBroadcast+trunc+extload. Replace with DAG combines.
Craig Topper [Sat, 14 Mar 2020 01:02:48 +0000 (18:02 -0700)]
[X86] Remove isel patterns for X86VBroadcast+trunc+extload. Replace with DAG combines.

This is a little more complicated than I'd like it to be. We have
to manually match a trunc+srl+load pattern that generic DAG
combine won't do for us due to isTypeDesirableForOp.

4 years agoFix `-Wunused-variable`. NFC.
Michael Liao [Sat, 14 Mar 2020 00:50:35 +0000 (20:50 -0400)]
Fix `-Wunused-variable`. NFC.

4 years agoRevert "Revert "Move more tests to globalMemCounter and reset.""
Dan Albert [Fri, 13 Mar 2020 20:55:26 +0000 (13:55 -0700)]
Revert "Revert "Move more tests to globalMemCounter and reset.""

Test regressions not included this time :)

This reverts commit 1ed671082ef4b13d44e2c0f42ddedf9d450258a7.

4 years ago[NFC][LoopUnrollAndJam] clang-format.
Whitney Tsang [Sat, 14 Mar 2020 00:04:10 +0000 (00:04 +0000)]
[NFC][LoopUnrollAndJam] clang-format.

I am currently working on this file.

4 years agoAdjust debug output for MCRelaxableFragment to include the size so that sanity checki...
Philip Reames [Fri, 13 Mar 2020 22:54:43 +0000 (15:54 -0700)]
Adjust debug output for MCRelaxableFragment to include the size so that sanity checking relaxation offsets from -debug output is easier

4 years ago[SCEV] Add support for GEPs over scalable vectors.
Eli Friedman [Fri, 13 Mar 2020 23:12:45 +0000 (16:12 -0700)]
[SCEV] Add support for GEPs over scalable vectors.

Because we have to use a ConstantExpr at some point, the canonical form
isn't set in stone, but this seems reasonable.

The pretty sizeof(<vscale x 4 x i32>) dumping is a relic of ancient
LLVM; I didn't have to touch that code. :)

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

4 years agoInitialize IsFast* values
Brian Cain [Fri, 13 Mar 2020 20:24:19 +0000 (15:24 -0500)]
Initialize IsFast* values

We must initialize these values in case some targets do not assign to
them in allowsMemoryAccess().

4 years ago[LLJIT] Add std::move() as a workaround for older compilers
Jan Korous [Fri, 13 Mar 2020 22:21:12 +0000 (15:21 -0700)]
[LLJIT] Add std::move() as a workaround for older compilers

Clang 3.8 isn't able to bind the variable to rvalue-ref which breaks the build.

4 years ago[OPENMP]Fix PR45047: Do not copy firstprivates in tasks twice.
Alexey Bataev [Mon, 9 Mar 2020 12:55:57 +0000 (08:55 -0400)]
[OPENMP]Fix PR45047: Do not copy firstprivates in tasks twice.

Avoid copying of the orignal variable if it is going to be marked as
firstprivate in task regions. For taskloops, still need to copy the
non-trvially copyable variables to correctly construct them upon task
creation.

4 years agoAdd Builder::getI64VectorAttr.
Sean Silva [Wed, 11 Mar 2020 22:15:06 +0000 (15:15 -0700)]
Add Builder::getI64VectorAttr.

This matches Builder::getI32VectorAttr.

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

4 years ago[mlir][LLVMIR] Add a support for boolean type arguments conversion
Ahmed Taei [Fri, 13 Mar 2020 20:41:14 +0000 (13:41 -0700)]
[mlir][LLVMIR] Add a support for boolean type arguments conversion

Summary:
Otherwise this will fail translating ops with boolean arguments and
added test will fail.

Reviewers: nicolasvasilache, rriddle

Subscribers: mehdi_amini, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, Joonsoo, llvm-commits

Tags: #llvm

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

4 years ago[mlir][Linalg] Implement padding for linalg.conv and lowering to loops.
Hanhan Wang [Fri, 13 Mar 2020 21:33:27 +0000 (14:33 -0700)]
[mlir][Linalg] Implement padding for linalg.conv and lowering to loops.

Summary:
To enable this, two changes are needed:
1) Add an optional attribute `padding` to linalg.conv.
2) Compute if the indices accessing is out of bound in the loops. If so, use the
padding value `0`. Otherwise, use the value derived from load.

In the patch, the padding only works for lowering without other transformations,
e.g., tiling, fusion, etc.

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

4 years ago[mlir] Automatically add DerivedAttribute op interface
Jacques Pienaar [Fri, 13 Mar 2020 17:09:02 +0000 (10:09 -0700)]
[mlir] Automatically add DerivedAttribute op interface

Summary: When an operation has derived attributes, add the DerivedAttribute op interface.

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

4 years ago[ELF] Add test for freebsd bfdname
Shoaib Meenai [Fri, 13 Mar 2020 21:15:58 +0000 (14:15 -0700)]
[ELF] Add test for freebsd bfdname

Make sure the output error contains the full bfdname. Suggested by
George Rimar in https://reviews.llvm.org/D76109#inline-693972.

4 years ago[clangd] Add json::Object->Value conversion workaround for older compilers
Jan Korous [Thu, 12 Mar 2020 22:27:08 +0000 (15:27 -0700)]
[clangd] Add json::Object->Value conversion workaround for older compilers

The build was broken for clang-3.8 which we still support.

4 years ago[SelectionDAGBuilder] Simplify the struct type handling in getUniformBase.
Craig Topper [Fri, 13 Mar 2020 19:57:20 +0000 (12:57 -0700)]
[SelectionDAGBuilder] Simplify the struct type handling in getUniformBase.

4 years ago[IR] Fix formatting. NFC
Craig Topper [Fri, 13 Mar 2020 19:19:36 +0000 (12:19 -0700)]
[IR] Fix formatting. NFC

4 years ago[MCJIT] Check for RuntimeDyld errors in MCJIT::finalizeLoadedModules.
Lang Hames [Fri, 13 Mar 2020 16:24:09 +0000 (09:24 -0700)]
[MCJIT] Check for RuntimeDyld errors in MCJIT::finalizeLoadedModules.

Patch based on https://reviews.llvm.org/D75912 by Alexander Shishkin. Thanks
Alexander!

To minimize disruption to existing clients, who may be relying on the fact that
unused references to unresolved symbols do not generate an error, this patch
makes error checking opt-in: Clients can call ExecutionEngine::hasError or
LLVMExecutionEngineGetError to check whether and error has occurred.

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

4 years agoFix "unused variable" warning in NDEBUG builds.
Richard Smith [Fri, 13 Mar 2020 20:56:57 +0000 (13:56 -0700)]
Fix "unused variable" warning in NDEBUG builds.

4 years agoCMake: Turn LLVM_ENABLE_ZLIB into a tri-state option
Amy Huang [Thu, 12 Mar 2020 22:51:40 +0000 (15:51 -0700)]
CMake: Turn LLVM_ENABLE_ZLIB into a tri-state option

Summary:
Add FORCE_ON option to LLVM_ENABLE_ZLIB, which causes a configuration
error if zlib is not found.
Similar to https://reviews.llvm.org/D40050.

Reviewers: hans, thakis, rnk

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

4 years ago[ObjC][ARC] Don't remove autoreleaseRV/retainRV pairs if the call isn't
Akira Hatanaka [Fri, 13 Mar 2020 19:15:17 +0000 (12:15 -0700)]
[ObjC][ARC] Don't remove autoreleaseRV/retainRV pairs if the call isn't
a tail call

This reapplies the patch in https://reviews.llvm.org/rG1f5b471b8bf4,
which was reverted because it was causing crashes.

https://bugs.chromium.org/p/chromium/issues/detail?id=1061289#c2

Check that HasSafePathToCall is true before checking the call is a tail
call.

Original commit message:

Previosly ARC optimizer removed the autoreleaseRV/retainRV pair in the
following code, which caused the object returned by @something to be
placed in the autorelease pool because the call to @something isn't a
tail call:

```
  %call = call i8* @something(...)
  %2 = call i8* @objc_retainAutoreleasedReturnValue(i8* %call)
  %3 = call i8* @objc_autoreleaseReturnValue(i8* %2)
  ret i8* %3
```

Fix the bug by checking whether @something is a tail call.

rdar://problem/59275894

4 years ago[AMDGPU] Fix endcf collapse
Stanislav Mekhanoshin [Fri, 13 Mar 2020 19:44:59 +0000 (12:44 -0700)]
[AMDGPU] Fix endcf collapse

Only collapse inner endcf if the outer one belongs to SI_IF.
If it does belong to SI_ELSE then mask being restored in fact
a partial inverse of what we need.

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

4 years ago[COFF] Assign unique names to autogenerated .weak.<name>.default symbols
Martin Storsjö [Tue, 10 Mar 2020 21:44:03 +0000 (23:44 +0200)]
[COFF] Assign unique names to autogenerated .weak.<name>.default symbols

These symbols need to be external (MSVC tools error out if a weak
external points at a symbol that isn't external; this was tried before
but had to be reverted in bc5b7217dceecd3eec69593026a9e38dfbfd6908,
and this was originally explicitly fixed in
732eeaf2a930ad2755cb4eb5d99a3deae0de4a72).

If multiple object files have weak symbols with defaults, their
defaults could cause linker errors due to duplicate definitions,
unless the names of the defaults are unique.

GNU binutils handles this by appending the name of another symbol
from the same object file to the name of the default symbol. Try
to implement something similar; before writing the object file,
locate a symbol that should have a unique name and use the name of
that one for making the weak defaults unique.

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

4 years ago[mlir][Vector]Lower vector.contract to llvm.intr.matrix_multiply
Nicolas Vasilache [Fri, 13 Mar 2020 20:32:27 +0000 (16:32 -0400)]
[mlir][Vector]Lower vector.contract to llvm.intr.matrix_multiply

Summary:
This revision adds lowering of vector.contract to llvm.intr.matrix_multiply.
Note that there is currently a mismatch between the MLIR vector dialect which
expects row-major layout and the LLVM matrix intrinsics which expect column
major layout.

As a consequence, we currently only match a vector.contract with indexing maps
that express column-major matrix multiplication.
Other cases would require additional transposes and it is better to wait for
LLVM intrinsics to provide a per-operation attribute that would specify which
layout is expected.

A separate integration test, not submitted to MLIR core, has independently
verified that correct execution occurs on a 2x2x2 matrix multiplication.

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

4 years agoAMDGPU: Add flag to used fixed function ABI
Matt Arsenault [Wed, 11 Mar 2020 20:13:52 +0000 (16:13 -0400)]
AMDGPU: Add flag to used fixed function ABI

Pass all arguments to every function, rather than only passing the
minimum set of inputs needed for the call graph.

4 years agoRevert "Move more tests to globalMemCounter and reset."
Dan Albert [Fri, 13 Mar 2020 20:26:35 +0000 (13:26 -0700)]
Revert "Move more tests to globalMemCounter and reset."

Not all of these changes were correct. Will reland appropriate parts
in a follow up.

This reverts commit 4a792965de08fb69652370625f1aec2e87111313.

4 years ago[Sema] Use the canonical type in function isVector
Akira Hatanaka [Fri, 13 Mar 2020 20:08:48 +0000 (13:08 -0700)]
[Sema] Use the canonical type in function isVector

This reapplies the following patch, which was reverted because it caused
neon CodeGen tests to fail:

https://reviews.llvm.org/rGa6150b48cea00ab31e9335cc73770327acc4cb3a

I've added checks to detect half precision neon vectors and avoid
promiting them to vectors of floats.

See the discussion here: https://reviews.llvm.org/rG825235c140e7

Original commit message:

This fixes an assertion in Sema::CreateBuiltinBinOp that fails when one
of the vector operand's element type is a typedef of __fp16.

rdar://problem/55983556

4 years ago[LoopInterchange] Fix interchanging contents of preheader BBs
Alexey Zhikhartsev [Fri, 13 Mar 2020 19:15:11 +0000 (15:15 -0400)]
[LoopInterchange] Fix interchanging contents of preheader BBs

Summary:
Previously LCSSA was getting broken by placing instructions into the
(newly) inner *header* instead of the *pre*header.

Fixes PR43474

Reviewers: fhahn

Reviewed By: fhahn

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years agoAMDGPU: Don't handle kernarg.segment.ptr in functions
Matt Arsenault [Thu, 12 Mar 2020 18:35:22 +0000 (14:35 -0400)]
AMDGPU: Don't handle kernarg.segment.ptr in functions

Just lower this to null. Pass implicitarg.ptr in its place in the
argument list.

4 years agoRevert "Reland "[DebugInfo] Enable the debug entry values feature by default""
Nico Weber [Fri, 13 Mar 2020 19:37:44 +0000 (15:37 -0400)]
Revert "Reland "[DebugInfo] Enable the debug entry values feature by default""

This reverts commit 5aa5c943f7da155b95564058cd5d50a93eabfc89.
Causes clang to assert, see
https://bugs.chromium.org/p/chromium/issues/detail?id=1061533#c4
for a repro.

4 years ago[AMDGPU] Disable endcf collapse
Stanislav Mekhanoshin [Fri, 13 Mar 2020 17:58:19 +0000 (10:58 -0700)]
[AMDGPU] Disable endcf collapse

There are some functional regressions and I suspect our
scopes are not as perfectly enclosed as I expected.
Disable it for now.

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

4 years ago[Sema][SVE] Reject arrays of sizeless types
Richard Sandiford [Thu, 27 Feb 2020 10:25:31 +0000 (10:25 +0000)]
[Sema][SVE] Reject arrays of sizeless types

The SVE ACLE doesn't allow arrays of sizeless types.  At the moment
clang accepts the TU:

  __SVInt8_t x[2];

but trying to code-generate it triggers the LLVM assertion:

  llvm/lib/IR/Type.cpp:588: static llvm::ArrayType* llvm::ArrayType::get(llvm::Type*, uint64_t): Assertion `isValidElementType(ElementType) && "Invalid type for array element!"' failed.

This patch reports an appropriate error instead.

The rules are slightly more restrictive than for general incomplete types.
For example:

  struct s;
  typedef struct s arr[2];

is valid as far as it goes, whereas arrays of sizeless types are
invalid in all contexts.  BuildArrayType therefore needs a specific
check for isSizelessType in addition to the usual handling of
incomplete types.

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

4 years ago[Sema][SVE] Reject by-copy capture of sizeless types
Richard Sandiford [Fri, 21 Feb 2020 17:12:44 +0000 (17:12 +0000)]
[Sema][SVE] Reject by-copy capture of sizeless types

Since fields can't have sizeless type, it also doesn't make sense
to capture sizeless types by value in lambda expressions.  This patch
makes sure that we diagnose that and that we use "sizeless type" rather
"incomplete type" in the associated message.  (Both are correct, but
"sizeless type" is more specific and hopefully more user-friendly.)

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

4 years agoAllow site-specific test_exec_root.
Dan Albert [Fri, 13 Mar 2020 19:23:45 +0000 (12:23 -0700)]
Allow site-specific test_exec_root.

Reviewers: EricWF, mclow.lists, #libc, ldionne

Reviewed By: #libc, ldionne

Subscribers: dexonsmith, ldionne, libcxx-commits

Tags: #libc

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

4 years ago[Sema][SVE] Don't allow fields to have sizeless type
Richard Sandiford [Fri, 21 Feb 2020 16:14:55 +0000 (16:14 +0000)]
[Sema][SVE] Don't allow fields to have sizeless type

The SVE ACLE doesn't allow fields to have sizeless type.  At the moment
clang accepts things like:

  struct s { __SVInt8_t x; } y;

but trying to code-generate it leads to LLVM asserts like:

  llvm/include/llvm/Support/TypeSize.h:126: uint64_t llvm::TypeSize::getFixedSize() const: Assertion `!IsScalable && "Request for a fixed size on a scalable object"' failed.

This patch adds an associated clang diagnostic.

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

4 years agoRevert "Revert "Update system_error tests for more platforms.""
Dan Albert [Fri, 13 Mar 2020 19:01:59 +0000 (12:01 -0700)]
Revert "Revert "Update system_error tests for more platforms.""

This time using old fashioned starts_with.

This reverts commit d4a8c3f2511f12e21e3c9adf58e162db25538c16.

4 years agoRevert "[ObjC][ARC] Check the basic block size before calling DominatorTree::dominate"
Reid Kleckner [Tue, 18 Feb 2020 22:51:32 +0000 (14:51 -0800)]
Revert "[ObjC][ARC] Check the basic block size before calling DominatorTree::dominate"

This reverts commit 5c3117b0a98dd11717eaffd7fb583985d39544b2

This should not be necessary after
7593a480dbce4e26f7dda4aa8f15bffd03acbfdb, and Florian Hahn has confirmed
that the problem no longer reproduces with this patch.

I happened to notice this code because the FIXME talks about
OrderedBasicBlock.

Reviewed By: fhahn, dexonsmith

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

4 years ago[X86][SSE] Prefer trunc(movd(x)) to pextrb(x,0)
Simon Pilgrim [Fri, 13 Mar 2020 18:42:43 +0000 (18:42 +0000)]
[X86][SSE] Prefer trunc(movd(x)) to pextrb(x,0)

If we're extracting the 0'th index of a v16i8 vector we're better off using MOVD than PEXTRB, unless we're storing the value or we require the implicit zero extension of PEXTRB.

The biggest perf diff is on SLM targets where MOVD (uops=1, lat=3 tp=1) is notably faster than PEXTRB (uops=2, lat=5, tp=4).

This matches what we already do for PEXTRW.

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

4 years ago[mlir] [VectorOps,LinAlg] Remove direct LLVM lowering for vector.broadcast
aartbik [Fri, 13 Mar 2020 16:35:29 +0000 (09:35 -0700)]
[mlir] [VectorOps,LinAlg] Remove direct LLVM lowering for vector.broadcast

Summary:
The direct lowering of vector.broadcast into LLVM has been replaced by
progressive lowering into elementary vector ops. This also required a
small refactoring of a llvm.mlir test that used a direct vector.broadcast
operator (just to define a matmul).

Reviewers: nicolasvasilache, andydavis1, rriddle

Reviewed By: nicolasvasilache

Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, llvm-commits

Tags: #llvm

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

4 years ago[SimplifyCFG] add test for chain of empty block conditional branches; NFC
Sanjay Patel [Fri, 13 Mar 2020 18:36:26 +0000 (14:36 -0400)]
[SimplifyCFG] add test for chain of empty block conditional branches; NFC

4 years ago[SLPVectorizer][SVE] Bail out early for scalable vector.
Huihui Zhang [Fri, 13 Mar 2020 18:23:01 +0000 (11:23 -0700)]
[SLPVectorizer][SVE] Bail out early for scalable vector.

Summary:
SLPVectorizer try to vectorize list of scalar instructions of the same type,
instructions already vectorized are rejected through isValidElementType().

Without this patch, tryToVectorizeList() will first try to determine vectorization
factor of a list of Instructions before checking whether each instruction has unsupported
type or not. For instructions already vectorized for SVE, it will crash at getVectorElementSize(),
where it try to return a fixed size.

This patch make sure invalid element types are rejected before trying to get vectorization
factor. This make sure we are not trying to vectorize instructions already vectorized.

Reviewers: sdesmalen, efriedma, spatel, RKSimon, ABataev, apazos, rengolin

Reviewed By: efriedma

Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

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

4 years agoDebug Info: Store the SDK in the DICompileUnit.
Adrian Prantl [Thu, 12 Mar 2020 21:19:04 +0000 (14:19 -0700)]
Debug Info: Store the SDK in the DICompileUnit.

This is another intermediate step for PR44213
(https://bugs.llvm.org/show_bug.cgi?id=44213).

This stores the SDK *name* in the debug info, to make it possible to
`-fdebug-prefix-map`-replace the sysroot with a recognizable string
and allowing the debugger to find a fitting SDK relative to itself,
not the machine the executable was compiled on.

rdar://problem/51645582

4 years ago[SimplifyCFG] regenerate complete test checks; NFC
Sanjay Patel [Fri, 13 Mar 2020 18:12:04 +0000 (14:12 -0400)]
[SimplifyCFG] regenerate complete test checks; NFC

4 years ago[SimplifyCFG] regenerate test checks; NFC
Sanjay Patel [Fri, 13 Mar 2020 18:08:54 +0000 (14:08 -0400)]
[SimplifyCFG] regenerate test checks; NFC

4 years ago[SimplifyCFG] fix formatting; NFC
Sanjay Patel [Fri, 13 Mar 2020 17:40:53 +0000 (13:40 -0400)]
[SimplifyCFG] fix formatting; NFC

4 years ago[SimplifyCFG] fix debug print formatting; NFC
Sanjay Patel [Fri, 13 Mar 2020 17:14:15 +0000 (13:14 -0400)]
[SimplifyCFG] fix debug print formatting; NFC

4 years ago[CVP,SCCP] Precommit test for D75055.
Florian Hahn [Mon, 24 Feb 2020 19:26:18 +0000 (19:26 +0000)]
[CVP,SCCP] Precommit test for D75055.

Test case for PR44949.

4 years agoUse 15 byte long nops on modern Intel processors
Philip Reames [Fri, 13 Mar 2020 17:49:38 +0000 (10:49 -0700)]
Use 15 byte long nops on modern Intel processors

Back in D42616, we switched our default nop length from 15 to 10 bytes because some platforms have painful decode stalls when encountering multiple instruction prefixes. (10 byte long nops come from the fact that prefixes are used to pad after 8 bytes, and some platforms have issues w/more than two prefixes.)

Based on Agner's guides, it appears to be the case that modern Intel (SandyBridge and later) can decode an arbitrary number of prefixes without issue. Intel's guide only provides up to 9 bytes; I read that as providing a safe default for all their chips. Older chips and Atom series have serious decode stalls. I can't find a conclusive reference beyond those two.

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

4 years ago[TableGen] Support combining AssemblerPredicates with ORs
Simon Cook [Fri, 13 Mar 2020 17:13:51 +0000 (17:13 +0000)]
[TableGen] Support combining AssemblerPredicates with ORs

For context, the proposed RISC-V bit manipulation extension has a subset
of instructions which require one of two SubtargetFeatures to be
enabled, 'zbb' or 'zbp', and there is no defined feature which both of
these can imply to use as a constraint either (see comments in D65649).

AssemblerPredicates allow multiple SubtargetFeatures to be declared in
the "AssemblerCondString" field, separated by commas, and this means
that the two features must both be enabled. There is no equivalent to
say that _either_ feature X or feature Y must be enabled, short of
creating a dummy SubtargetFeature for this purpose and having features X
and Y imply the new feature.

To solve the case where X or Y is needed without adding a new feature,
and to better match a typical TableGen style, this replaces the existing
"AssemblerCondString" with a dag "AssemblerCondDag" which represents the
same information. Two operators are defined for use with
AssemblerCondDag, "all_of", which matches the current behaviour, and
"any_of", which adds the new proposed ORing features functionality.

This was originally proposed in the RFC at
http://lists.llvm.org/pipermail/llvm-dev/2020-February/139138.html

Changes to all current backends are mechanical to support the replaced
functionality, and are NFCI.

At this stage, it is illegal to combine features with ands and ors in a
single AssemblerCondDag. I suspect this case is sufficiently rare that
adding more complex changes to support it are unnecessary.

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

4 years ago[lldb/Host] s/FindProcesses/FindProcessesImpl/ in windows/Host.cpp
Jonas Devlieghere [Fri, 13 Mar 2020 17:06:45 +0000 (10:06 -0700)]
[lldb/Host] s/FindProcesses/FindProcessesImpl/ in windows/Host.cpp

Fix the Windows build.

4 years ago[lldb/Test] Temporarily skip TestReproducerAttach on Linux
Jonas Devlieghere [Fri, 13 Mar 2020 17:03:52 +0000 (10:03 -0700)]
[lldb/Test] Temporarily skip TestReproducerAttach on Linux

The test is failing with an unexpected packet during replay. Temporarily
disabling the test while I setup and environment to investigate.

4 years agoRecommit "[SCCP] Use ValueLatticeElement instead of LatticeVal (NFCI)"
Florian Hahn [Fri, 13 Mar 2020 16:40:03 +0000 (16:40 +0000)]
Recommit "[SCCP] Use ValueLatticeElement instead of LatticeVal (NFCI)"

This patch should fix the cause of the stage2 failures and
PR45185.

This reverts the revert commit c52f839e723ee288db2a3e21860b011f6a9d707e.

4 years ago[clang-tidy] Update Abseil Duration Conversion check to find more cases.
Hyrum Wright [Tue, 3 Mar 2020 20:08:03 +0000 (15:08 -0500)]
[clang-tidy] Update Abseil Duration Conversion check to find more cases.

This change improves the check to handle cases with internal scalar
multiplication.

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

4 years ago[CostModel][X86] Improve ISD::CTTZ costs accounting for BSF/TZCNT implementations
Simon Pilgrim [Fri, 13 Mar 2020 16:50:57 +0000 (16:50 +0000)]
[CostModel][X86] Improve ISD::CTTZ costs accounting for BSF/TZCNT implementations

4 years ago[X86] Add cttz/ctlz tests for i686 with CMOV target
Simon Pilgrim [Fri, 13 Mar 2020 16:19:39 +0000 (16:19 +0000)]
[X86] Add cttz/ctlz tests for i686 with CMOV target

4 years ago[lldb/Test] Convert stdout to str by calling decode('utf-8') on it.
Jonas Devlieghere [Fri, 13 Mar 2020 16:49:00 +0000 (09:49 -0700)]
[lldb/Test] Convert stdout to str by calling decode('utf-8') on it.

Make sure both arguments to assertIn are of type str. This should fix
the following error:

TypeError: a bytes-like object is required, not 'str'.

4 years ago[SCEV] Fix usage of invalid IP with FoldingSet
Ehud Katz [Fri, 13 Mar 2020 16:31:47 +0000 (18:31 +0200)]
[SCEV] Fix usage of invalid IP with FoldingSet

Fix the use of invalid Insertion Point pointer with the UniqueSCEVs FoldingSet,
which caused memory corruption.

4 years ago[AssumeBundles] filter usefull attriutes to preserve
Tyker [Fri, 13 Mar 2020 13:35:26 +0000 (14:35 +0100)]
[AssumeBundles] filter usefull attriutes to preserve

Summary:
This patch will filter attributes to only preserve those that are usefull.
In the case of NoAlias it is filtered out not because it isn't usefull
but because it is incorrect to preserve it as it is only valdi for the
duration of the function.

Reviewers: jdoerfert

Reviewed By: jdoerfert

Subscribers: jdoerfert, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[AssumeBundles] Preserve Information in the inliner
Tyker [Fri, 13 Mar 2020 13:14:55 +0000 (14:14 +0100)]
[AssumeBundles] Preserve Information in the inliner

Summary:
during inling Create and insert an llvm.assume with attributes to preserve them.
to prevent any changes for now generation of llvm.assume is under a flag disabled by default.

Reviewers: jdoerfert

Reviewed By: jdoerfert

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[lldb/Reproducers] Intercept the FindProcesses API
Jonas Devlieghere [Fri, 13 Mar 2020 15:49:15 +0000 (08:49 -0700)]
[lldb/Reproducers] Intercept the FindProcesses API

This patch extends the reproducers to intercept calls to FindProcesses.
During capture it serializes the ProcessInstanceInfoList returned by the
API. During replay, it returns the serialized data instead of querying
the host.

The motivation for this patch is supporting the process attach workflow
during replay. Without this change it would incorrectly look for the
inferior on the host during replay and failing if no matching process
was found.

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

4 years ago[CodeView] Align type records on 4-bytes when emitting PDBs
Alexandre Ganea [Fri, 13 Mar 2020 16:22:09 +0000 (12:22 -0400)]
[CodeView] Align type records on 4-bytes when emitting PDBs

When emitting PDBs, the TypeStreamMerger class is used to merge .debug$T records from the input .OBJ files into the output .PDB stream.
Records in .OBJs are not required to be aligned on 4-bytes, and "The Netwide Assembler 2.14" generates non-aligned records.

When compiling with -DLLVM_ENABLE_ASSERTIONS=ON, an assert was triggered in MergingTypeTableBuilder when non-ghash merging was used.
With ghash merging there was no assert.
As a result, LLD could potentially generate a non-aligned TPI stream.

We now align records on 4-bytes when record indices are remapped, in TypeStreamMerger::remapIndices().

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

4 years ago[Attributor] Detect possibly unbounded cycles in functions
omarahmed1111 [Fri, 13 Mar 2020 15:30:36 +0000 (10:30 -0500)]
[Attributor] Detect possibly unbounded cycles in functions

This patch add mayContainUnboundedCycle helper function which checks whether a function has any cycle which we don't know if it is bounded or not.
Loops with maximum trip count are considered bounded, any other cycle not.
It also contains some fixed tests and some added tests contain bounded and
unbounded loops and non-loop cycles.

Reviewed By: jdoerfert, uenoku, baziotis

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

4 years ago[LLD][ELF][Hexagon] Support GDPLT transforms
Sid Manning [Mon, 10 Feb 2020 23:27:53 +0000 (17:27 -0600)]
[LLD][ELF][Hexagon] Support GDPLT transforms

Hexagon ABI specifies that call x@gdplt is transformed to call __tls_get_addr.

Example:
     call x@gdplt
is changed to
     call __tls_get_addr

When x is an external tls variable.

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

4 years ago[Attributor] Improve noalias preservation using reachability
Pankaj Gode [Fri, 13 Mar 2020 15:39:08 +0000 (21:09 +0530)]
[Attributor] Improve noalias preservation using reachability

Resolution for below fixme:
(ii) Check whether the value is captured in the scope using AANoCapture.
FIXME: This is conservative though, it is better to look at CFG and
             check only uses possibly executed before this callsite.

Propagates caller argument's noalias attribute to callee.

Reviewed by: jdoerfert, uenoku

Reviewers: jdoerfert, sstefan1, uenoku

Subscribers: uenoku, sstefan1, hiraditya, llvm-commits

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

4 years ago[X86] combineExtractWithShuffle - pull out repeated getSizeInBits() call. NFC.
Simon Pilgrim [Fri, 13 Mar 2020 15:35:13 +0000 (15:35 +0000)]
[X86] combineExtractWithShuffle - pull out repeated getSizeInBits() call. NFC.

4 years ago[X86] LowerEXTRACT_VECTOR_ELT - pull out repeated getOperand() calls. NFC.
Simon Pilgrim [Fri, 13 Mar 2020 14:58:16 +0000 (14:58 +0000)]
[X86] LowerEXTRACT_VECTOR_ELT - pull out repeated getOperand() calls. NFC.

Also, cleanup LowerEXTRACT_VECTOR_ELT_SSE4 comments which had references to non-constant extraction indices.

4 years ago[llvm-objdump] --syms: print 'u' for STB_GNU_UNIQUE
Fangrui Song [Sat, 7 Mar 2020 05:00:15 +0000 (21:00 -0800)]
[llvm-objdump] --syms: print 'u' for STB_GNU_UNIQUE

GCC when configured with --enable-gnu-unique (default on glibc>=2.11)
emits STB_GNU_UNIQUE for certain objects which are otherwise emitted as
STT_OBJECT, such as an inline function's static local variable or its
guard variable, and a static data member of a template.

Clang does not implement -fgnu-unique.

Implementing it as a binding is strange and the feature itself is
considered by some as a misfeature.

Reviewed By: grimar, jhenderson

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

4 years ago[llvm-objdump] --syms: print 'i' for STT_GNU_IFUNC
Fangrui Song [Sat, 7 Mar 2020 02:51:39 +0000 (18:51 -0800)]
[llvm-objdump] --syms: print 'i' for STT_GNU_IFUNC

Reviewed By: grimar, Higuoxing, jhenderson

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

4 years ago[llvm-objdump][test] Reorganize ELF --syms tests
Fangrui Song [Sat, 7 Mar 2020 04:22:59 +0000 (20:22 -0800)]
[llvm-objdump][test] Reorganize ELF --syms tests

Merge symbol-table-elf.test and common-symbol-elf.test, and add some
more tests (invalid st_type, STT_COMMON, STT_GNU_IFUNC, STT_HIOS, STT_LOPROC, SHN_UNDEF, SHN_ABS, SHN_COMMON, STB_GNU_UNIQUE, invalid binding, etc) to test/llvm-objdump/ELF/symbol-table.test

The naming follows test/llvm-{readobj,objcopy}/ELF .

Some discrepancy from GNU objdump:

* STT_COMMON: can be produced with `ld.bfd -r -z common`, but it almost never exists in practice
* STT_GNU_IFUNC: will be fixed by D75793
* STB_GNU_UNIQUE: will be fixed by D75797
* STT_TLS: GNU objdump does not print 'O'
* unknown binding: GNU objdump does not print 'g'. This probably does not matter.
* A reserved symbol index is displayed as *ABS* in GNU objdump. It is not clear what we should print.

Reviewed By: grimar

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

4 years ago[CMake] Explicitly specify paths to libc++abi in CrossWinToARMLinux.cmake
Sergej Jaskiewicz [Fri, 13 Mar 2020 14:55:18 +0000 (17:55 +0300)]
[CMake] Explicitly specify paths to libc++abi in CrossWinToARMLinux.cmake

Summary:
D69169, which was necessary for running libc++ tests on remote host, got reverted. I couldn't think of a less invasive way to achieve this behavior but specify libc++abi paths in our cache file.

Reviewers: vvereschaka, aorlov, andreil99, EricWF

Reviewed By: vvereschaka

Subscribers: mgorny, kristof.beyls, ldionne, cfe-commits

Tags: #clang

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

4 years ago[OPENMP]Reduce number of captured global vars.
Alexey Bataev [Thu, 12 Mar 2020 16:52:02 +0000 (12:52 -0400)]
[OPENMP]Reduce number of captured global vars.

Try to reduce the number of global vars captured in the OpenMP regions
by capturing them only the regions, which mark them as not-shared.

4 years agoTableGen: Fix typo
Matt Arsenault [Fri, 14 Feb 2020 02:57:20 +0000 (21:57 -0500)]
TableGen: Fix typo

4 years ago[SimplifyCFG] convert if-else chain to switch; NFC
Sanjay Patel [Fri, 13 Mar 2020 14:27:02 +0000 (10:27 -0400)]
[SimplifyCFG] convert if-else chain to switch; NFC

Fix formatting of related function names while changing the code.

4 years agoRevert "[ObjC][ARC] Don't remove autoreleaseRV/retainRV pairs if the call isn't"
Nico Weber [Fri, 13 Mar 2020 14:06:29 +0000 (10:06 -0400)]
Revert "[ObjC][ARC] Don't remove autoreleaseRV/retainRV pairs if the call isn't"

This reverts commit 1f5b471b8bf4c6d22fb13d8e24bc31c75245b0d0.
Causes asserts when building code with arc. See
https://bugs.chromium.org/p/chromium/issues/detail?id=1061289#c2
for a full repro. Will post a creduced repro once creduce is done
running.

4 years ago[gn build] Port 512767eb3fe
LLVM GN Syncbot [Fri, 13 Mar 2020 14:09:37 +0000 (14:09 +0000)]
[gn build] Port 512767eb3fe

4 years ago[ExpandMemCmp][NFC] Add more tests.
Clement Courbet [Fri, 13 Mar 2020 13:49:54 +0000 (14:49 +0100)]
[ExpandMemCmp][NFC] Add more tests.

4 years agoAdd CppCoreGuidelines I.2 "Avoid non-const global variables" check
Kim Viggedal [Fri, 13 Mar 2020 14:05:13 +0000 (10:05 -0400)]
Add CppCoreGuidelines I.2 "Avoid non-const global variables" check

Cpp Core Guideline I.2, a.k.a "Avoid non-const global variables"
For detailed documentation, see:
https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#i2-avoid-non-const-global-variables

4 years ago[SCEV] Add missing cache queries
Ehud Katz [Fri, 13 Mar 2020 13:32:43 +0000 (15:32 +0200)]
[SCEV] Add missing cache queries

Calculating SCEVs can be cumbersome, and may take very long time (even
hours, for very long expressions). To prevent recalculating expressions
over and over again, we cache them.
This change add cache queries to key positions, to prevent recalculation
of the expressions.

Fix PR43571.

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

4 years ago[AArch64][SVE] Add the @llvm.aarch64.sve.dup.x intrinsic
Andrzej Warzynski [Tue, 10 Mar 2020 09:40:49 +0000 (09:40 +0000)]
[AArch64][SVE] Add the @llvm.aarch64.sve.dup.x intrinsic

Summary:
This intrinsic implements the unpredicated duplication of scalar values
and is mapped to (through ISD::SPLAT_VECTOR):
  * DUP <Zd>.<T>, #<imm>
  * DUP <Zd>.<T>, <R><n|SP>

Reviewed by: sdesmalen

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

4 years ago[Clang][Driver] In -fintegrated-cc1 mode, avoid crashing on exit after a compiler...
Alexandre Ganea [Fri, 13 Mar 2020 12:15:20 +0000 (08:15 -0400)]
[Clang][Driver] In -fintegrated-cc1 mode, avoid crashing on exit after a compiler crash

After a crash catched by the CrashRecoveryContext, this patch prevents from accessing dangling pointers in TimerGroup structures before the clang tool exits. Previously, the default TimerGroup had internal linked lists which were still pointing to old Timer or TimerGroup instances, which lived in stack frames released by the CrashRecoveryContext.

Fixes PR45164.

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

4 years ago[HIP] Mark kernels with uniform-work-group-size=true
Yaxun (Sam) Liu [Thu, 12 Mar 2020 16:49:26 +0000 (12:49 -0400)]
[HIP] Mark kernels with uniform-work-group-size=true

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

4 years agoAdded 'const' as suggested by ClangTidy llvm-qualified-auto
Dmitri Gribenko [Fri, 13 Mar 2020 10:49:23 +0000 (11:49 +0100)]
Added 'const' as suggested by ClangTidy llvm-qualified-auto

4 years ago[ARM] Optimise ASRL/LSRL to smaller shifts using demand bits.
David Green [Fri, 13 Mar 2020 09:04:50 +0000 (09:04 +0000)]
[ARM] Optimise ASRL/LSRL to smaller shifts using demand bits.

The ASRL/LSRL long shifts are generated from 64bit shifts. Once we have
them, it might turn out that enough of the 64bit result was not required
that we can use a smaller shift to perform the same result. As the
smaller shift can in general be folded in more way, such as into add
instructions in one of the test cases here, we can use the demand bit
analysis to prefer the smaller shifts where we can.

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

4 years ago[gn build] (manually) port ce79c4246
Nico Weber [Fri, 13 Mar 2020 10:08:16 +0000 (06:08 -0400)]
[gn build] (manually) port ce79c4246

4 years ago[yaml2obj][obj2yaml][test] - Add base tests for relocation addends.
Georgii Rymar [Mon, 2 Mar 2020 16:59:11 +0000 (19:59 +0300)]
[yaml2obj][obj2yaml][test] - Add base tests for relocation addends.

We had no test for `Addend` field of a relocation. Though the
current behavior is not ideal and might need to be fixed.

This patch adds 2 test cases to document the current
behavior and add a few FIXMEs. These FIXME are fixed in the
follow-up: https://reviews.llvm.org/D75527

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

4 years agoRefactor SourceLocationTest to `using namespace`
Marcel Hlopko [Fri, 13 Mar 2020 09:54:18 +0000 (10:54 +0100)]
Refactor SourceLocationTest to `using namespace`

Summary: Only for the readability reasons.

Reviewers: gribozavr

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[Sema] Fix location of star ('*') inside MemberPointerTypeLoc
Marcel Hlopko [Fri, 13 Mar 2020 09:47:37 +0000 (10:47 +0100)]
[Sema] Fix location of star ('*') inside MemberPointerTypeLoc

Summary: Copy of https://reviews.llvm.org/D72073?id=235842, submitting with ilya-biryukov's permission.

Reviewers: gribozavr, gribozavr2

Reviewed By: gribozavr2

Subscribers: mgorny, gribozavr2, cfe-commits

Tags: #clang

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

4 years agoModernize DeclTest
Marcel Hlopko [Fri, 13 Mar 2020 09:37:35 +0000 (10:37 +0100)]
Modernize DeclTest

Summary:
This patch removes a call to the old ASTUnit::findFileRegionDecls and
replaces it with ast matchers.

Reviewers: gribozavr, gribozavr2

Reviewed By: gribozavr2

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[ARM] Constant long shift combines
David Green [Thu, 12 Mar 2020 19:40:27 +0000 (19:40 +0000)]
[ARM] Constant long shift combines

This changes the way that asrl and lsrl intrinsics are lowered, going
via a the ISEL ASRL and LSLL nodes instead of straight to machine nodes.
On top of that, it adds some constant folds for long shifts, in case it
turns out that the shift amount was either constant or 0.

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

4 years ago[clangd] Populate PreambleData::CompileCommand and make use of it inside buildPreamble
Kadir Cetinkaya [Wed, 11 Mar 2020 15:34:01 +0000 (16:34 +0100)]
[clangd] Populate PreambleData::CompileCommand and make use of it inside buildPreamble

Reviewers: sammccall

Subscribers: ilya-biryukov, javed.absar, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[CodeGenPrepare] Expand freeze conversion to support fcmp and icmp with null
Juneyoung Lee [Thu, 12 Mar 2020 07:34:43 +0000 (16:34 +0900)]
[CodeGenPrepare] Expand freeze conversion to support fcmp and icmp with null

Summary:
This is a simple patch that expands https://reviews.llvm.org/D75859 to pointer comparison and fcmp

Checked with Alive2

Reviewers: reames, jdoerfert

Reviewed By: jdoerfert

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[libunwind] Silence warnings when __mips_hard_float is not defined
Mikael Holmen [Fri, 13 Mar 2020 08:18:33 +0000 (09:18 +0100)]
[libunwind] Silence warnings when __mips_hard_float is not defined

The warnings started showing up for me with c53c2058ffb8 which builds
Registers.hpp.

4 years agoAdd tests to Transforms/CodeGenPrepare/X86/freeze-cmp.ll before commiting D76048
Juneyoung Lee [Fri, 13 Mar 2020 08:18:42 +0000 (17:18 +0900)]
Add tests to Transforms/CodeGenPrepare/X86/freeze-cmp.ll before commiting D76048

4 years ago[PowerPC] Replace the PPCISD:: SExtVElems with ISD::SIGN_EXTEND_INREG to leverage...
QingShan Zhang [Fri, 13 Mar 2020 07:25:55 +0000 (07:25 +0000)]
[PowerPC] Replace the PPCISD:: SExtVElems with ISD::SIGN_EXTEND_INREG to leverage the combine rules

The PPCISD::SExtVElems was added by commit https://reviews.llvm.org/D34009. However,
we have another ISD node ISD::SIGN_EXTEND_INREG that perfectly match the semantics
of SExtVElems. And the DAGCombiner has some combine rules for SIGN_EXTEND_INREG
that produce better code.

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

4 years ago[X86] Add isel patterns for X86VBroadcast with i16 truncates from i16->i64 zextload...
Craig Topper [Fri, 13 Mar 2020 06:40:04 +0000 (23:40 -0700)]
[X86] Add isel patterns for X86VBroadcast with i16 truncates from i16->i64 zextload/extload.

We can form vpbroadcastw with a folded load.

We had patterns for i16->i32 zextload/extload, but nothing prevents
i64 from occuring.

I'd like to move this all to DAG combine to fix more cases, but
this is trivial fix to minimize test diffs when moving to a combine.

4 years ago[X86] Add test cases for failures to form vbroadcastw due to isTypeDesirableForOp...
Craig Topper [Fri, 13 Mar 2020 06:07:06 +0000 (23:07 -0700)]
[X86] Add test cases for failures to form vbroadcastw due to isTypeDesirableForOp preventing load shrinking to i16.

These are based on existing test cases but use i64 instead of i32.
Some of these end up with i64 zextload/extloads from i16 that we
don't have isel patterns for.

Some of the other cases fail because isTypeDesirableForOp prevents
shrinking the (trunc (i64 (srl (load)))) directly. So we try
to shrink based on the (i64 (srl (load))) but we need 64 - shift_amount
to be a power of 2 to do that shrink.

4 years ago[Attributor] IPO across definition boundary of a function marked alwaysinline
Johannes Doerfert [Fri, 13 Mar 2020 05:32:38 +0000 (00:32 -0500)]
[Attributor] IPO across definition boundary of a function marked alwaysinline

Reviewed By: jdoerfert

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

4 years agoRevert "[Attributor] Enable test with update check lines"
Johannes Doerfert [Fri, 13 Mar 2020 05:59:02 +0000 (00:59 -0500)]
Revert "[Attributor] Enable test with update check lines"

This reverts commit 13def55b3f86543871cc6f5c2ec893dc3e0b45fa.

This broke a buildbot, will investigate.

4 years ago[ELF] Correct error message when OUTPUT_FORMAT is used
Shoaib Meenai [Thu, 12 Mar 2020 22:25:36 +0000 (15:25 -0700)]
[ELF] Correct error message when OUTPUT_FORMAT is used

Any OUTPUT_FORMAT in a linker script overrides the emulation passed on
the command line, so record the passed bfdname and use that in the error
message about incompatible input files.

This prevents confusing error messages. For example, if you explicitly
pass `-m elf_x86_64` to LLD but accidentally include a linker script
which sets `OUTPUT_FORMAT(elf32-i386)`, LLD would previously complain
about your input files being compatible with elf_x86_64, which isn't the
actual issue, and is confusing because the input files are in fact
x86-64 ELF files.

Interestingly enough, this also prevents a segfault! When we don't pass
`-m` and we have an object file which is incompatible with the
`OUTPUT_FORMAT` set by a linker script, the object file is checked for
compatibility before it's added to the objectFiles vector.
config->emulation, objectFiles, and sharedFiles will all be empty, so
we'll attempt to access bitcodeFiles[0], but bitcodeFiles is also empty,
so we'll segfault. This commit prevents the segfault by adding
OUTPUT_FORMAT as a possible source of machine configuration, and it also
adds an llvm_unreachable to diagnose similar issues in the future.

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