platform/upstream/llvm.git
5 years ago[MSAN] Add unary FNeg visitor to the MemorySanitizer
Cameron McInally [Wed, 5 Jun 2019 22:37:05 +0000 (22:37 +0000)]
[MSAN] Add unary FNeg visitor to the MemorySanitizer

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

llvm-svn: 362664

5 years agoAllow target to handle STRICT floating-point nodes
Ulrich Weigand [Wed, 5 Jun 2019 22:33:10 +0000 (22:33 +0000)]
Allow target to handle STRICT floating-point nodes

The ISD::STRICT_ nodes used to implement the constrained floating-point
intrinsics are currently never passed to the target back-end, which makes
it impossible to handle them correctly (e.g. mark instructions are depending
on a floating-point status and control register, or mark instructions as
possibly trapping).

This patch allows the target to use setOperationAction to switch the action
on ISD::STRICT_ nodes to Legal. If this is done, the SelectionDAG common code
will stop converting the STRICT nodes to regular floating-point nodes, but
instead pass the STRICT nodes to the target using normal SelectionDAG
matching rules.

To avoid having the back-end duplicate all the floating-point instruction
patterns to handle both strict and non-strict variants, we make the MI
codegen explicitly aware of the floating-point exceptions by introducing
two new concepts:

- A new MCID flag "mayRaiseFPException" that the target should set on any
  instruction that possibly can raise FP exception according to the
  architecture definition.
- A new MI flag FPExcept that CodeGen/SelectionDAG will set on any MI
  instruction resulting from expansion of any constrained FP intrinsic.

Any MI instruction that is *both* marked as mayRaiseFPException *and*
FPExcept then needs to be considered as raising exceptions by MI-level
codegen (e.g. scheduling).

Setting those two new flags is straightforward. The mayRaiseFPException
flag is simply set via TableGen by marking all relevant instruction
patterns in the .td files.

The FPExcept flag is set in SDNodeFlags when creating the STRICT_ nodes
in the SelectionDAG, and gets inherited in the MachineSDNode nodes created
from it during instruction selection. The flag is then transfered to an
MIFlag when creating the MI from the MachineSDNode. This is handled just
like fast-math flags like no-nans are handled today.

This patch includes both common code changes required to implement the
new features, and the SystemZ implementation.

Reviewed By: andrew.w.kaylor

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

llvm-svn: 362663

5 years agoRevert "[AArch64][GlobalISel] Optimize G_FCMP + G_SELECT pairs when G_SELECT is fp"
Petr Hosek [Wed, 5 Jun 2019 22:27:31 +0000 (22:27 +0000)]
Revert "[AArch64][GlobalISel] Optimize G_FCMP + G_SELECT pairs when G_SELECT is fp"

This reverts commit r362435 as this triggers ICE, see PR42129 for details.

llvm-svn: 362662

5 years agoAMDGPU: Invert frame index offset interpretation
Matt Arsenault [Wed, 5 Jun 2019 22:20:47 +0000 (22:20 +0000)]
AMDGPU: Invert frame index offset interpretation

Since the beginning, the offset of a frame index has been consistently
interpreted backwards. It was treating it as an offset from the
scratch wave offset register as a frame register. The correct
interpretation is the offset from the SP on entry to the function,
before the prolog. Frame index elimination then should select either
SP or another register as an FP.

Treat the scratch wave offset on kernel entry as the pre-incremented
SP. Rely more heavily on the standard hasFP and frame pointer
elimination logic, and clean up the private reservation code. This
saves a copy in most callee functions.

The kernel prolog emission code is still kind of a mess relying on
checking the uses of physical registers, which I would prefer to
eliminate.

Currently selection directly emits MUBUF instructions, which require
using a reference to some register. Use the register chosen for SP,
and then ignore this later. This should probably be cleaned up to use
pseudos that don't refer to any specific base register until frame
index elimination.

Add a workaround for shaders using large numbers of SGPRs. I'm not
sure these cases were ever working correctly, since as far as I can
tell the logic for figuring out which SGPR is the scratch wave offset
doesn't match up with the shader input initialization in the shader
programming guide.

llvm-svn: 362661

5 years ago[libcxx][test] Include test_workarounds.h where needed
Louis Dionne [Wed, 5 Jun 2019 21:54:34 +0000 (21:54 +0000)]
[libcxx][test] Include test_workarounds.h where needed

Some tests require `TEST_WORKAROUND_CONSTEXPR_IMPLIES_NOEXCEPT`, but they
did not include the header that defines that macro.

Thanks to Michael Park for the patch.

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

llvm-svn: 362660

5 years agoUpdate issue statuses. Reviewed as https://reviews.llvm.org/D62932
Marshall Clow [Wed, 5 Jun 2019 21:52:19 +0000 (21:52 +0000)]
Update issue statuses. Reviewed as https://reviews.llvm.org/D62932

llvm-svn: 362659

5 years ago[EarlyCSE] Add tests for negated min/max/abs [NFC]
Joseph Tremoulet [Wed, 5 Jun 2019 21:30:10 +0000 (21:30 +0000)]
[EarlyCSE] Add tests for negated min/max/abs [NFC]

Summary:
I'm planning to update the hashing logic to recognize their equivalence
in a subsequent change (D62644).

Reviewers: spatel

Reviewed By: spatel

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 362657

5 years ago[CallSite removal] Refactoring llvm::InlineFunction APIs
Mircea Trofin [Wed, 5 Jun 2019 21:28:13 +0000 (21:28 +0000)]
[CallSite removal] Refactoring llvm::InlineFunction APIs

Summary:
This change only unifies the API previous API pair accepting
CallInst and InvokeInst, thus making it easier to refactor
inliner pass ode to CallBase. The implementation of the unified
API still relies on the CallSite implementation.

Reviewers: eraman, chandlerc, jdoerfert

Reviewed By: jdoerfert

Subscribers: jdoerfert, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 362656

5 years ago[InstCombine] simplify code for bitcast of insertelement; NFC
Sanjay Patel [Wed, 5 Jun 2019 21:26:52 +0000 (21:26 +0000)]
[InstCombine] simplify code for bitcast of insertelement; NFC

llvm-svn: 362655

5 years agoNewGVN: Handle addrspacecast
Matt Arsenault [Wed, 5 Jun 2019 21:15:52 +0000 (21:15 +0000)]
NewGVN: Handle addrspacecast

The AllConstant check needs to be moved out of the if/else if chain to
avoid a test regression. The "there is no SimplifyZExt" comment
puzzles me, since there is SimplifyCastInst. Additionally, the
Simplify* calls seem to not see the operand as constant, so this needs
to be tried if the simplify failed.

llvm-svn: 362653

5 years agoLLVM IR: Generate new-style byval-with-Type from Clang
Tim Northover [Wed, 5 Jun 2019 21:12:14 +0000 (21:12 +0000)]
LLVM IR: Generate new-style byval-with-Type from Clang

