platform/upstream/llvm.git
5 years ago[cmake] Remove use of deprecated generator expression. NFC
Shoaib Meenai [Sat, 30 Mar 2019 01:35:01 +0000 (01:35 +0000)]
[cmake] Remove use of deprecated generator expression. NFC

Use $<CONFIG> instead of $<CONFIGURATION>, since the latter has been
deprecated since CMake 3.0, and the former is entirely equivalent.

llvm-svn: 357338

5 years ago[WebAssembly] Optimize the number of routing blocks in FixIrreducibleCFG
Heejin Ahn [Sat, 30 Mar 2019 01:31:11 +0000 (01:31 +0000)]
[WebAssembly] Optimize the number of routing blocks in FixIrreducibleCFG

Summary:
Currently we create a routing block to the dispatch block for every
predecessor of every entry. So the total number of routing blocks
created will be (# of preds) * (# of entries). But we don't need to do
this: we need at most 2 routing blocks per loop entry, one for when the
predecessor is inside the loop and one for it is outside the loop. (We
can't merge these into one because this will creates another loop cycle
between blocks inside and blocks outside) This patch fixes this and
creates at most 2 routing blocks per entry.

This also renames variable `Split` to `Routing`, which I think is a bit
clearer.

Reviewers: kripken

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

Tags: #llvm

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

llvm-svn: 357337

5 years ago[CMake] Add missing test dep
David Zarzycki [Sat, 30 Mar 2019 00:00:19 +0000 (00:00 +0000)]
[CMake] Add missing test dep

lit/SymbolFile/NativePDB/globals-bss.cpp needs llvm-readobj

llvm-svn: 357336

5 years ago[analyzer] MIGChecker: Add support for more deallocator APIs.
Artem Dergachev [Fri, 29 Mar 2019 23:56:53 +0000 (23:56 +0000)]
[analyzer] MIGChecker: Add support for more deallocator APIs.

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

llvm-svn: 357335

5 years ago[lit] Set shlibpath_var on AIX
Hubert Tong [Fri, 29 Mar 2019 23:33:04 +0000 (23:33 +0000)]
[lit] Set shlibpath_var on AIX

Summary:
When building the `check-all` target on AIX, lit produces
```
warning: unable to inject shared library path on 'AIX'
```

This patch addresses this. `LIBPATH` is the environment variable of
interest on AIX. Newer versions of AIX may consider `LD_LIBRARY_PATH`,
but only when `LIBPATH` is unset.

Reviewers: xingxue, jasonliu, sfertile, serge-sans-paille

Reviewed By: xingxue

Subscribers: jsji, cfe-commits, llvm-commits

Tags: #clang

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

llvm-svn: 357334

5 years ago[Support] Implement is_local_impl with AIX mntctl
Hubert Tong [Fri, 29 Mar 2019 23:32:47 +0000 (23:32 +0000)]
[Support] Implement is_local_impl with AIX mntctl

Summary:
On AIX, we can determine whether a filesystem is remote using `mntctl`.

If the information is not found, then claim that the file is remote
(since that is the more restrictive case). Testing for the associated
interface is restored with a modified version of the unit test from
rL295768.

Reviewers: jasonliu, xingxue

Reviewed By: xingxue

Subscribers: jsji, apaprocki, Hahnfeld, zturner, krytarowski, kristina, llvm-commits

Tags: #llvm

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

llvm-svn: 357333

5 years agoRevert "[analyzer] Introduce a simplified API for adding custom path notes."
Artem Dergachev [Fri, 29 Mar 2019 23:11:10 +0000 (23:11 +0000)]
Revert "[analyzer] Introduce a simplified API for adding custom path notes."

This reverts commit r357323.

ASan leaks found by a buildbot :)

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

llvm-svn: 357332

5 years ago[LoopPredication] Remove stale TODO
Philip Reames [Fri, 29 Mar 2019 23:10:01 +0000 (23:10 +0000)]
[LoopPredication] Remove stale TODO

llvm-svn: 357331

5 years ago[LoopPredication] Use the builder's insertion point everywhere [NFC]
Philip Reames [Fri, 29 Mar 2019 23:06:57 +0000 (23:06 +0000)]
[LoopPredication] Use the builder's insertion point everywhere [NFC]

llvm-svn: 357330

5 years ago[analyzer] PR41239: Fix a crash on invalid source location in NoStoreFuncVisitor.
Artem Dergachev [Fri, 29 Mar 2019 22:57:49 +0000 (22:57 +0000)]
[analyzer] PR41239: Fix a crash on invalid source location in NoStoreFuncVisitor.

It turns out that SourceManager::isInSystemHeader() crashes when an invalid
source location is passed into it. Invalid source locations are relatively
common: not only they come from body farms, but also, say, any function in C
that didn't come with a forward declaration would have an implicit
forward declaration with invalid source locations.

There's a more comfy API for us to use in the Static Analyzer:
CallEvent::isInSystemHeader(), so just use that.

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

llvm-svn: 357329

5 years agoRe-land "[WebAssembly] Improve invalid relocation error message""
Sam Clegg [Fri, 29 Mar 2019 22:56:39 +0000 (22:56 +0000)]
Re-land "[WebAssembly] Improve invalid relocation error message""

See https://reviews.llvm.org/D59860

The initial version of this change effected more than just the
error message.  This version is scoped down to only effect the error
itself.

llvm-svn: 357328

5 years ago[MemorySSA] Temporary fix assert when reaching 0 limit.
Alina Sbirlea [Fri, 29 Mar 2019 22:55:59 +0000 (22:55 +0000)]
[MemorySSA] Temporary fix assert when reaching 0 limit.

llvm-svn: 357327

5 years ago[analyzer] Move taint API from ProgramState to a separate header. NFC.
Artem Dergachev [Fri, 29 Mar 2019 22:49:30 +0000 (22:49 +0000)]
[analyzer] Move taint API from ProgramState to a separate header. NFC.

It is now an inter-checker communication API, similar to the one that
connects MallocChecker/CStringChecker/InnerPointerChecker: simply a set of
setters and getters for a state trait.

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

llvm-svn: 357326

5 years ago[analyzer] PR37501: Disable assertion for logical op short circuit evaluation.
Artem Dergachev [Fri, 29 Mar 2019 22:43:34 +0000 (22:43 +0000)]
[analyzer] PR37501: Disable assertion for logical op short circuit evaluation.