LLVM IR recently added a Type parameter to the byval Attribute, so that
when pointers become opaque and no longer have an element type the
information will still be present in IR.

For now the Type parameter is optional (which is why Clang didn't need
this change at the time), but it will become mandatory soon.

llvm-svn: 362652

5 years agoFix FileCheck prefixes in test case.
Akira Hatanaka [Wed, 5 Jun 2019 21:11:06 +0000 (21:11 +0000)]
Fix FileCheck prefixes in test case.

llvm-svn: 362651

5 years ago[WebAssembly] Improve lto/comdat.ll test. NFC.
Sam Clegg [Wed, 5 Jun 2019 21:08:30 +0000 (21:08 +0000)]
[WebAssembly] Improve lto/comdat.ll test. NFC.

We were not previously testing the comdat exclusion in bitcode objects
because we were linking two copies of the .bc file and the
`linkonce_odr` linkage type was removing the duplicate `_start` at
the LTO stage.

Now we link an bitcode and non-bitcode version both of which contains a
copy of _start.  We link them in both orders, which means this test will
fail if comdat exclusion is not working correctly in bitcode parsing.

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

llvm-svn: 362650

5 years agoSpeedup to_string and to_wstring for integers using stack buffer and SSO. Reviewed...
Marshall Clow [Wed, 5 Jun 2019 21:04:26 +0000 (21:04 +0000)]
Speedup to_string and to_wstring for integers using stack buffer and SSO. Reviewed as https://reviews.llvm.org/D59178  Thanks to ivafanas for all his work on this patch.

llvm-svn: 362649

5 years ago[X86] Fix mistake that marked VADDSSrrb_Int/VADDSDrrb_Int/VMULSSrrb_Int/VMULSDrrb_Int...
Craig Topper [Wed, 5 Jun 2019 21:00:31 +0000 (21:00 +0000)]
[X86] Fix mistake that marked VADDSSrrb_Int/VADDSDrrb_Int/VMULSSrrb_Int/VMULSDrrb_Int as commutable.

One of the sources controls the pass through value for the upper bits
of the result so we can't really commute it.

In practice this problem isn't a functional issue because we would
only try to commute this instruction in order to fold a load. But
we can't do embedded rounding and fold a load at the same time. So
the load fold would never succeed so I don't think we would ever
commute or at least keep the version after commuting.

llvm-svn: 362647

5 years ago[clang-format][NFC] Fix BS_Allman style example in the header docs are generated...
Jan Korous [Wed, 5 Jun 2019 20:59:48 +0000 (20:59 +0000)]
[clang-format][NFC] Fix BS_Allman style example in the header docs are generated from

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

llvm-svn: 362646

5 years ago[WebAssembly] Use Emscripten triples in PIC tests.
Dan Gohman [Wed, 5 Jun 2019 20:59:20 +0000 (20:59 +0000)]
[WebAssembly] Use Emscripten triples in PIC tests.

With r362638, llc doesn't support -relocation-model=pic with non-Emscripten
triples. Update these tests in lld which use -relocation-model=pic to also
use Emscripten triples.

llvm-svn: 362645

5 years ago[LOOPINFO] Extend Loop object to add utilities to get the loop bounds,
Whitney Tsang [Wed, 5 Jun 2019 20:42:47 +0000 (20:42 +0000)]
[LOOPINFO] Extend Loop object to add utilities to get the loop bounds,
step, and loop induction variable.

Summary: This PR extends the loop object with more utilities to get loop
bounds, step, and loop induction variable. There already exists passes
which try to obtain the loop induction variable in their own pass, e.g.
loop interchange. It would be useful to have a common area to get these
information.

/// Example:
/// for (int i = lb; i < ub; i+=step)
///   <loop body>
/// --- pseudo LLVMIR ---
/// beforeloop:
///   guardcmp = (lb < ub)
///   if (guardcmp) goto preheader; else goto afterloop
/// preheader:
/// loop:
///   i1 = phi[{lb, preheader}, {i2, latch}]
///   <loop body>
///   i2 = i1 + step
/// latch:
///   cmp = (i2 < ub)
///   if (cmp) goto loop
/// exit:
/// afterloop:
///
/// getBounds
///   getInitialIVValue      --> lb
///   getStepInst            --> i2 = i1 + step
///   getStepValue           --> step
///   getFinalIVValue        --> ub
///   getCanonicalPredicate  --> '<'
///   getDirection           --> Increasing
/// getInductionVariable          --> i1
/// getAuxiliaryInductionVariable --> {i1}
/// isCanonical                   --> false

Reviewers: kbarton, hfinkel, dmgreen, Meinersbur, jdoerfert, syzaara,
fhahn
Reviewed By: kbarton
Subscribers: tvvikram, bmahjour, etiotto, fhahn, jsji, hiraditya,
llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D60565

llvm-svn: 362644

5 years agoInstCombine: correctly change byval type attribute alongside call args.
Tim Northover [Wed, 5 Jun 2019 20:38:17 +0000 (20:38 +0000)]
InstCombine: correctly change byval type attribute alongside call args.

When the byval attribute has a type, it must match the pointee type of
any parameter; but InstCombine was not updating the attribute when
folding casts of various kinds away.

llvm-svn: 362643

5 years agoIR: make getParamByValType Just Work. NFC.
Tim Northover [Wed, 5 Jun 2019 20:37:47 +0000 (20:37 +0000)]
IR: make getParamByValType Just Work. NFC.

Most parts of LLVM don't care whether the byval type is derived from an
explicit Attribute or from the parameter's pointee type, so it makes
sense for the main access function to just return the right value.

The very few users who do care (only BitcodeReader so far) can find out
how it's specified by accessing the Attribute directly.

llvm-svn: 362642

5 years agoAMDGPU: Remove amdgpu-max-work-group-size attribute
Matt Arsenault [Wed, 5 Jun 2019 20:32:32 +0000 (20:32 +0000)]
AMDGPU: Remove amdgpu-max-work-group-size attribute

This has been deprecated for a long time, and mesa recently switched
to amdgpu-flat-work-group-size.

llvm-svn: 362641

5 years agoAMDGPU: Fix using 2 different enums for same operand flags
Matt Arsenault [Wed, 5 Jun 2019 20:32:25 +0000 (20:32 +0000)]
AMDGPU: Fix using 2 different enums for same operand flags

These enums are really for the same namespace of flags set on
arbitrary MachineOperands, so merge them to avoid value collisions.

llvm-svn: 362640

5 years ago[NativeProcessDarwin] Remove dead code. NFCI.
Davide Italiano [Wed, 5 Jun 2019 20:23:03 +0000 (20:23 +0000)]
[NativeProcessDarwin] Remove dead code. NFCI.

llvm-svn: 362639

5 years ago[WebAssembly] Limit PIC support to the Emscripten target
Dan Gohman [Wed, 5 Jun 2019 20:01:01 +0000 (20:01 +0000)]
[WebAssembly] Limit PIC support to the Emscripten target

The current PIC support currently only works with Emscripten, so
disable it for other targets.

This is the PIC portion of https://reviews.llvm.org/D62542.

Reviewed By: dschuff, sbc100

llvm-svn: 362638

5 years ago[cmake] Remove duplicate TestingSupport library for linking
Pengxuan Zheng [Wed, 5 Jun 2019 19:44:08 +0000 (19:44 +0000)]
[cmake] Remove duplicate TestingSupport library for linking

Summary: This patch cleans up a duplicate use of TestingSupport library.

Subscribers: mgorny, cfe-commits

Tags: #clang

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

llvm-svn: 362637

5 years ago[GWP-ASan] Core Guarded Pool Allocator [4].
Mitch Phillips [Wed, 5 Jun 2019 19:42:48 +0000 (19:42 +0000)]
[GWP-ASan] Core Guarded Pool Allocator [4].

Summary:
See D60593 for further information.

This patch introduces the core of GWP-ASan, being the guarded pool allocator. This class contains the logic for creating and maintaining allocations in the guarded pool. Its public interface is to be utilised by supporting allocators in order to provide sampled guarded allocation behaviour.

This patch also contains basic functionality tests of the allocator as unittests. The error-catching behaviour will be tested in upcoming patches that use Scudo as an implementing allocator.

Reviewers: vlad.tsyrklevich, eugenis, jfb

Reviewed By: vlad.tsyrklevich

Subscribers: dexonsmith, kubamracek, mgorny, cryptoad, jfb, #sanitizers, llvm-commits, morehouse

Tags: #sanitizers, #llvm

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

llvm-svn: 362636

5 years ago[X86][SSE] Add vector tests to cover more isNegatibleForFree/GetNegatedExpression...
Simon Pilgrim [Wed, 5 Jun 2019 18:55:54 +0000 (18:55 +0000)]
[X86][SSE] Add vector tests to cover more isNegatibleForFree/GetNegatedExpression cases (PR42105)

Some already combine correctly, but vector constant analysis is weak.

llvm-svn: 362633

5 years ago[analyzer] PathDiagnosticPopUpPiece: working with CharSourceRange
Csaba Dabis [Wed, 5 Jun 2019 18:55:39 +0000 (18:55 +0000)]
[analyzer] PathDiagnosticPopUpPiece: working with CharSourceRange

Summary: Sometimes we are at character boundaries so past the token-range.
llvm-svn: 362632

5 years ago[NFC][Reassociate] Fix mistake in 468b2ad
Cameron McInally [Wed, 5 Jun 2019 18:50:07 +0000 (18:50 +0000)]
[NFC][Reassociate] Fix mistake in 468b2ad

Missed 2 'fast fsub(0.0,X) -> fneg(X)' changes.

llvm-svn: 362631

5 years ago[NFC][Reassociate] Add unary fneg tests to fast-basictest.ll
Cameron McInally [Wed, 5 Jun 2019 18:35:54 +0000 (18:35 +0000)]
[NFC][Reassociate] Add unary fneg tests to fast-basictest.ll

llvm-svn: 362630

5 years ago[X86] Add the vector integer min/max instructions to isAssociativeAndCommutative.
Craig Topper [Wed, 5 Jun 2019 18:25:09 +0000 (18:25 +0000)]
[X86] Add the vector integer min/max instructions to isAssociativeAndCommutative.

As far as I know these should be freely reassociatable just like
the floating point MAXC/MINC instructions.

The *reduce* test changes are largely regressions and caused by
the "generic" CPU we default to not having a scheduler model.

The machine-combiner-int-vec.ll test shows the positive benefits
of this change.

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

llvm-svn: 362629

5 years ago[Tests] Add poison inference tests for indvars showing both existing transforms,...
Philip Reames [Wed, 5 Jun 2019 18:00:59 +0000 (18:00 +0000)]
[Tests] Add poison inference tests for indvars showing both existing transforms, and some room for improvement

llvm-svn: 362628

5 years ago[NFC][Reassociate] Regenerate CHECKs for fast-basictest.ll
Cameron McInally [Wed, 5 Jun 2019 18:00:27 +0000 (18:00 +0000)]
[NFC][Reassociate] Regenerate CHECKs for fast-basictest.ll

llvm-svn: 362627

5 years ago[WebAssembly] Handle object parsing more like the ELF backend
Sam Clegg [Wed, 5 Jun 2019 17:50:45 +0000 (17:50 +0000)]
[WebAssembly] Handle object parsing more like the ELF backend

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

llvm-svn: 362626

5 years ago[lld] Explicitly ignore comdat groups when parsing LTO object(s)
Sam Clegg [Wed, 5 Jun 2019 17:39:37 +0000 (17:39 +0000)]
[lld] Explicitly ignore comdat groups when parsing LTO object(s)

Any symbols defined in the LTO object are by definition the ones we
want in the final output so we skip the comdat group checking in those
cases.

This change makes the ELF code more explicit about this and means
that wasm and ELF do this in the same way.

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

llvm-svn: 362625

5 years agoUse LTO capable linker
Chris Bieneman [Wed, 5 Jun 2019 17:35:38 +0000 (17:35 +0000)]
Use LTO capable linker

Summary:
In DistributionExample.cmake be sure we use a LTO
capable linker, the easiest to choose is lld.

Reviewers: beanz

Reviewed By: beanz

Patch By: winksaville

Subscribers: mgorny, mehdi_amini, inglorion, dexonsmith, cfe-commits

Tags: #clang

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

llvm-svn: 362624

5 years ago[Clang] Fix pretty printing of CUDA address spaces
Anastasia Stulova [Wed, 5 Jun 2019 17:29:00 +0000 (17:29 +0000)]
[Clang] Fix pretty printing of CUDA address spaces

Patch by richardmembarth (Richard Membarth)!

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

llvm-svn: 362623

5 years agoFix shadow local variable warning. NFCI.
Simon Pilgrim [Wed, 5 Jun 2019 17:26:29 +0000 (17:26 +0000)]
Fix shadow local variable warning. NFCI.

llvm-svn: 362622

5 years ago[dsymutil] Support more than 4 architectures
Jonas Devlieghere [Wed, 5 Jun 2019 17:14:32 +0000 (17:14 +0000)]
[dsymutil] Support more than 4 architectures

When running dsymutil on a fat binary, we use temporary files in a small
vector of size four. When processing more than 4 architectures, this
resulted in a user-after-move, because the temporary files got moved to
the heap. Instead of storing an optional temp file, we now use a unique
pointer, so the location of the actual temp file doesn't change.

We could test this by checking in 5 binaries for 5 different
architectures, but this seems wasteful, especially since the number of
elements in the small vector is arbitrary.

llvm-svn: 362621

5 years ago[x86] split more 256-bit stores of concatenated vectors
Sanjay Patel [Wed, 5 Jun 2019 16:40:57 +0000 (16:40 +0000)]
[x86] split more 256-bit stores of concatenated vectors