The transfer function for the CFG element that represents a logical operation
computes the value of the operation and does nothing else. The element
appears after all the short circuit decisions were made, so they don't need
to be made again at this point.

Because our expression evaluation is imprecise, it is often hard to
discriminate between:

  (1) we don't know the value of the RHS because we failed to evaluate it

and

  (2) we don't know the value of the RHS because it didn't need to be evaluated.

This is hard because it depends on our knowledge about the value of the LHS
(eg., if LHS is true, then RHS in (LHS || RHS) doesn't need to be computed)
but LHS itself may have been evaluated imprecisely and we don't know whether
it is true or not. Additionally, the Analyzer wouldn't necessarily even remember
what the value of the LHS was because theoretically it's not really necessary
to know it for any future evaluations.

In order to work around these issues, the transfer function for logical
operations consists in looking at the ExplodedGraph we've constructed so far
in order to figure out from which CFG direction did we arrive here.
Such post-factum backtracking that doesn't involve looking up LHS and RHS values
is usually possible. However sometimes it fails because when we deduplicate
exploded nodes with the same program point and the same program state we may end
up in a situation when we reached the same program point from two or more
different directions.

By removing the assertion, we admit that the procedure indeed sometimes fails to
work. When it fails, we also admit that we don't know the value of the logical
operator.

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

llvm-svn: 357325

5 years agoTry to fix buildbot error
Sanjoy Das [Fri, 29 Mar 2019 22:27:10 +0000 (22:27 +0000)]
Try to fix buildbot error

Error is:

llvm/lib/Analysis/ScalarEvolution.cpp:3534:10: error: chosen constructor is explicit in copy-initialization
  return {UniqueSCEVs.FindNodeOrInsertPos(ID, IP), std::move(ID), IP};
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/aarch64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/tuple:479:19: note: explicit constructor declared here
        constexpr tuple(_UElements&&... __elements)
                  ^
1 error generated.

llvm-svn: 357324

5 years ago[analyzer] Introduce a simplified API for adding custom path notes.
Artem Dergachev [Fri, 29 Mar 2019 22:21:00 +0000 (22:21 +0000)]
[analyzer] Introduce a simplified API for adding custom path notes.

Almost all path-sensitive checkers need to tell the user when something specific
to that checker happens along the execution path but does not constitute a bug
on its own. For instance, a call to operator delete in C++ has consequences
that are specific to a use-after-free bug. Deleting an object is not a bug
on its own, but when the Analyzer finds an execution path on which a deleted
object is used, it'll have to explain to the user when exactly during that path
did the deallocation take place.

Historically such custom notes were added by implementing "bug report visitors".
These visitors were post-processing bug reports by visiting every ExplodedNode
along the path and emitting path notes whenever they noticed that a change that
is relevant to a bug report occurs within the program state. For example,
it emits a "memory is deallocated" note when it notices that a pointer changes
its state from "allocated" to "deleted".

The "visitor" approach is powerful and efficient but hard to use because
such preprocessing implies that the developer first models the effects
of the event (say, changes the pointer's state from "allocated" to "deleted"
as part of operator delete()'s transfer function) and then forgets what happened
and later tries to reverse-engineer itself and figure out what did it do
by looking at the report.

The proposed approach tries to avoid discarding the information that was
available when the transfer function was evaluated. Instead, it allows the
developer to capture all the necessary information into a closure that
will be automatically invoked later in order to produce the actual note.

This should reduce boilerplate and avoid very painful logic duplication.

On the technical side, the closure is a lambda that's put into a special kind of
a program point tag, and a special bug report visitor visits all nodes in the
report and invokes all note-producing closures it finds along the path.

For now it is up to the lambda to make sure that the note is actually relevant
to the report. For instance, a memory deallocation note would be irrelevant when
we're reporting a division by zero bug or if we're reporting a use-after-free
of a different, unrelated chunk of memory. The lambda can figure these thing out
by looking at the bug report object that's passed into it.

A single checker is refactored to make use of the new functionality: MIGChecker.
Its program state is trivial, making it an easy testing ground for the first
version of the API.

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

llvm-svn: 357323

5 years ago[libc++abi] Don't set POSITION_INDEPENDENT_CODE when building static library
Sam Clegg [Fri, 29 Mar 2019 22:08:56 +0000 (22:08 +0000)]
[libc++abi] Don't set POSITION_INDEPENDENT_CODE when building static library

With the current WebAssembly backend, objects built with -fPIC are not
compatible with static linking.  libc++abi was (mistakenly?) adding
-fPIC to the objects it was including in a static library.

IIUC this change should also mean the static build can be more efficient
on all platforms.

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

llvm-svn: 357322

5 years ago[WebAssembly] Add mutable globals feature
Thomas Lively [Fri, 29 Mar 2019 22:00:18 +0000 (22:00 +0000)]
[WebAssembly] Add mutable globals feature

Summary:
This feature is not actually used for anything in the WebAssembly
backend, but adding it allows users to get it into the target features
sections of their objects, which makes these objects
future-compatible.

Reviewers: aheejin, dschuff

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

Tags: #clang, #llvm

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

llvm-svn: 357321

5 years ago[SCEV] Check the cache in get{S|U}MaxExpr before doing any work
Sanjoy Das [Fri, 29 Mar 2019 22:00:12 +0000 (22:00 +0000)]
[SCEV] Check the cache in get{S|U}MaxExpr before doing any work

Summary:
This lets us avoid e.g. checking if A >=s B in getSMaxExpr(A, B) if we've
already established that (A smax B) is the best we can do.

Fixes PR41225.

Reviewers: asbirlea

Subscribers: mcrosier, jlebar, bixia, jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 357320

5 years ago[MemorySSA] Limit clobber walks.
Alina Sbirlea [Fri, 29 Mar 2019 21:56:09 +0000 (21:56 +0000)]
[MemorySSA] Limit clobber walks.

Summary: This patch limits all getClobberingMemoryAccess() walks to MaxCheckLimit.

Reviewers: george.burgess.iv

Subscribers: sanjoy, jlebar, Prazek, llvm-commits

Tags: #llvm

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

llvm-svn: 357319

5 years ago[GlobalISel][AArch64] Add isel support for G_INSERT_VECTOR_ELT on v2s32s
Jessica Paquette [Fri, 29 Mar 2019 21:39:36 +0000 (21:39 +0000)]
[GlobalISel][AArch64] Add isel support for G_INSERT_VECTOR_ELT on v2s32s

This adds support for v2s32 vector inserts, and updates the selection +
regbankselect tests for G_INSERT_VECTOR_ELT.

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

llvm-svn: 357318

5 years ago[X86] When using Win64 ABI, exit with error if SSE is disabled for varargs
Amara Emerson [Fri, 29 Mar 2019 21:30:51 +0000 (21:30 +0000)]
[X86] When using Win64 ABI, exit with error if SSE is disabled for varargs

We need XMM registers to handle varargs with the Win64 ABI. Before we would
silently generate bad code resulting in an assertion failure elsewhere in the
backend.

llvm-svn: 357317

5 years agoFix build following r357308 : Ensure only live thunks are considered when creating...
Alexandre Ganea [Fri, 29 Mar 2019 21:24:19 +0000 (21:24 +0000)]
Fix build following r357308 : Ensure only live thunks are considered when creating import modules

llvm-svn: 357316

5 years ago[MemorySSA] Don't optimize incomplete phis.
Alina Sbirlea [Fri, 29 Mar 2019 21:16:31 +0000 (21:16 +0000)]
[MemorySSA] Don't optimize incomplete phis.

Summary:
MemoryPhis cannot be optimized out until they are complete.
Resolves PR41254.

Reviewers: george.burgess.iv

Subscribers: sanjoy, jlebar, Prazek, jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 357315

5 years agoDon't copy the .drective section with std::string
Reid Kleckner [Fri, 29 Mar 2019 21:00:22 +0000 (21:00 +0000)]
Don't copy the .drective section with std::string

Both COFF and bitcode input files expose these as stable strings.

llvm-svn: 357314

5 years ago[ScriptInterpreterPython] Fix the unit test after refactor
Jonas Devlieghere [Fri, 29 Mar 2019 20:56:52 +0000 (20:56 +0000)]
[ScriptInterpreterPython] Fix the unit test after refactor

llvm-svn: 357313

5 years ago[clang-tidy] Fix PR28406
Alexander Kornienko [Fri, 29 Mar 2019 20:55:29 +0000 (20:55 +0000)]
[clang-tidy] Fix PR28406

Fix the crash resulting from a careless use of getLocWithOffset. At the
beginning of a macro expansion it produces an invalid SourceLocation that causes
an assertion failure later on.

llvm-svn: 357312

5 years ago[WebAssembly] "atomics" feature requires shared memory
Thomas Lively [Fri, 29 Mar 2019 20:43:49 +0000 (20:43 +0000)]
[WebAssembly] "atomics" feature requires shared memory

Summary:
Makes it a linker error if the "atomics" feature is used but the user
does not opt in to shared memory or if "atomics" is disallowed but the
user does opt in to shared memory. Also check that an appropriate max
memory size is supplied if shared memory is used.

Reviewers: sbc100, aheejin

Subscribers: dschuff, jgravelle-google, sunfish, jfb, llvm-commits

Tags: #llvm

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

llvm-svn: 357310

5 years ago[DAGCombiner] Rewrite ImproveLifetimeNodeChain to avoid DAG loop.
Nirav Dave [Fri, 29 Mar 2019 20:26:23 +0000 (20:26 +0000)]
[DAGCombiner] Rewrite ImproveLifetimeNodeChain to avoid DAG loop.

Avoid EXPENSIVE_CHECK failure. NFCI.

llvm-svn: 357309

5 years ago[LLD][COFF] Generate import modules & COFF groups in PDB
Alexandre Ganea [Fri, 29 Mar 2019 20:25:34 +0000 (20:25 +0000)]
[LLD][COFF] Generate import modules & COFF groups in PDB

Generate import modules for each imported DLL, along with its symbol stream.
Also create COFF groups in the * Linker * module, one for each PartialSection (input, unmerged sections)
Currently COFF groups are disabled for MINGW because it significantly increases PDB sizes. We could enable that later with an option.

The overall objective for this change is to support code hot patching tools. Such tools need to know the import libraries used, from the PDB alone.

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

llvm-svn: 357308

5 years ago[Python] Remove Python include from ScriptInterpreterPython.h
Jonas Devlieghere [Fri, 29 Mar 2019 20:17:20 +0000 (20:17 +0000)]
[Python] Remove Python include from ScriptInterpreterPython.h

This patch limits the scope of the python header to the implementation
of the python script interpreter plugin. ScriptInterpreterPython is now
an abstract interface that doesn't expose any Python specific types, and
is implemented by the ScriptInterpreterPythonImpl.

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

llvm-svn: 357307

5 years ago[pstl] Qualify calls to internal functions
Louis Dionne [Fri, 29 Mar 2019 20:11:24 +0000 (20:11 +0000)]
[pstl] Qualify calls to internal functions

This guards against unintended ADL issues.
Thanks to Thomas Rogers for the patch.

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

llvm-svn: 357306

5 years ago[LLD][COFF] Improve checkFailIfMismatch()
Alexandre Ganea [Fri, 29 Mar 2019 19:58:58 +0000 (19:58 +0000)]
[LLD][COFF] Improve checkFailIfMismatch()

As suggested by ruiu here (https://reviews.llvm.org/D58910#1425484), defer a call to toString(File) until it's really needed (if there's an error)

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

llvm-svn: 357305

5 years ago[Sema] Avoid sending a dependent expression to the constant evaluator.
Erik Pilkington [Fri, 29 Mar 2019 19:53:41 +0000 (19:53 +0000)]
[Sema] Avoid sending a dependent expression to the constant evaluator.

Fixes llvm.org/PR41286

llvm-svn: 357304

5 years ago[WebAssembly] Handle END_LOOP in unreachable BB in CFGStackify
Heejin Ahn [Fri, 29 Mar 2019 19:36:51 +0000 (19:36 +0000)]
[WebAssembly] Handle END_LOOP in unreachable BB in CFGStackify

Summary:
This fixes crashes when a BB in which an END_LOOP is to be placed is
unreachable and does not have any predecessors. Fixes PR41307.

Reviewers: dschuff

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

Tags: #llvm

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

llvm-svn: 357303

5 years agoAMDGPU: Remove dx10-clamp from subtarget features
Matt Arsenault [Fri, 29 Mar 2019 19:14:54 +0000 (19:14 +0000)]
AMDGPU: Remove dx10-clamp from subtarget features

Since this can be set with s_setreg*, it should not be a subtarget
property. Set a default based on the calling convention, and Introduce
a new amdgpu-dx10-clamp attribute to override this if desired.

Also introduce a new amdgpu-ieee attribute to match.

The values need to match to allow inlining. I think it is OK for the
caller's dx10-clamp attribute to override the callee, but there
doesn't appear to be the infrastructure to do this currently without
definining the attribute in the generic Attributes.td.

Eventually the calling convention lowering will need to insert a mode
switch somewhere for these.

llvm-svn: 357302

5 years ago[Hexagon] Remove fcmp undef from reduced tests
Simon Pilgrim [Fri, 29 Mar 2019 19:14:52 +0000 (19:14 +0000)]
[Hexagon] Remove fcmp undef from reduced tests

Pre-commit for D60006 (Add fcmp UNDEF handling to SelectionDAG::FoldSetCC)

Approved by @kparzysz (Krzysztof Parzyszek)

llvm-svn: 357301

5 years ago[X86] Add test cases showing failure to use RMW form of negate when only flags are...
Craig Topper [Fri, 29 Mar 2019 19:09:37 +0000 (19:09 +0000)]
[X86] Add test cases showing failure to use RMW form of negate when only flags are used. NFC

llvm-svn: 357300

5 years ago[DAG] Avoid redundancy in StoreMerge TokenFactor generation.
Nirav Dave [Fri, 29 Mar 2019 18:50:22 +0000 (18:50 +0000)]
[DAG] Avoid redundancy in StoreMerge TokenFactor generation.

Avoid generating redundant TokenFactor when all merged stores have
the same chain.

llvm-svn: 357299

5 years ago[Sema] Fix assertion when `auto` parameter in lambda has an attribute.
Volodymyr Sapsai [Fri, 29 Mar 2019 18:47:07 +0000 (18:47 +0000)]
[Sema] Fix assertion when `auto` parameter in lambda has an attribute.

Fixes the assertion
> no Attr* for AttributedType*
> UNREACHABLE executed at llvm-project/clang/lib/Sema/SemaType.cpp:298!

In `TypeProcessingState::getAttributedType` we put into `AttrsForTypes`
types with `auto` but later in
`TypeProcessingState::takeAttrForAttributedType` we use transformed
types and that's why cannot find `Attr` corresponding to
`AttributedType`.

Fix by keeping `AttrsForTypes` up to date after replacing `AutoType`.

rdar://problem/47689465

Reviewers: rsmith, arphaman, aaron.ballman

Reviewed By: aaron.ballman

Subscribers: jkorous, dexonsmith, jdoerfert, cfe-commits

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

llvm-svn: 357298

5 years ago[X86] Use cached OptForSize in X86ISelDAGToDAG.cpp instead of pulling it from the...
Craig Topper [Fri, 29 Mar 2019 18:36:40 +0000 (18:36 +0000)]
[X86] Use cached OptForSize in X86ISelDAGToDAG.cpp instead of pulling it from the function attribute. NFCI

llvm-svn: 357297

5 years ago[Driver] Use --warn-shared-textrel for Android.
Dan Albert [Fri, 29 Mar 2019 18:34:25 +0000 (18:34 +0000)]
[Driver] Use --warn-shared-textrel for Android.

Android does not allow shared text relocations. Enable the linker
warning to detect them by default.

Reviewers: srhines, pirama

Reviewed By: srhines

Subscribers: cfe-commits

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

llvm-svn: 357296

5 years ago[SystemZ] Regenerate double constant comparison test
Simon Pilgrim [Fri, 29 Mar 2019 18:23:08 +0000 (18:23 +0000)]
[SystemZ] Regenerate double constant comparison test

Prep work for PR40800 (Add UNDEF handling to SelectionDAG::FoldSetCC)

llvm-svn: 357295

5 years ago[MIPS] Regenerate double constant comparison test
Simon Pilgrim [Fri, 29 Mar 2019 18:22:18 +0000 (18:22 +0000)]
[MIPS] Regenerate double constant comparison test

Prep work for PR40800 (Add UNDEF handling to SelectionDAG::FoldSetCC)

llvm-svn: 357294

5 years ago[ARM] Regenerate execute-only float comparison tests
Simon Pilgrim [Fri, 29 Mar 2019 18:21:19 +0000 (18:21 +0000)]
[ARM] Regenerate execute-only float comparison tests

Prep work for PR40800 (Add UNDEF handling to SelectionDAG::FoldSetCC)

llvm-svn: 357293

5 years ago[ScriptInterpreterPython] Remove unused field (NFC)
Jonas Devlieghere [Fri, 29 Mar 2019 17:58:07 +0000 (17:58 +0000)]
[ScriptInterpreterPython] Remove unused field (NFC)

The m_lldb_module was initialized but not used.

llvm-svn: 357292

5 years ago[InstCombine] autogenerate complete checks; NFC
Sanjay Patel [Fri, 29 Mar 2019 17:51:39 +0000 (17:51 +0000)]
[InstCombine] autogenerate complete checks; NFC

llvm-svn: 357291

5 years agoVarious fixes and additions to creduce-clang-crash.py
George Burgess IV [Fri, 29 Mar 2019 17:50:43 +0000 (17:50 +0000)]
Various fixes and additions to creduce-clang-crash.py

Some more additions to the script - mainly reducing the clang args after
the creduce run by removing them one by one and seeing if the crash
reproduces. Other things:

- remove the --crash flag when "fatal error" occurs
- fixed to read stack trace functions from the top
- run creduce on a copy of the original file

Patch by Amy Huang!

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

llvm-svn: 357290

5 years ago[AMDGPU] Add an additional Code Object V3 assembler example
Scott Linder [Fri, 29 Mar 2019 17:49:51 +0000 (17:49 +0000)]
[AMDGPU] Add an additional Code Object V3 assembler example

Document the intended use of the `.amdgcn.next_free_{s,v}gpr` in the
context of multiple kernels and functions.

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

llvm-svn: 357289

5 years ago[InstCombine] regenerate test checks; NFC
Sanjay Patel [Fri, 29 Mar 2019 17:47:51 +0000 (17:47 +0000)]
[InstCombine] regenerate test checks; NFC

llvm-svn: 357288

5 years ago[CMake] Move link dependencies where they are used.
Jonas Devlieghere [Fri, 29 Mar 2019 17:47:26 +0000 (17:47 +0000)]
[CMake] Move link dependencies where they are used.

The utility library shouldn't depend on curses, libedit or python. Move
curses to core, libedit to host and python to the python plugin.

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

llvm-svn: 357287

5 years ago[AArch64] Regenerate half precision tests
Simon Pilgrim [Fri, 29 Mar 2019 17:46:06 +0000 (17:46 +0000)]
[AArch64] Regenerate half precision tests

Prep work for PR40800 (Add UNDEF handling to SelectionDAG::FoldSetCC)

llvm-svn: 357286

5 years ago[AMDGPU] Switch default DWARF version to 5
Scott Linder [Fri, 29 Mar 2019 17:45:40 +0000 (17:45 +0000)]
[AMDGPU] Switch default DWARF version to 5

Effectively reverts r337612. The issues that cropped up with the last
attempt appear to have gone away.

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

llvm-svn: 357285

5 years ago[llvm][NFC] Factor out logic for getting incoming & back Loop edges
Mircea Trofin [Fri, 29 Mar 2019 17:39:17 +0000 (17:39 +0000)]
[llvm][NFC] Factor out logic for getting incoming & back Loop edges

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 357284

5 years ago[DAGCombine] Prune unnused nodes.
Nirav Dave [Fri, 29 Mar 2019 17:35:56 +0000 (17:35 +0000)]
[DAGCombine] Prune unnused nodes.

Summary:
Nodes that have no uses are eventually pruned when they are selected
from the worklist. Record nodes newly added to the worklist or DAG and
perform pruning after every combine attempt.

Reviewers: efriedma, RKSimon, craig.topper, spatel, jyknight

Reviewed By: jyknight

Subscribers: jdoerfert, jyknight, nemanjai, jvesely, nhaehnle, javed.absar, hiraditya, jsji, llvm-commits

Tags: #llvm

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

llvm-svn: 357283

5 years ago[Cmake] Unify python variables
Jonas Devlieghere [Fri, 29 Mar 2019 17:35:42 +0000 (17:35 +0000)]
[Cmake] Unify python variables

FindPythonInterp and FindPythonLibs do two things, they set some
variables (PYTHON_LIBRARIES, PYTHON_INCLUDE_DIRS) and update the cached
variables (PYTHON_LIBRARY, PYTHON_INCLUDE_DIR) which are also used to
specify a custom python installation.

I believe the canonical way to do this is to use the PYTHON_LIBRARIES
and PYTHON_INCLUDE_DIRS variables instead of the cached ones. However,
since the cached variables are accessible from the cache and GUI, this
is a lot less confusing when you're trying to debug why a variable did
or didn't get the value you expected. Furthermore, as far as I can tell,
the implementation uses the cached variables to set their LIBRARIES/DIRS
counterparts. This is also the reason this works today even though we
mix-and-match.

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

llvm-svn: 357282

5 years ago[ARM] Regenerate vector comparison tests
Simon Pilgrim [Fri, 29 Mar 2019 17:35:11 +0000 (17:35 +0000)]
[ARM] Regenerate vector comparison tests

Prep work for PR40800 (Add UNDEF handling to SelectionDAG::FoldSetCC)

llvm-svn: 357281

5 years ago[CodeGen] Refactor the option for the maximum jump table size
Evandro Menezes [Fri, 29 Mar 2019 17:28:11 +0000 (17:28 +0000)]
[CodeGen] Refactor the option for the maximum jump table size

Refactor the option `max-jump-table-size` to default to the maximum
representable number.  Essentially, NFC.

llvm-svn: 357280

5 years ago[DAG] Set up infrastructure to avoid smart constructor-based dangling nodes
Nirav Dave [Fri, 29 Mar 2019 17:26:40 +0000 (17:26 +0000)]
[DAG] Set up infrastructure to avoid smart constructor-based dangling nodes

Summary:
Various SelectionDAG non-combine operations (e.g. the getNode smart
constructor and legalization) may leave dangling nodes by applying
optimizations without fully pruning unused result values. This results
in nodes that are never added to the worklist and therefore can not be
pruned.

Add a node inserter for the combiner to make sure such nodes have the
chance of being pruned. This allows a number of additional peephole
optimizations.

Reviewers: efriedma, RKSimon, craig.topper, jyknight

Reviewed By: jyknight

Subscribers: msearles, jyknight, sdardis, nemanjai, javed.absar, hiraditya, jrtc27, atanasyan, jsji, llvm-commits

Tags: #llvm

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

llvm-svn: 357279

5 years ago[X86] Fix some tests using fcmp with undef arguments
Simon Pilgrim [Fri, 29 Mar 2019 17:20:27 +0000 (17:20 +0000)]
[X86] Fix some tests using fcmp with undef arguments

Prep work for PR40800 (Add UNDEF handling to SelectionDAG::FoldSetCC)

llvm-svn: 357278

5 years ago[Python] Remove readline module
Jonas Devlieghere [Fri, 29 Mar 2019 17:12:08 +0000 (17:12 +0000)]
[Python] Remove readline module

Todd added this empty readline module to workaround an issue with an old
version of Python on Ubuntu in 2014 (18841). In the meantime, libedit
seems to have fixed the underlying issue, and indeed, I wasn't able to
reproduce this.

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

llvm-svn: 357277

5 years agoUse the multi-lockable form of std::lock for operator=
Jim Ingham [Fri, 29 Mar 2019 17:07:30 +0000 (17:07 +0000)]
Use the multi-lockable form of std::lock for operator=

For = operators for lists that have mutexes, we were either
just taking the locks sequentially or hand-rolling a trick
to try to avoid lock inversion.  Use the std::lock mechanism
for this instead.

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

llvm-svn: 357276

5 years ago[fuchsia] Add clang-doc to Fuchsia distribution
Julie Hockett [Fri, 29 Mar 2019 16:56:37 +0000 (16:56 +0000)]
[fuchsia] Add clang-doc to Fuchsia distribution

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

llvm-svn: 357275

5 years ago[clang-doc] Build as clang_tool
Julie Hockett [Fri, 29 Mar 2019 16:56:36 +0000 (16:56 +0000)]
[clang-doc] Build as clang_tool

Instead of as clang_executable.

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

llvm-svn: 357274

5 years ago[InstCombine] move shuffle canonicalizations before other transforms
Sanjay Patel [Fri, 29 Mar 2019 16:49:38 +0000 (16:49 +0000)]
[InstCombine] move shuffle canonicalizations before other transforms

This may not be NFC, but I'm not sure how to expose any diffs in
tests. In theory, it should be slightly more efficient and possibly
more profitable to do the canonicalizations (which can increase the
undef elements in the mask) ahead of SimplifyDemandedVectorElts().

llvm-svn: 357272

5 years ago[llvm-readobj] Add some generic notes (e.g. NT_VERSION)
Jordan Rupprecht [Fri, 29 Mar 2019 16:48:19 +0000 (16:48 +0000)]
[llvm-readobj] Add some generic notes (e.g. NT_VERSION)

Summary: Support reading notes that don't have a standard note name.

Reviewers: MaskRay

Reviewed By: MaskRay

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 357271

5 years ago[llvm-readelf] Allow prefix flags for -p and -x
Jordan Rupprecht [Fri, 29 Mar 2019 16:43:13 +0000 (16:43 +0000)]
[llvm-readelf] Allow prefix flags for -p and -x

Summary: This allows syntax like `llvm-readelf -p.data1 -x.data2`.

Reviewers: jhenderson

Reviewed By: jhenderson

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 357270

5 years ago[ELF][MachO][wasm] Simplify range-style std::find{,_if} with STLExtras.h utilities...
Fangrui Song [Fri, 29 Mar 2019 16:21:16 +0000 (16:21 +0000)]
[ELF][MachO][wasm] Simplify range-style std::find{,_if} with STLExtras.h utilities. NFC

llvm-svn: 357269

5 years agoDon't abort() in lldb_assert and document why.
Adrian Prantl [Fri, 29 Mar 2019 16:12:27 +0000 (16:12 +0000)]
Don't abort() in lldb_assert and document why.

rdar://problem/49356014

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

llvm-svn: 357268

5 years agoMark fenv.h as a system header before the #include_next directive
Eric Fiselier [Fri, 29 Mar 2019 16:03:57 +0000 (16:03 +0000)]
Mark fenv.h as a system header before the #include_next directive

This fixes a -Wgnu-include-next warning

Patch by dmauro.

llvm-svn: 357267

5 years ago[SLP] Add support for commutative icmp/fcmp predicates
Simon Pilgrim [Fri, 29 Mar 2019 15:28:25 +0000 (15:28 +0000)]
[SLP] Add support for commutative icmp/fcmp predicates

For the cases where the icmp/fcmp predicate is commutative, use reorderInputsAccordingToOpcode to collect and commute the operands.

This requires a helper to recognise commutativity in both general Instruction and CmpInstr types - the CmpInst::isCommutative doesn't overload the Instruction::isCommutative method for reasons I'm not clear on (maybe because its based on predicate not opcode?!?).

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

llvm-svn: 357266

5 years ago[llvm-objcopy] Fix case style of LayoutSegments. NFC
Fangrui Song [Fri, 29 Mar 2019 15:27:58 +0000 (15:27 +0000)]
[llvm-objcopy] Fix case style of LayoutSegments. NFC

llvm-svn: 357265

5 years ago[mips] Fix lowering a signed immediate for *.d MSA instructions
Simon Atanasyan [Fri, 29 Mar 2019 15:15:22 +0000 (15:15 +0000)]
[mips] Fix lowering a signed immediate for *.d MSA instructions

The `lowerMSASplatImm` function zero-extends `i32` immediates while
building constant. If target type is `i64`, negative immediate loses
the sign. As a result, for example `__builtin_msa_ldi_d(-1)` lowered
to series of instruction loads incorrect value 0xffffffff to the `$w0`
register instead of single `ldi.d $w0, -1` instruction.

The fix zero-extends unsigned immediates and signed-extend signed
immediates.

Differential Revision: http://reviews.llvm.org/D59884

llvm-svn: 357264

5 years ago[NFC][llvm-exegesis] Also promote getSchedClassPoint() into ResolvedSchedClass.
Roman Lebedev [Fri, 29 Mar 2019 14:58:01 +0000 (14:58 +0000)]
[NFC][llvm-exegesis] Also promote getSchedClassPoint() into ResolvedSchedClass.

Summary:
It doesn't need anything from Analysis::SchedClassCluster class,
and takes ResolvedSchedClass as param, so this seems rather fitting.

Reviewers: courbet, gchatelet

Reviewed By: courbet

Subscribers: tschuett, llvm-commits

Tags: #llvm

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

llvm-svn: 357263

5 years ago[AMDGPU][MC] Corrected conversion rules for inlinable constants to match rules for...
Dmitry Preobrazhensky [Fri, 29 Mar 2019 14:50:20 +0000 (14:50 +0000)]
[AMDGPU][MC] Corrected conversion rules for inlinable constants to match rules for literals

See bug 40806: https://bugs.llvm.org/show_bug.cgi?id=40806

Reviewers: artem.tamazov, arsenm

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

llvm-svn: 357262

5 years agogn build: Merge r357248
Nico Weber [Fri, 29 Mar 2019 14:31:28 +0000 (14:31 +0000)]
gn build: Merge r357248

llvm-svn: 357261

5 years agogn build: Merge r357259
Nico Weber [Fri, 29 Mar 2019 14:30:01 +0000 (14:30 +0000)]
gn build: Merge r357259

llvm-svn: 357260

5 years ago[NFC][llvm-exegesis] Refactor ResolvedSchedClass & friends
Roman Lebedev [Fri, 29 Mar 2019 14:24:27 +0000 (14:24 +0000)]
[NFC][llvm-exegesis] Refactor ResolvedSchedClass & friends

Summary:
`ResolvedSchedClass` will need to be used outside of `Analysis`
(before `InstructionBenchmarkClustering` even), therefore promote
it into a non-private top-level class, and while there also
move all of the functions that are only called by `ResolvedSchedClass`
into that same new file.

Reviewers: courbet, gchatelet

Reviewed By: courbet

Subscribers: mgorny, tschuett, mgrang, jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 357259

5 years ago[DAGCombiner] simplify shuffle of shuffle
Sanjay Patel [Fri, 29 Mar 2019 14:20:38 +0000 (14:20 +0000)]
[DAGCombiner] simplify shuffle of shuffle

After investigating the examples from D59777 targeting an SSE4.1 machine,
it looks like a very different problem due to how we map illegal types (256-bit in these cases).

We're missing a shuffle simplification that maps elements of a vector back to a shuffled operand.
We have a more general version of this transform in DAGCombiner::visitVECTOR_SHUFFLE(), but that
generality means it is limited to patterns with a one-use constraint, and the examples here have
2 uses. We don't need any uses or legality limitations for a simplification (no new value is
created).

It looks like we miss this pattern in IR too.

In one of the zext examples here, we have shuffle masks like this:

Shuf0 = vector_shuffle<0,u,3,7,0,u,3,7>
Shuf = vector_shuffle<4,u,6,7,u,u,u,u>

...so that's moving the high half of the 1st vector into the low half. But the high half of the
1st vector is already identical to the low half.

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

llvm-svn: 357258

5 years agoRecommit "[DSE] Preserve basic block ordering using OrderedBasicBlock."
Florian Hahn [Fri, 29 Mar 2019 14:10:24 +0000 (14:10 +0000)]
Recommit "[DSE] Preserve basic block ordering using OrderedBasicBlock."

Updated to use DenseMap::insert instead of [] operator for insertion, to
avoid a crash caused by epoch checks.

This reverts commit 2b85de438326f9d27bc96dc934ec98b98abdb337.

llvm-svn: 357257

5 years ago[DAGCombine] Improve Lifetime node chains.
Nirav Dave [Fri, 29 Mar 2019 14:09:47 +0000 (14:09 +0000)]
[DAGCombine] Improve Lifetime node chains.

Improve both start and end lifetime nodes chain dependencies.

Reviewers: courbet

Reviewed By: courbet

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 357256

5 years agoclang-cl: Expose -fprofile-generate and -fcs-profile-generate (PR41252)
Hans Wennborg [Fri, 29 Mar 2019 14:03:34 +0000 (14:03 +0000)]
clang-cl: Expose -fprofile-generate and -fcs-profile-generate (PR41252)

llvm-svn: 357255

5 years ago[DAGCombiner] fold sext into decrement
Sanjay Patel [Fri, 29 Mar 2019 13:49:08 +0000 (13:49 +0000)]
[DAGCombiner] fold sext into decrement

This is a sibling to rL357178 that I noticed we'd hit if we chose
an alternate transform in D59818.

  %z = zext i8 %x to i32
  %dec = add i32 %z, -1
  %r = sext i32 %dec to i64
  =>
  %z2 = zext i8 %x to i64
  %r = add i64 %z2, -1

https://rise4fun.com/Alive/kPP

The x86 vector diffs show a slight regression, so there's a chance
that we should limit this and the previous transform to scalars.

But given that we allowed vectors before, I'm matching that behavior
here. We should change both transforms together if that's the right
thing to do.

llvm-svn: 357254

5 years agoFix MSVC "not all control paths return a value" warning. NFCI.
Simon Pilgrim [Fri, 29 Mar 2019 13:43:00 +0000 (13:43 +0000)]
Fix MSVC "not all control paths return a value" warning. NFCI.

llvm-svn: 357253

5 years agoSwitch lowering: exploit unreachable fall-through when lowering case range cluster
Hans Wennborg [Fri, 29 Mar 2019 13:40:05 +0000 (13:40 +0000)]
Switch lowering: exploit unreachable fall-through when lowering case range cluster

In the example below, we would previously emit two range checks, one for cases
1--3 and one for 4--6. This patch makes us exploit the fact that the
fall-through is unreachable and only one range check is necessary.

  switch i32 %i, label %default [
    i32 1,  label %bb1
    i32 2,  label %bb1
    i32 3,  label %bb1
    i32 4,  label %bb2
    i32 5,  label %bb2
    i32 6,  label %bb2
  ]
  default: unreachable

llvm-svn: 357252

5 years ago[x86] add tests for decrement+sext; NFC
Sanjay Patel [Fri, 29 Mar 2019 13:34:48 +0000 (13:34 +0000)]
[x86] add tests for decrement+sext; NFC

llvm-svn: 357251

5 years ago[AArch64] Support selecting TPIDR_EL[1-3] as the thread base
Oliver Stannard [Fri, 29 Mar 2019 13:32:41 +0000 (13:32 +0000)]
[AArch64] Support selecting TPIDR_EL[1-3] as the thread base

Add an -mtp=el[0-3] option to select which of the AArch64 thread ID registers
will be used for the TLS base pointer.

This is a followup to rL356657 which added subtarget features to enable
accesses to the privileged thread ID registers.

Patch by Philip Derrin!

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

llvm-svn: 357250

5 years ago[AMDGPU][MC] Corrected handling of tied src for atomic return MUBUF opcodes
Dmitry Preobrazhensky [Fri, 29 Mar 2019 12:16:04 +0000 (12:16 +0000)]
[AMDGPU][MC] Corrected handling of tied src for atomic return MUBUF opcodes

See bug 40917: https://bugs.llvm.org/show_bug.cgi?id=40917

Reviewers: artem.tamazov, arsenm

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

llvm-svn: 357249

5 years ago[MCA] Add an experimental MicroOpQueue stage.
Andrea Di Biagio [Fri, 29 Mar 2019 12:15:37 +0000 (12:15 +0000)]
[MCA] Add an experimental MicroOpQueue stage.

This patch adds an experimental stage named MicroOpQueueStage.
MicroOpQueueStage can be used to simulate a hardware micro-op queue (basically,
a decoupling queue between 'decode' and 'dispatch').  Users can specify a queue
size, as well as a optional MaxIPC (which - in the absence of a "Decoders" stage
- can be used to simulate a different throughput from the decoders).

This stage is added to the default pipeline between the EntryStage and the
DispatchStage only if PipelineOption::MicroOpQueue is different than zero. By
default, llvm-mca sets PipelineOption::MicroOpQueue to the value of hidden flag
-micro-op-queue-size.

Throughput from the decoder can be simulated via another hidden flag named
-decoder-throughput.  That flag allows us to quickly experiment with different
frontend throughputs.  For targets that declare a loop buffer, flag
-decoder-throughput allows users to do multiple runs, each time simulating a
different throughput from the decoders.

This stage can/will be extended in future. For example, we could add a "buffer
full" event to notify bottlenecks caused by backpressure. flag
-decoder-throughput would probably go away if in future we delegate to another
stage (DecoderStage?) the simulation of a (potentially variable) throughput from
the decoders. For now, flag -decoder-throughput is "good enough" to run some
simple experiments.

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

llvm-svn: 357248

5 years agoAMDGPU: Make sram-ecc off by default for Vega20
Konstantin Zhuravlyov [Fri, 29 Mar 2019 12:04:18 +0000 (12:04 +0000)]
AMDGPU: Make sram-ecc off by default for Vega20

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

llvm-svn: 357247

5 years ago[llvm-readelf]Merge dynamic and static relocation printing to avoid code duplication
James Henderson [Fri, 29 Mar 2019 11:47:19 +0000 (11:47 +0000)]
[llvm-readelf]Merge dynamic and static relocation printing to avoid code duplication

The majority of the printRelocation and printDynamicRelocation functions
were identical. This patch factors this all out into a new function.
There are a couple of minor differences to do with printing of symbols
without names, but I think these are harmless, and in some cases a small
improvement.

Reviewed by: grimar, rupprecht, Higuoxing

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

llvm-svn: 357246

5 years ago[NFC][llvm-exegesis] Refactor Analysis::SchedClassCluster::measurementsMatch()
Roman Lebedev [Fri, 29 Mar 2019 11:36:08 +0000 (11:36 +0000)]
[NFC][llvm-exegesis] Refactor Analysis::SchedClassCluster::measurementsMatch()

Summary:
The diff looks scary but it really isn't:
1. I moved the check for the number of measurements into `SchedClassClusterCentroid::validate()`
2. While there, added a check that we can only have a single inverse throughput measurement. I missed that when adding it initially.
3. In `Analysis::SchedClassCluster::measurementsMatch()` is called with the current LLVM values from schedule class and the values from Centroid.
3.1. The values from centroid we can already get from `SchedClassClusterCentroid::getAsPoint()`.
     This isn't 100% a NFC, because previously for inverse throughput we used `min()`. I have asked whether i have done that correctly in
     https://reviews.llvm.org/D57647?id=184939#inline-510384 but did not hear back. I think `avg()` should be used too, thus it is a fix.
3.2. Finally, refactor the computation of the LLVM-specified values into `Analysis::SchedClassCluster::getSchedClassPoint()`
     I will need that function for [[ https://bugs.llvm.org/show_bug.cgi?id=41275 | PR41275 ]]

Reviewers: courbet, gchatelet

Reviewed By: courbet

Subscribers: tschuett, jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 357245

5 years ago[X86] Add X86TargetLowering::isCommutativeBinOp override.
Simon Pilgrim [Fri, 29 Mar 2019 11:25:58 +0000 (11:25 +0000)]
[X86] Add X86TargetLowering::isCommutativeBinOp override.

We currently just have test coverage for PMULUDQ - will add more in the future.

llvm-svn: 357244

5 years ago[SLP] Add support for swapping icmp/fcmp predicates to permit vectorization
Simon Pilgrim [Fri, 29 Mar 2019 10:41:00 +0000 (10:41 +0000)]
[SLP] Add support for swapping icmp/fcmp predicates to permit vectorization

We should be able to match elements with the swapped predicate as well - as long as we commute the source operands.

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

llvm-svn: 357243

5 years ago[PowerPC] Add the support for __builtin_setrnd() in clang
Kang Zhang [Fri, 29 Mar 2019 09:11:52 +0000 (09:11 +0000)]
[PowerPC] Add the support for __builtin_setrnd() in clang

Summary:
PowerPC64/PowerPC64le supports the builtin function __builtin_setrnd to set the floating point rounding mode. This function will use the least significant two bits of integer argument to set the floating point rounding mode.
double __builtin_setrnd(int mode);
The effective values for mode are:
0 - round to nearest
1 - round to zero
2 - round to +infinity
3 - round to -infinity
Note that the mode argument will modulo 4, so if the int argument is greater than 3, it will only use the least significant two bits of the mode. Namely, builtin_setrnd(102)) is equal to builtin_setrnd(2).

Reviewed By: jsji

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

llvm-svn: 357242

5 years ago[PowerPC] Add the support for __builtin_setrnd()
Kang Zhang [Fri, 29 Mar 2019 08:45:24 +0000 (08:45 +0000)]
[PowerPC] Add the support for __builtin_setrnd()

Summary:
PowerPC64/PowerPC64le supports the builtin function __builtin_setrnd to set the floating point rounding mode. This function will use the least significant two bits of integer argument to set the floating point rounding mode.
double __builtin_setrnd(int mode);
The effective values for mode are:
0 - round to nearest
1 - round to zero
2 - round to +infinity
3 - round to -infinity
Note that the mode argument will modulo 4, so if the int argument is greater than 3, it will only use the least significant two bits of the mode. Namely, builtin_setrnd(102)) is equal to builtin_setrnd(2).

Reviewed By: jsji

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

llvm-svn: 357241

5 years ago[Sanitizer] Add interceptor for wctomb
Pavel Labath [Fri, 29 Mar 2019 08:39:03 +0000 (08:39 +0000)]
[Sanitizer] Add interceptor for wctomb

Summary:
This is required to avoid msan false positives for code using this
function (although generally one should avoid using this function in
favor of wcrtomb).

Reviewers: eugenis, EricWF, vitalybuka

Subscribers: srhines, kubamracek, fedor.sergeev, delcypher, llvm-commits, #sanitizers

Tags: #llvm, #sanitizers

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

llvm-svn: 357240

5 years ago[ScheduleDAG] Move `Topo` and `addEdge` to base class.
Clement Courbet [Fri, 29 Mar 2019 08:33:05 +0000 (08:33 +0000)]
[ScheduleDAG] Move `Topo` and `addEdge` to base class.

Some DAG mutations can only be applied to `ScheduleDAGMI`, and have to
internally cast a `ScheduleDAGInstrs` to `ScheduleDAGMI`.

There is nothing actually specific to `ScheduleDAGMI` in `Topo`.

llvm-svn: 357239

5 years ago[llvm-objcopy] Delete two redundant reinterpret_cast. NFC
Fangrui Song [Fri, 29 Mar 2019 08:08:20 +0000 (08:08 +0000)]
[llvm-objcopy] Delete two redundant reinterpret_cast. NFC

llvm-svn: 357238

5 years agoTest commit. Fix typo.
Jim Lin [Fri, 29 Mar 2019 05:05:21 +0000 (05:05 +0000)]
Test commit. Fix typo.

llvm-svn: 357237