As suggested in D62498 - collectConcatOps() matches both
concat_vectors and insert_subvector patterns, and we see
more test improvements by using the more general match.

llvm-svn: 362620

5 years ago[DynamicLoader] Make sure we always set the rendezvous breakpoint
Antonio Afonso [Wed, 5 Jun 2019 16:22:33 +0000 (16:22 +0000)]
[DynamicLoader] Make sure we always set the rendezvous breakpoint

Summary:
Once we've attached to the process we load all current modules and also set a breakpoint at the rendezvous break address.
However, we don't do this if we already have a load address for the image info address (e.g.: DT_DEBUG on ELF). This code was added 4 years ago when adding support for `$qXfer:Libraries:` packet (https://reviews.llvm.org/D9471) but its intention is not 100% clear to me. It seems to me we're using that check to know if the modules have already been loaded (which they have if `$qXfer:Libraries:` is supported by the gdb server) and skip loading the modules again in the following `if` block. The problem is that we also skip setting the Rendezvous breakpoint so we stop knowing when the process loads new modules.
I fix this by moving the call to set the breakpoint to the end of the function so we always call it as long as we have a valid executable.

Reviewers: ADodds, clayborg, eugene, labath

Reviewed By: eugene, labath

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 362619

5 years agoAdded propagation of not big initial stack size of master thread to workers.
Andrey Churbanov [Wed, 5 Jun 2019 16:14:47 +0000 (16:14 +0000)]
Added propagation of not big initial stack size of master thread to workers.

Currently implemented only for non-Windows 64-bit platforms.

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

llvm-svn: 362618

5 years ago[X86][AVX] Generalize split256BitStore to splitVectorStore. NFCI.
Simon Pilgrim [Wed, 5 Jun 2019 16:14:14 +0000 (16:14 +0000)]
[X86][AVX] Generalize split256BitStore to splitVectorStore. NFCI.

Enables us to use this to split 512-bit vectors in future patches.

llvm-svn: 362617

5 years ago[X86][SSE] Add additional nt-load test cases as discussed on D62910
Simon Pilgrim [Wed, 5 Jun 2019 16:11:57 +0000 (16:11 +0000)]
[X86][SSE] Add additional nt-load test cases as discussed on D62910

llvm-svn: 362616

5 years agoRevert "Title: [LOOPINFO] Extend Loop object to add utilities to get the loop"
Whitney Tsang [Wed, 5 Jun 2019 15:32:56 +0000 (15:32 +0000)]
Revert "Title: [LOOPINFO] Extend Loop object to add utilities to get the loop"

This reverts commit d34797dfc26c61cea19f45669a13ea572172ba34.

llvm-svn: 362615

5 years ago[llvm-readobj] - Remove TODOs from gnu-hash-symbols.test and demangle.test test cases.
George Rimar [Wed, 5 Jun 2019 15:29:50 +0000 (15:29 +0000)]
[llvm-readobj] - Remove TODOs from gnu-hash-symbols.test and demangle.test test cases.

We can remove this TODOs now.

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

llvm-svn: 362614

5 years ago[SLP] Fix regression in broadcasts caused by operand reordering patch D59973.
Dinar Temirbulatov [Wed, 5 Jun 2019 15:26:28 +0000 (15:26 +0000)]
[SLP] Fix regression in broadcasts caused by operand reordering patch D59973.

This patch fixes a regression caused by the operand reordering refactoring patch https://reviews.llvm.org/D59973 .
The fix changes the strategy to Splat instead of Opcode, if broadcast opportunities are found.
Please see the lit test for some examples.

Committed on behalf of @vporpo (Vasileios Porpodas)

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

llvm-svn: 362613

5 years ago[LoopUtils][SLPVectorizer] clean up management of fast-math-flags
Sanjay Patel [Wed, 5 Jun 2019 14:58:04 +0000 (14:58 +0000)]
[LoopUtils][SLPVectorizer] clean up management of fast-math-flags

Instead of passing around fast-math-flags as a parameter, we can set those
using an IRBuilder guard object. This is no-functional-change-intended.

The motivation is to eventually fix the vectorizers to use and set the
correct fast-math-flags for reductions. Examples of that not behaving as
expected are:
https://bugs.llvm.org/show_bug.cgi?id=23116 (should be able to reduce with less than 'fast')
https://bugs.llvm.org/show_bug.cgi?id=35538 (possible miscompile for -0.0)
D61802 (should be able to reduce with IR-level FMF)

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

llvm-svn: 362612

5 years ago[OpenCL][PR42031] Prevent deducing addr space in type alias.
Anastasia Stulova [Wed, 5 Jun 2019 14:50:01 +0000 (14:50 +0000)]
[OpenCL][PR42031] Prevent deducing addr space in type alias.

Similar to typedefs we shouldn't deduce addr space in
type alias.

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

llvm-svn: 362611

5 years ago[LoopInfo] Fix unused variable warning. NFC.
Benjamin Kramer [Wed, 5 Jun 2019 14:43:58 +0000 (14:43 +0000)]
[LoopInfo] Fix unused variable warning. NFC.

llvm-svn: 362610

5 years agoTitle: [LOOPINFO] Extend Loop object to add utilities to get the loop
Whitney Tsang [Wed, 5 Jun 2019 14:34:12 +0000 (14:34 +0000)]
Title: [LOOPINFO] Extend Loop object to add utilities to get the loop
bounds, step, and loop induction variable.

Summary: This PR extends the loop object with more utilities to get loop
bounds, step, and loop induction variable. There already exists passes
which try to obtain the loop induction variable in their own pass, e.g.
loop interchange. It would be useful to have a common area to get these
information.

/// Example:
/// for (int i = lb; i < ub; i+=step)
///   <loop body>
/// --- pseudo LLVMIR ---
/// beforeloop:
///   guardcmp = (lb < ub)
///   if (guardcmp) goto preheader; else goto afterloop
/// preheader:
/// loop:
///   i1 = phi[{lb, preheader}, {i2, latch}]
///   <loop body>
///   i2 = i1 + step
/// latch:
///   cmp = (i2 < ub)
///   if (cmp) goto loop
/// exit:
/// afterloop:
///
/// getBounds
///   getInitialIVValue      --> lb
///   getStepInst            --> i2 = i1 + step
///   getStepValue           --> step
///   getFinalIVValue        --> ub
///   getCanonicalPredicate  --> '<'
///   getDirection           --> Increasing
/// getInductionVariable          --> i1
/// getAuxiliaryInductionVariable --> {i1}
/// isCanonical                   --> false

Reviewers: kbarton, hfinkel, dmgreen, Meinersbur, jdoerfert, syzaara,
fhahn
Reviewed By: kbarton
Subscribers: tvvikram, bmahjour, etiotto, fhahn, jsji, hiraditya,
llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D60565

llvm-svn: 362609

5 years agoAvoid using NoThrow Exception Specifier in non-C++ Modes.
Erich Keane [Wed, 5 Jun 2019 14:10:39 +0000 (14:10 +0000)]
Avoid using NoThrow Exception Specifier in non-C++ Modes.

As reported in https://bugs.llvm.org/show_bug.cgi?id=42113, there are a
number of locations in Clang where it is assumed that exception
specifications are only valid in C++ mode. Since the original
justification for the NoThrow Exception Specifier Type was C++ related,
this patch just makes C mode use the attribute-based nothrow handling.

Additionally, I noticed that the handling of non-prototype functions
regressed the behavior of the nothrow attribute, in part because it is
was listed in the function type macro(which I did in the previous
patch).  In reality, it should only be doing so in a conditional nature,
so this patch removes it there and puts it directly in the switch to be
handled correctly.

llvm-svn: 362607

5 years ago[NFC][Codegen][X86] Add AVX2 runline for '(X & (C l>> Y)) ==/!= 0' tests
Roman Lebedev [Wed, 5 Jun 2019 14:08:11 +0000 (14:08 +0000)]
[NFC][Codegen][X86] Add AVX2 runline for '(X & (C l>> Y)) ==/!= 0' tests

llvm-svn: 362606

5 years agoUpdateTestChecks: hexagon support
Roman Lebedev [Wed, 5 Jun 2019 14:08:01 +0000 (14:08 +0000)]
UpdateTestChecks: hexagon support

Summary:
These tests are being affected by an upcoming patch,
so having an understandable (autogenerated) diff is helpful.

This target, again, prefers `-march`:
```
llvm/test/CodeGen/Hexagon$ grep -r triple | wc -l
467
llvm/test/CodeGen/Hexagon$ grep -r march | wc -l
1167
```

Reviewers: RKSimon, kparzysz

Reviewed By: kparzysz

Subscribers: xbolva00, llvm-commits

Tags: #llvm

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

llvm-svn: 362605

5 years ago[Sema] Prevent binding incompatible addr space ref to temporaries
Anastasia Stulova [Wed, 5 Jun 2019 14:03:34 +0000 (14:03 +0000)]
[Sema] Prevent binding incompatible addr space ref to temporaries

References to arbitrary address spaces can't always be bound to
temporaries. This change extends the reference binding logic to
check that the address space of a temporary can be implicitly
converted to the address space in a reference when temporary
materialization is performed.

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

llvm-svn: 362604

5 years ago[MIPS GlobalISel] Select fcmp
Petar Avramovic [Wed, 5 Jun 2019 14:03:13 +0000 (14:03 +0000)]
[MIPS GlobalISel] Select fcmp

Select floating point compare for MIPS32.

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

llvm-svn: 362603

5 years ago[yaml2obj] - Change how we handle implicit sections.
George Rimar [Wed, 5 Jun 2019 13:16:53 +0000 (13:16 +0000)]
[yaml2obj] - Change how we handle implicit sections.

We have a few sections that can be added implicitly to the output:
".dynsym", ".dynstr", ".symtab", ".strtab" and ".shstrtab".

Problem appears when such section is listed explicitly in YAML.
In that case it's content is written twice:
first time during writing of regular sections listed in the document
and second time during special handling.

Because of that their file offsets can become unexpectedly broken:
(yaml file for sample below lists .dynsym explicitly before .text.foo)

Before patch:
  [Nr] Name              Type             Address           Offset
       Size              EntSize          Flags  Link  Info  Align
  [ 0]                   NULL             0000000000000000  00000000
       0000000000000000  0000000000000000           0     0     0
  [ 1] .dynsym           DYNSYM           0000000000000100  00000250
       0000000000000030  0000000000000018   A       6     0     8
  [ 2] .text.foo         PROGBITS         0000000000000200  00000200
       0000000000000000  0000000000000000  AX       0     0     0

After patch:
Section Headers:
  [Nr] Name         Type             Address           Offset
       Size              EntSize          Flags  Link  Info  Align
  [ 0]                   NULL             0000000000000000  00000000
       0000000000000000  0000000000000000           0     0     0
  [ 1] .dynsym           DYNSYM           0000000000000100  00000200
       0000000000000030  0000000000000018   A       6     0     8
  [ 2] .text.foo         PROGBITS         0000000000000200  00000230
       0000000000000000  0000000000000000  AX       0     0     0

This patch reorganizes our code and fixes the issue described.

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

llvm-svn: 362602

5 years ago[ARM] Allow "-march=foo+fp" to vary with foo
Sjoerd Meijer [Wed, 5 Jun 2019 13:12:01 +0000 (13:12 +0000)]
[ARM] Allow "-march=foo+fp" to vary with foo

Now, when clang processes an argument of the form "-march=foo+x+y+z",
then instead of calling getArchExtFeature() for each of the extension
names "x", "y", "z" and appending the returned string to its list of
low-level subtarget features, it will call appendArchExtFeatures()
which does the appending itself.

The difference is that appendArchExtFeatures can add _more_ than one
low-level feature name to the output feature list if it has to, and
also, it gets told some information about what base architecture and
CPU the extension is going to go with, which means that "+fp" can now
mean something different for different CPUs. Namely, "+fp" now selects
whatever the _default_ FPU is for the selected CPU and/or
architecture, as defined in the ARM_ARCH or ARM_CPU_NAME macros in
ARMTargetParser.def.

On the clang side, I adjust DecodeARMFeatures to call the new
appendArchExtFeatures function in place of getArchExtFeature. This
means DecodeARMFeatures needs to be passed a CPU name and an ArchKind,
which meant changing its call sites to make those available, and also
sawing getLLVMArchSuffixForARM in half so that you can get an ArchKind
enum value out of it instead of a string.

Also, I add support here for the extension name "+fp.dp", which will
automatically look through the FPU list for something that looks just
like the default FPU except for also supporting double precision.

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

llvm-svn: 362601

5 years ago[ARM] Allow "-march=foo+fp" to vary with foo
Sjoerd Meijer [Wed, 5 Jun 2019 13:11:51 +0000 (13:11 +0000)]
[ARM] Allow "-march=foo+fp" to vary with foo

This is the LLVM part of this change, the Clang part contains the full
description in its commit message.

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

llvm-svn: 362600

5 years ago[X86][AVX] combineX86ShuffleChain - combine shuffle(extractsubvector(x),extractsubvec...
Simon Pilgrim [Wed, 5 Jun 2019 12:56:53 +0000 (12:56 +0000)]
[X86][AVX] combineX86ShuffleChain - combine shuffle(extractsubvector(x),extractsubvector(y))

We already handle the case where we combine shuffle(extractsubvector(x),extractsubvector(x)), this relaxes the requirement to permit different sources as long as they have the same value type.

This causes a couple of cases where the VPERMV3 binary shuffles occur at a wider width than before, which I intend to improve in future commits - but as only the subvector's mask indices are defined, these will broadcast so we don't see any increase in constant size.

llvm-svn: 362599

5 years agogn build: Merge r362578
Nico Weber [Wed, 5 Jun 2019 12:05:54 +0000 (12:05 +0000)]
gn build: Merge r362578

llvm-svn: 362598

5 years agoRevert "Factor out duplicated code building a MemberExpr and marking it" and "Convert...
Benjamin Kramer [Wed, 5 Jun 2019 11:46:57 +0000 (11:46 +0000)]
Revert "Factor out duplicated code building a MemberExpr and marking it" and "Convert MemberExpr creation and serialization to work the same way as"

This reverts commits r362551 and r362563. Crashes during modules selfhost.

llvm-svn: 362597

5 years ago[llvm-objdump] - Disassemble non-executable sections if specifically requested.
George Rimar [Wed, 5 Jun 2019 11:37:53 +0000 (11:37 +0000)]
[llvm-objdump] - Disassemble non-executable sections if specifically requested.

This is https://bugs.llvm.org/show_bug.cgi?id=41897.

Previously -d + -j .data had no effect, that wasn't consistent with GNU,
which proccesses .data in that case. With this patch we follow this behavior.

Diffeential revision: https://reviews.llvm.org/D62848

llvm-svn: 362596

5 years ago[TargetLowering] SimplifyDemandedBits - pull out shift value type. NFCI.
Simon Pilgrim [Wed, 5 Jun 2019 10:59:04 +0000 (10:59 +0000)]
[TargetLowering] SimplifyDemandedBits - pull out shift value type. NFCI.

Will be used more in an upcoming patch.

llvm-svn: 362595

5 years ago[X86][SSE] Add some nt-store test cases inspired by PR42123
Simon Pilgrim [Wed, 5 Jun 2019 10:55:55 +0000 (10:55 +0000)]
[X86][SSE] Add some nt-store test cases inspired by PR42123

llvm-svn: 362594

5 years agoSanitize llvm-size help
Serge Guelton [Wed, 5 Jun 2019 10:32:28 +0000 (10:32 +0000)]
Sanitize llvm-size help

Remove irrelevant options from standard help output.

New output:

    OVERVIEW: llvm object size dumper

    USAGE: llvm-size [options] <input files>

    OPTIONS:

    Generic Options:

      --help           - Display available options (--help-hidden for more)
      --help-list      - Display list of available options (--help-list-hidden for more)
      --version        - Display the version of this program

    llvm-size Options:

      Specify output format
          -A             - System V format
          -B             - Berkeley format
          -m             - Darwin -m format
      --arch=<string>  - architecture(s) from a Mach-O file to dump
      --common         - Print common symbols in the ELF file.  When using Berkely format, this is added to bss.
      Print size in radix:
          -o             - Print size in octal
          -d             - Print size in decimal
          -x             - Print size in hexadecimal
      --format=<value> - Specify output format
        =sysv          -   System V format
        =berkeley      -   Berkeley format
        =darwin        -   Darwin -m format
      -l               - When format is darwin, use long format to include addresses and offsets.
      --radix=<value>  - Print size in radix
        =8             -   Print size in octal
        =10            -   Print size in decimal
        =16            -   Print size in hexadecimal
      --totals         - Print totals of all objects - Berkeley format only

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

llvm-svn: 362593

5 years ago[IPO] Disabled 'default only' switch statements to fix MSVC warnings.
Simon Pilgrim [Wed, 5 Jun 2019 10:04:05 +0000 (10:04 +0000)]
[IPO] Disabled 'default only' switch statements to fix MSVC warnings.

@jdoerfert Looks like these are placeholders for incoming abstract attributes patches so I've just commented the code out, even though this is usually frowned upon.

llvm-svn: 362592

5 years ago[ELF] Allow reading of more than one FEATURE_1_AND in same object.
Peter Smith [Wed, 5 Jun 2019 09:31:45 +0000 (09:31 +0000)]
[ELF] Allow reading of more than one FEATURE_1_AND in same object.

Although many relocatable objects will have a single
GNU_PROPERTY_X86_FEATURE_1_AND in the .note.gnu.property section it is
permissible to have more than one, and there are tests in ld.bfd that use
it. The behavior that ld.bfd follows is to set the feature bit for a
relocatable object if any of the GNU_PROPERTY_X86_FEATURE_1_AND
have the feature bit set.

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

llvm-svn: 362591

5 years agoInclude what you use in PPCFrameLowering.h
Dmitri Gribenko [Wed, 5 Jun 2019 08:58:00 +0000 (08:58 +0000)]
Include what you use in PPCFrameLowering.h

llvm-svn: 362590

5 years ago[CMake] Add configuration dirs as potential locations for llvm-lit and llvm-tblgen...
Stefan Granitz [Wed, 5 Jun 2019 08:31:50 +0000 (08:31 +0000)]
[CMake] Add configuration dirs as potential locations for llvm-lit and llvm-tblgen in standalone builds

Summary:
If the provided LLVM build-tree used a multi-configuration generator like Xcode, `LLVM_TOOLS_BINARY_DIR` will have a generator-specific placeholder to express `CMAKE_CFG_INTDIR`. Thus `llvm-lit` and `llvm-tblgen` won't be found.
D62878 exports the actual configuration types so we can fix the path and add them to the search paths for `find_program()`.

Reviewers: xiaobai, labath, stella.stamenova

Reviewed By: xiaobai, stella.stamenova

Subscribers: mgorny, lldb-commits

Tags: #lldb

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

llvm-svn: 362589

5 years ago[CMake] Export CMAKE_CONFIGURATION_TYPES for the LLVM build-tree
Stefan Granitz [Wed, 5 Jun 2019 08:29:24 +0000 (08:29 +0000)]
[CMake] Export CMAKE_CONFIGURATION_TYPES for the LLVM build-tree

Summary: Useful info for standalone builds of subprojects. If a multi-configuration generator was used for the provided LLVM build-tree, standalone builds should consider actual subdirectories per configuration in `find_program()` (e.g. looking for `llvm-lit` or `llvm-tblgen`).

Reviewers: labath, beanz, mgorny

Subscribers: lldb-commits, llvm-commits

Tags: #llvm

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

llvm-svn: 362588

5 years ago[clang] [test] Add a (xfailing) test for PR41027
Michal Gorny [Wed, 5 Jun 2019 08:21:42 +0000 (08:21 +0000)]
[clang] [test] Add a (xfailing) test for PR41027

Add a test for tracking PR41027 (8.0 regression breaking assembly code
relying on __builtin_constant_p() to identify compile-time constants).
Mark it as expected to fail everywhere.

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

llvm-svn: 362587

5 years agoIgnore DIEs in the skeleton unit in a DWO scenario
Pavel Labath [Wed, 5 Jun 2019 07:29:55 +0000 (07:29 +0000)]
Ignore DIEs in the skeleton unit in a DWO scenario

Summary:
r362103 exposed a bug, where we could read incorrect data if a skeleton
unit contained more than the single unit DIE. Clang emits these kinds of
units with -fsplit-dwarf-inlining (which is also the default).

Changing lldb to handle these DIEs is nontrivial, as we'd have to change
the UID encoding logic to be able to reference these DIEs, and fix up
various places which are assuming that all DIEs come from the separate
compile unit.

However, it turns out this is not necessary, as the DWO unit contains
all the information that the skeleton unit does. So, this patch just
skips parsing the extra DIEs if we have successfully found the DWO file.
This enforces the invariant that the rest of the code is already
operating under.

This patch fixes a couple of existing tests, but I've also included a
simpler test which does not depend on execution of binaries, and would
have helped us in catching this sooner.

Reviewers: clayborg, JDevlieghere, aprantl

Subscribers: probinson, dblaikie, lldb-commits

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

llvm-svn: 362586

5 years ago[CMake][Fuchsia] Use libc++ ABIv2 for the first stage build
Petr Hosek [Wed, 5 Jun 2019 06:58:41 +0000 (06:58 +0000)]
[CMake][Fuchsia] Use libc++ ABIv2 for the first stage build

This also unifies flags between macOS and Linux builds.

llvm-svn: 362585

5 years agoReduce memory consumption of coverage dumps
Serge Guelton [Wed, 5 Jun 2019 06:35:10 +0000 (06:35 +0000)]
Reduce memory consumption of coverage dumps

Avoiding an intermediate join operation removes the need for an
intermediate buffer that may be quite large, as showcased by

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

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

llvm-svn: 362584

5 years agoResubmit "[CorrelatedValuePropagation] Fix prof branch_weights metadata handling...
Yevgeny Rouban [Wed, 5 Jun 2019 05:46:40 +0000 (05:46 +0000)]
Resubmit "[CorrelatedValuePropagation] Fix prof branch_weights metadata handling for SwitchInst"

This reverts commit 5b32f60ec31ce136edac6f693538aeb6039f4ad0.
The fix is in commit 4f9e68148bd0dada2d6997625432385918ac2e2c.

This patch fixes the CorrelatedValuePropagation pass to keep
prof branch_weights metadata of SwitchInst consistent.
It makes use of SwitchInstProfUpdateWrapper.
New tests are added.

Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D62126

llvm-svn: 362583

5 years agoSuppress false-positive GCC -Wreturn-type warning.
Michael Liao [Wed, 5 Jun 2019 04:18:12 +0000 (04:18 +0000)]
Suppress false-positive GCC -Wreturn-type warning.

llvm-svn: 362582

5 years agoAdd __FILE_NAME__ to ReleaseNotes. NFC
Kristina Brooks [Wed, 5 Jun 2019 03:47:02 +0000 (03:47 +0000)]
Add __FILE_NAME__ to ReleaseNotes. NFC

Added it under C language changes as a nonstandard
extension for the time being.

llvm-svn: 362581

5 years ago[Clang] Disable new PM for tests that use optimization level -O1, -O2 and -O3
Petr Hosek [Wed, 5 Jun 2019 03:17:11 +0000 (03:17 +0000)]
[Clang] Disable new PM for tests that use optimization level -O1, -O2 and -O3

Tests that use -O1, -O2 and -O3 would often produce different results
with the new pass manager which makes these tests fail. Disable new PM
explicitly for these tests.

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

llvm-svn: 362580

5 years agoRead .note.gnu.property sections and emit a merged .note.gnu.property section.
Rui Ueyama [Wed, 5 Jun 2019 03:04:46 +0000 (03:04 +0000)]
Read .note.gnu.property sections and emit a merged .note.gnu.property section.

This patch also adds `--require-cet` option for the sake of testing.
The actual feature for IBT-aware PLT is not included in this patch.

This is a part of https://reviews.llvm.org/D59780. Submitting this
first should make it easy to work with a related change
(https://reviews.llvm.org/D62609).

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

llvm-svn: 362579

5 years ago[Attributor] Pass infrastructure and fixpoint framework
Johannes Doerfert [Wed, 5 Jun 2019 03:02:24 +0000 (03:02 +0000)]
[Attributor] Pass infrastructure and fixpoint framework

NOTE: Note that no attributes are derived yet. This patch will not go in
      alone but only with others that derive attributes. The framework is
      split for review purposes.

This commit introduces the Attributor pass infrastructure and fixpoint
iteration framework. Further patches will introduce abstract attributes
into this framework.

In a nutshell, the Attributor will update instances of abstract
arguments until a fixpoint, or a "timeout", is reached. Communication
between the Attributor and the abstract attributes that are derived is
restricted to the AbstractState and AbstractAttribute interfaces.

Please see the file comment in Attributor.h for detailed information
including design decisions and typical use case. Also consider the class
documentation for Attributor, AbstractState, and AbstractAttribute.

Reviewers: chandlerc, homerdin, hfinkel, fedor.sergeev, sanjoy, spatel, nlopes, nicholas, reames

Subscribers: mehdi_amini, mgorny, hiraditya, bollu, steven_wu, dexonsmith, dang, llvm-commits

Tags: #llvm

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

llvm-svn: 362578

5 years ago[NFC][FnAttrs] Stress tests for attribute deduction
Johannes Doerfert [Wed, 5 Jun 2019 03:00:06 +0000 (03:00 +0000)]
[NFC][FnAttrs] Stress tests for attribute deduction

This commit is a preparation of upcoming patches on attribute deduction.
It will shorten the diffs and make it clear what we inferred before.

Reviewers: chandlerc, homerdin, hfinkel, fedor.sergeev, sanjoy, spatel, nlopes

Subscribers: bollu, llvm-commits

Tags: #llvm

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

llvm-svn: 362577

5 years ago[PowerPC] Collapse RLDICL/RLDICR into RLDIC when possible
Nemanja Ivanovic [Wed, 5 Jun 2019 02:36:40 +0000 (02:36 +0000)]
[PowerPC] Collapse RLDICL/RLDICR into RLDIC when possible

Generally speaking, we lower to an optimal rotate sequence for nodes visible in
the SDAG. However, there are instances where the two rotates are not visible at
ISEL time - most notably those in a very common sequence when lowering switch
statements to jump tables.

A common situation is a switch on a 32-bit integer. This value has to have the
upper 32 bits cleared and because jump table offsets are word offsets, the value
needs to be shifted left by 2 bits. We currently emit the clear and the left
shift as two separate instructions, but this is not needed as we can lower it to
a single RLDIC.

This patch just cleans that up.

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

llvm-svn: 362576

5 years ago[analyzer] exploded-graph-rewriter: Add the missing license header!
Artem Dergachev [Wed, 5 Jun 2019 02:09:49 +0000 (02:09 +0000)]
[analyzer] exploded-graph-rewriter: Add the missing license header!

llvm-svn: 362575

5 years ago[analyzer] exploded-graph-rewriter: Pick up python from cmake in tests.
Artem Dergachev [Wed, 5 Jun 2019 02:09:29 +0000 (02:09 +0000)]
[analyzer] exploded-graph-rewriter: Pick up python from cmake in tests.

This should fix NetBSD buildbots.

llvm-svn: 362574

5 years ago[PowerPC][NFC] Add codegen test for consecutive stores of vector elements
Nemanja Ivanovic [Wed, 5 Jun 2019 02:09:03 +0000 (02:09 +0000)]
[PowerPC][NFC] Add codegen test for consecutive stores of vector elements

NFC commit of a test case in order for the subsequent review to show differences
in codegen.

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

llvm-svn: 362573

5 years ago[LLD][COFF] Don't take into account the 'age' when looking for PDB type server
Alexandre Ganea [Wed, 5 Jun 2019 02:01:43 +0000 (02:01 +0000)]
[LLD][COFF] Don't take into account the 'age' when looking for PDB type server

The age field is only there to say how many times an OBJ or a PDB was incrementally linked. It shouldn't be used to validate the link between the OBJ and the PDB.

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

llvm-svn: 362572

5 years agoInitial support for vectorization using MASSV (IBM MASS vector library)
Nemanja Ivanovic [Wed, 5 Jun 2019 01:57:57 +0000 (01:57 +0000)]
Initial support for vectorization using MASSV (IBM MASS vector library)

Part 2 (the Clang portion) of D59881.

This patch (first of two patches) enables the vectorizer to recognize the
IBM MASS vector library routines. This patch specifically adds support for
recognizing the -vector-library=MASSV option, and defines mappings from IEEE
standard scalar math functions to generic PowerPC MASS vector counterparts.
For instance, the generic PowerPC MASS vector entry for double-precision
cbrt function is __cbrtd2_massv.

The second patch will further lower the generic PowerPC vector entries to
PowerPC subtarget-specific entries.
For instance, the PowerPC generic entry cbrtd2_massv is lowered to
cbrtd2_P9 for Power9 subtarget.

The overall support for MASS vector library is presented as such in two patches
for ease of review.

Patch by Jeeva Paudel.

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

llvm-svn: 362571

5 years agoFix -Wsign-compare by explicit cast after r362557
Fangrui Song [Wed, 5 Jun 2019 01:49:06 +0000 (01:49 +0000)]
Fix -Wsign-compare by explicit cast after r362557

llvm-svn: 362570

5 years ago[llvm-objdump/llvm-readobj/obj2yaml/yaml2obj] Support DT_PPC_GOT and DT_PPC_OPT
Fangrui Song [Wed, 5 Jun 2019 01:36:48 +0000 (01:36 +0000)]
[llvm-objdump/llvm-readobj/obj2yaml/yaml2obj] Support DT_PPC_GOT and DT_PPC_OPT

In glibc, DT_PPC_GOT indicates that PowerPC32 Secure PLT ABI is used.
I plan to use it in D62464.

DT_PPC_OPT currently indicates if a TLSDESC inspired TLS optimization is
enabled.

Reviewed By: grimar, jhenderson, rupprecht

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

llvm-svn: 362569

5 years agoInitial support for IBM MASS vector library
Nemanja Ivanovic [Wed, 5 Jun 2019 01:31:43 +0000 (01:31 +0000)]
Initial support for IBM MASS vector library

This is the LLVM portion of patch https://reviews.llvm.org/D59881.
The clang portion is to follow.

llvm-svn: 362568

5 years ago[TargetTransformInfo] assert on nullptr
Nick Desaulniers [Wed, 5 Jun 2019 01:28:55 +0000 (01:28 +0000)]
[TargetTransformInfo] assert on nullptr

Summary:
This was flagged in https://www.viva64.com/en/b/0629/ under "Snippet No.
38".

Add an assertion, since it's unlikely that this parameter is nullptr.

Reviewers: RKSimon, fhahn

Reviewed By: RKSimon

Subscribers: fhahn, llvm-commits, RKSimon, srhines

Tags: #llvm

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

llvm-svn: 362567

5 years agoChanged force build of GWP-ASan options parser to be statically
Mitch Phillips [Wed, 5 Jun 2019 01:27:39 +0000 (01:27 +0000)]
Changed force build of GWP-ASan options parser to be statically
linked instead of dynamic. This should help resolve a downstream
build order issue against libc++.

llvm-svn: 362566

5 years ago[X86] Cleanup convertIntLogicToFPLogic a little. NFCI
Craig Topper [Wed, 5 Jun 2019 01:00:34 +0000 (01:00 +0000)]
[X86] Cleanup convertIntLogicToFPLogic a little. NFCI

-Use early returns to reduce indentation
-Replace multipe ifs with a switch.
-Replace an assert with an llvm_unreachable default in the switch.
-Check that the FP type we're going to use for the
 X86ISD::FAND/FOR/FXOR is legal rather than checking that the
 integer type matches the width of a legal scalar fp type. This all
 runs after legalization so it shouldn't really matter, but making
 sure we're using a valid type in the X86ISD node is really
 whats important.

llvm-svn: 362565

5 years agoFactor out duplicated code building a MemberExpr and marking it
Richard Smith [Wed, 5 Jun 2019 00:21:47 +0000 (00:21 +0000)]
Factor out duplicated code building a MemberExpr and marking it
referenced.

llvm-svn: 362563

5 years agoPR42111: Use guarded initialization for thread-local variables with
Richard Smith [Wed, 5 Jun 2019 00:04:33 +0000 (00:04 +0000)]
PR42111: Use guarded initialization for thread-local variables with
unordered initialization and internal linkage.

We'll run their initializers once on each reference, so we need a guard
variable even though they only have a single definition.

llvm-svn: 362562

5 years agosvn propset svn:executable on utils/prepare-code-coverage-artifact.py
Nico Weber [Tue, 4 Jun 2019 23:35:07 +0000 (23:35 +0000)]
svn propset svn:executable on utils/prepare-code-coverage-artifact.py

llvm-svn: 362561

5 years agomsabi: Fix exponential mangling time for even more contrived inputs
Nico Weber [Tue, 4 Jun 2019 23:27:40 +0000 (23:27 +0000)]
msabi: Fix exponential mangling time for even more contrived inputs

This is a follow-up to r362293 which fixed exponential time needed
for mangling certain templates. This fixes the same issue if that
template pattern happens in template arguments > 10: The first
ten template arguments can use back references, and r362293 added
caching for back references. For latter arguments, we have to add
a cache for the mangling itself instead.

Fixes PR42091 even more.

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

llvm-svn: 362560

5 years ago[AArch64] FastISel: fix test to specify -fast-isel when -fast-isel-abort=1 is used.
Amara Emerson [Tue, 4 Jun 2019 23:11:42 +0000 (23:11 +0000)]
[AArch64] FastISel: fix test to specify -fast-isel when -fast-isel-abort=1 is used.

This test has been inadvertently been GISel, and now assert due to incompatible flags.

llvm-svn: 362559

5 years ago[Scalarizer] Add UnaryOperator visitor to scalarization pass
Cameron McInally [Tue, 4 Jun 2019 23:01:36 +0000 (23:01 +0000)]
[Scalarizer] Add UnaryOperator visitor to scalarization pass

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

llvm-svn: 362558