oota-llvm.git
8 years ago[LibCallSimplifier] less indenting; NFCI
Sanjay Patel [Wed, 6 Jan 2016 20:52:21 +0000 (20:52 +0000)]
[LibCallSimplifier] less indenting; NFCI

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

8 years ago[SplitLandingPadPredecessors] Create a PHINode for the original landingpad only if...
Chen Li [Wed, 6 Jan 2016 20:32:05 +0000 (20:32 +0000)]
[SplitLandingPadPredecessors] Create a PHINode for the original landingpad only if it has some uses

Summary: This patch adds a check in SplitLandingPadPredecessors to see if the original landingpad instruction has any uses. If not, we don't need to create a PHINode for it in the joint block since it's gonna be a dead code anyway. The motivation for this patch is that we found a bug that SplitLandingPadPredecessors created a PHINode of token type landingpad, which failed the verifier since PHINode can not be token type. However, the created PHINode will never be used in our code pattern. This patch will workaround this bug, and we might add supports in SplitLandingPadPredecessors to handle token type landingpad with uses in the future.

Reviewers: reames

Subscribers: llvm-commits

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

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

8 years agoPromote aggregate store to memset when possible
Amaury Sechet [Wed, 6 Jan 2016 19:47:24 +0000 (19:47 +0000)]
Promote aggregate store to memset when possible

Summary: As per title. This will allow the optimizer to pick up on it.

Reviewers: craig.topper, spatel, dexonsmith, Prazek, chandlerc, joker.eph, majnemer

Subscribers: llvm-commits

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

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

8 years agoRemove useless DEBUG
Amaury Sechet [Wed, 6 Jan 2016 19:45:09 +0000 (19:45 +0000)]
Remove useless DEBUG

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

8 years agoConsolidate MemRefs handling from BranchFolding and correct latent bug
Philip Reames [Wed, 6 Jan 2016 19:33:12 +0000 (19:33 +0000)]
Consolidate MemRefs handling from BranchFolding and correct latent bug

Move the logic from BranchFolding to use the shared infrastructure for merging MMOs introduced in 256909. This has the effect of making BranchFolding more capable.

In the process, fix a latent bug. The existing handling for merging didn't handle the case where one of the instructions being merged had overflowed and dropped MemRefs. This was a latent bug in the places the code was commoned from, but potentially reachable in BranchFolding.

Once this is in, we're left with a single place to consider implementing MMO unique-ing as proposed in http://reviews.llvm.org/D15230.

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

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

8 years ago[WinEH] Remove calculateCatchReturnSuccessorColors
David Majnemer [Wed, 6 Jan 2016 19:26:30 +0000 (19:26 +0000)]
[WinEH] Remove calculateCatchReturnSuccessorColors

The functionality that calculateCatchReturnSuccessorColors provides was
once non-trivial: it was a computation layered on top of funclet
coloring.

These days, LLVM IR directly encodes what
calculateCatchReturnSuccessorColors computed, obsoleting the need for
it.

No functionality change is intended.

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

8 years ago[LibCallSimplifier] use instruction-level fast-math-flags for tan/atan transform
Sanjay Patel [Wed, 6 Jan 2016 19:23:35 +0000 (19:23 +0000)]
[LibCallSimplifier] use instruction-level fast-math-flags for tan/atan transform

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

8 years ago[X86] Correctly model TLS calls w.r.t. frame requirements.
Quentin Colombet [Wed, 6 Jan 2016 19:09:26 +0000 (19:09 +0000)]
[X86] Correctly model TLS calls w.r.t. frame requirements.
TLS calls need the stack frame to be properly set up and this
implies that such calls need ADJUSTSTACK_xxx markers.

Fixes PR25820.

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

8 years agoMake WinCOFFObjectWriter.cpp's timestamp writing not use ENABLE_TIMESTAMPS
Nico Weber [Wed, 6 Jan 2016 19:05:19 +0000 (19:05 +0000)]
Make WinCOFFObjectWriter.cpp's timestamp writing not use ENABLE_TIMESTAMPS

LLVM_ENABLE_TIMESTAMPS controls if timestamps are embedded into llvm's
binaries. Turning it off is useful for deterministic builds.

r246905 made it so that the define suddenly also controls if the binaries that
the llvm binaries _create_ embed timestamps or not – but this shouldn't be a
configure-time option. r256203/r256204 added a driver option to toggle this on
and off, so this patch now passes this driver option in LLVM_ENABLE_TIMESTAMPS
builds so that if LLVM_ENABLE_TIMESTAMPS is set, the build of LLVM is
deterministic – but the built clang can still write timestamps into other
executables when requested.

This also allows removing some of the test machinery added in r292012 to work
around this problem.

See PR24740 for background.
http://reviews.llvm.org/D15783

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

8 years agorefactor divrem8 lowering; NFCI
Sanjay Patel [Wed, 6 Jan 2016 18:47:09 +0000 (18:47 +0000)]
refactor divrem8 lowering; NFCI

The code duplication contributed to PR25754:
https://llvm.org/bugs/show_bug.cgi?id=25754

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

8 years ago[ShrinkWrap] Fix FindIDom to only have one kind of failure.
Michael Kuperstein [Wed, 6 Jan 2016 18:40:11 +0000 (18:40 +0000)]
[ShrinkWrap] Fix FindIDom to only have one kind of failure.

FindIDom() can fail in two different ways - it can either return nullptr or the
block itself, depending on the circumstances. Some users of FindIDom() check
one error condition, while others check the other.

Change it to always return nullptr on failure.
This fixes PR26004.

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

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

8 years agoRevert r256952 due to lit test fails.
Weiming Zhao [Wed, 6 Jan 2016 18:31:44 +0000 (18:31 +0000)]
Revert r256952 due to lit test fails.

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

8 years ago[WebAssembly] Don't use range-based loop for a list that's being modified
Dan Gohman [Wed, 6 Jan 2016 18:29:35 +0000 (18:29 +0000)]
[WebAssembly] Don't use range-based loop for a list that's being modified

The first instruction in a block is what the rend() iterator points to, so
if it moves, we need to re-evaluate rend() so that we continue to iterate
through the rest of the instructions.

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

8 years agoFiltering IR printing for print-after-all/print-before-all
Weiming Zhao [Wed, 6 Jan 2016 18:20:25 +0000 (18:20 +0000)]
Filtering IR printing for print-after-all/print-before-all

Summary:
This patch implements "-print-funcs" option to support function filtering for IR printing like -print-after-all, -print-before etc.
Examples:
  -print-after-all -print-funcs=foo,bar

Reviewers: mcrosier, joker.eph

Subscribers: tejohnson, joker.eph, llvm-commits

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

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

8 years agoFix option desc in FunctionAttrs; NFC
Weiming Zhao [Wed, 6 Jan 2016 18:18:16 +0000 (18:18 +0000)]
Fix option desc in FunctionAttrs; NFC

Summary: The example in desc should match with actual option name

Reviewers: jmolloy

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

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

8 years agoScheduleDAGInstrs: Bug fix for missed memory dependency.
Geoff Berry [Wed, 6 Jan 2016 18:14:26 +0000 (18:14 +0000)]
ScheduleDAGInstrs: Bug fix for missed memory dependency.

Summary:
In buildSchedGraph(), when adding memory dependencies for loads, move
the call to adjustChainDeps() after the call to
addChainDependency(AliasChain) to handle the case where
addChainDependency(AliasChain) ends up not adding a dependency and
instead putting the SU on the RejectMemNodes list.  The call to
adjustChainDeps() must be done after the call to addChainDependency() in
order to process the SU added to the RejectMemNodes list to create
memory dependencies for it.

Reviewers: hfinkel, atrick, jonpa, resistor

Subscribers: mcrosier, llvm-commits

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

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

8 years ago[BasicAA] Extract WriteOnly predicate on parameters [NFC]
Philip Reames [Wed, 6 Jan 2016 18:10:35 +0000 (18:10 +0000)]
[BasicAA] Extract WriteOnly predicate on parameters [NFC]

Since writeonly is the only missing attribute and special case left for the memset/memcpy family of intrinsics, rearrange the code to make that much more clear.

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

8 years agoWebAssembly: add missing expected failures exposed by r256890
JF Bastien [Wed, 6 Jan 2016 17:08:56 +0000 (17:08 +0000)]
WebAssembly: add missing expected failures exposed by r256890

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

8 years ago[WebAssembly] Add -asm-verbose=false to llc tests.
Dan Gohman [Wed, 6 Jan 2016 16:45:05 +0000 (16:45 +0000)]
[WebAssembly] Add -asm-verbose=false to llc tests.

In general, disabling comments in the output reduces the chances of a
CHECK line accidentally matching a comment instead of its intended text.

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

8 years agoWebAssembly: add new expected failures exposed by r256890
JF Bastien [Wed, 6 Jan 2016 16:15:51 +0000 (16:15 +0000)]
WebAssembly: add new expected failures exposed by r256890

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

8 years agoAdd unittest for new CanReplace flag on MDNodes
Teresa Johnson [Wed, 6 Jan 2016 15:02:40 +0000 (15:02 +0000)]
Add unittest for new CanReplace flag on MDNodes

This adds a unittest for the support added in r256648 to add
a flag that can be used to prevent RAUW on temporary metadata
used as a map key.

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

8 years ago[Hexagon] Add system instructions for cache manipulation
Krzysztof Parzyszek [Wed, 6 Jan 2016 14:22:22 +0000 (14:22 +0000)]
[Hexagon] Add system instructions for cache manipulation

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

8 years agoRevert "GlobalsAA: Take advantage of ArgMemOnly, InaccessibleMemOnly and Inaccessible...
Amaury Sechet [Wed, 6 Jan 2016 13:23:52 +0000 (13:23 +0000)]
Revert "GlobalsAA: Take advantage of ArgMemOnly, InaccessibleMemOnly and InaccessibleMemOrArgMemOnly attributes"

Summary:
This reverts commit 5a9e526f29cf8510ab5c3d566fbdcf47ac24e1e9.

As per discussion in D15665

This also add a test case so that regression introduced by that diff are not reintroduced.

Reviewers: vaivaswatha, jmolloy, hfinkel, reames

Subscribers: llvm-commits

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

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

8 years ago[LV] Avoid creating empty reduction entries (NFC)
Matthew Simpson [Wed, 6 Jan 2016 12:50:29 +0000 (12:50 +0000)]
[LV] Avoid creating empty reduction entries (NFC)

This patch prevents us from unintentionally creating entries in the reductions
map for PHIs that are not actually reductions. This is currently not an issue
since we bail out if we encounter PHIs other than inductions or reductions.
However the behavior could become problematic as we add support for additional
recurrence types.

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

8 years agoPR25754: avoid generating UDIVREM8_ZEXT_HREG nodes with i64 result
Artyom Skrobov [Wed, 6 Jan 2016 09:41:10 +0000 (09:41 +0000)]
PR25754: avoid generating UDIVREM8_ZEXT_HREG nodes with i64 result

Reviewers: spatel, srking

Subscribers: llvm-commits

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

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

8 years agoImprove load/store to memcpy for aggregate
Amaury Sechet [Wed, 6 Jan 2016 09:30:39 +0000 (09:30 +0000)]
Improve load/store to memcpy for aggregate

Summary: It turns out that if we don't try to do it at the store location, we can do it before any operation that alias the load, as long as no operation alias the store.

Reviewers: craig.topper, spatel, dexonsmith, Prazek, chandlerc, joker.eph

Subscribers: llvm-commits

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

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

8 years ago[X86][SSE] There is no zmm addsubpd/addsubps instruction.
Simon Pilgrim [Wed, 6 Jan 2016 09:08:49 +0000 (09:08 +0000)]
[X86][SSE] There is no zmm addsubpd/addsubps instruction.

Replace the assert in combineShuffleToAddSub with an early out.

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

8 years ago[X86][SSE] An empty target shuffle mask is always a failure.
Simon Pilgrim [Wed, 6 Jan 2016 08:59:32 +0000 (08:59 +0000)]
[X86][SSE] An empty target shuffle mask is always a failure.

As discussed on D15378, move the mask.empty() tests to after the switch statement and consider any shuffle decode where the extracted target shuffle mask is empty as a failure.

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

8 years ago[X86] Use PS instead of TB for instructions that have PD/XS/XD variations. Use OpSize...
Craig Topper [Wed, 6 Jan 2016 06:18:41 +0000 (06:18 +0000)]
[X86] Use PS instead of TB for instructions that have PD/XS/XD variations. Use OpSize32 on an instruction that has an OpSize16 variant.

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

8 years ago[X86] Fix an incorrect usage of In32BitMode that should have been Not64BitMode.
Craig Topper [Wed, 6 Jan 2016 06:18:37 +0000 (06:18 +0000)]
[X86] Fix an incorrect usage of In32BitMode that should have been Not64BitMode.

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

8 years agoFix a warning [NFC]
Philip Reames [Wed, 6 Jan 2016 05:53:09 +0000 (05:53 +0000)]
Fix a warning [NFC]

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

8 years agoAdd != to YAMLParser's basic_collection_iterator.
Jordan Rose [Wed, 6 Jan 2016 05:17:12 +0000 (05:17 +0000)]
Add != to YAMLParser's basic_collection_iterator.

...and mark it as merely an input_iterator rather than a forward_iterator,
since it is destructive. And then rewrite == to take advantage of that.

Patch by Alex Denisov!

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

8 years ago[SimplifyLibCalls] Teach SimplifyLibCalls about operand bundles
David Majnemer [Wed, 6 Jan 2016 05:01:34 +0000 (05:01 +0000)]
[SimplifyLibCalls] Teach SimplifyLibCalls about operand bundles

If we replace one call-site with another, be sure to move over any
operand bundles that lingered on the old call-site.

This fixes PR26036.

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

8 years ago[BasicAA] Remove special casing of memset_pattern16 in favor of generic attribute...
Philip Reames [Wed, 6 Jan 2016 04:53:16 +0000 (04:53 +0000)]
[BasicAA] Remove special casing of memset_pattern16 in favor of generic attribute inference

Most of the properties of memset_pattern16 can be now covered by the generic attributes and inferred by InferFunctionAttrs.  The only exceptions are:
- We don't yet have a writeonly attribute for the first argument.
- We don't have an attribute for modeling the access size facts encoded in MemoryLocation.cpp.

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

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

8 years ago[BasicAA] Delete dead code related to memset/memcpy/memmove intrinsics [NFCI]
Philip Reames [Wed, 6 Jan 2016 04:43:03 +0000 (04:43 +0000)]
[BasicAA] Delete dead code related to memset/memcpy/memmove intrinsics [NFCI]

We only need to describe the writeonly property of one of the arguments. All of the rest of the semantics are nicely described by existing attributes in Intrinsics.td.

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

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

8 years agoExtract helper function to merge MemoryOperand lists [NFC]
Philip Reames [Wed, 6 Jan 2016 04:39:03 +0000 (04:39 +0000)]
Extract helper function to merge MemoryOperand lists [NFC]

In the discussion on http://reviews.llvm.org/D15730, Andy pointed out we had a utility function for merging MMO lists. Since it turned we actually had two copies and there's another review in progress (http://reviews.llvm.org/D15230) which needs the same, extract it into a utility function and clean up the interfaces to make it easier to use with a MachineInstBuilder.

I introduced a pair here to track size and allocation together. I think we should probably move in the direction of the MachineOperandsRef helper class, but I'm leaving that for further work. I want to get the poison state introduced before I make major changes to the interface.

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

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

8 years agoDelete trailing whitespace; NFC
Junmo Park [Wed, 6 Jan 2016 03:53:36 +0000 (03:53 +0000)]
Delete trailing whitespace; NFC

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

8 years agoDelete trailing whitespace; NFC
Junmo Park [Wed, 6 Jan 2016 03:41:30 +0000 (03:41 +0000)]
Delete trailing whitespace; NFC

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

8 years agoDo not define NOGDI. Mingw defines LOGFONTW type in wingdi.h and the mingw
Yunzhong Gao [Wed, 6 Jan 2016 03:01:10 +0000 (03:01 +0000)]
Do not define NOGDI. Mingw defines LOGFONTW type in wingdi.h and the mingw
version of shlobj.h includes shobjidl.h and the latter uses the LOGFONTW type.

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

8 years agoAnother attempt at fixing the i686-mingw32-RA-on-linux buildbot. I am getting
Yunzhong Gao [Wed, 6 Jan 2016 02:48:42 +0000 (02:48 +0000)]
Another attempt at fixing the i686-mingw32-RA-on-linux buildbot. I am getting
confused with what version of mingw is actually installed on the buildbot, and
for now I will just assume this is an unknown version which does not ship with
VersionHelpers.h.

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

8 years agoAnother attempt at fixing the i686-mingw32-RA-on-linux buildbot.
Yunzhong Gao [Wed, 6 Jan 2016 02:32:31 +0000 (02:32 +0000)]
Another attempt at fixing the i686-mingw32-RA-on-linux buildbot.

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

8 years ago[libFuzzer] extend the dictionary mutator to optionally overwrite data with the dict...
Kostya Serebryany [Wed, 6 Jan 2016 02:13:04 +0000 (02:13 +0000)]
[libFuzzer] extend the dictionary mutator to optionally overwrite data with the dict entry

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

8 years agoHopefully fix a mingw32 buildbot (i686-mingw32-RA-on-linux) which does not have
Yunzhong Gao [Wed, 6 Jan 2016 01:36:45 +0000 (01:36 +0000)]
Hopefully fix a mingw32 buildbot (i686-mingw32-RA-on-linux) which does not have
the VersionHelpers.h header.

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

8 years agoMore fix to coverage documentation
Xinliang David Li [Wed, 6 Jan 2016 01:23:41 +0000 (01:23 +0000)]
More fix to coverage documentation

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

8 years agoFixing PR25717: fatal IO error writing large outputs to console on Windows.
Yunzhong Gao [Wed, 6 Jan 2016 00:50:06 +0000 (00:50 +0000)]
Fixing PR25717: fatal IO error writing large outputs to console on Windows.

This patch is similar to the Python issue#11395. We need to cap the output
size to 32767 on Windows to work around the size limit of WriteConsole().
Reference: https://bugs.python.org/issue11395

Writing a test for this bug turns out to be harder than I thought. I am
still working on it (see phabricator review D15705).

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

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

8 years agorangify; NFCI
Sanjay Patel [Wed, 6 Jan 2016 00:45:42 +0000 (00:45 +0000)]
rangify; NFCI

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

8 years ago[SelectionDAGBuilder] Set NoUnsignedWrap for inbounds gep and load/store offsets.
Dan Gohman [Wed, 6 Jan 2016 00:43:06 +0000 (00:43 +0000)]
[SelectionDAGBuilder] Set NoUnsignedWrap for inbounds gep and load/store offsets.

In an inbounds getelementptr, when an index produces a constant non-negative
offset to add to the base, the add can be assumed to not have unsigned overflow.

This relies on the assumption that addresses can't occupy more than half the
address space, which isn't possible in C because it wouldn't be possible to
represent the difference between the start of the object and one-past-the-end
in a ptrdiff_t.

Setting the NoUnsignedWrap flag is theoretically useful in general, and is
specifically useful to the WebAssembly backend, since it permits stronger
constant offset folding.

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

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

8 years agouse std::max ; NFCI
Sanjay Patel [Wed, 6 Jan 2016 00:36:59 +0000 (00:36 +0000)]
use std::max ; NFCI

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

8 years agoA (B + C) = A B + A C ; NFCI
Sanjay Patel [Wed, 6 Jan 2016 00:32:15 +0000 (00:32 +0000)]
A (B + C) = A B + A C ; NFCI

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

8 years agofix typo; NFC
Sanjay Patel [Wed, 6 Jan 2016 00:23:12 +0000 (00:23 +0000)]
fix typo; NFC

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

8 years ago[libfuzzer] print_new_cov_pcs experimental option.
Mike Aizatsky [Wed, 6 Jan 2016 00:21:22 +0000 (00:21 +0000)]
[libfuzzer] print_new_cov_pcs experimental option.

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

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

8 years agofix typos; NFC
Sanjay Patel [Wed, 6 Jan 2016 00:18:29 +0000 (00:18 +0000)]
fix typos; NFC

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

8 years ago[libFuzzer] make trace-based fuzzing not crash in presence of threads
Kostya Serebryany [Wed, 6 Jan 2016 00:03:35 +0000 (00:03 +0000)]
[libFuzzer] make trace-based fuzzing not crash in presence of threads

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

8 years ago[Statepoints] Check for the "gc-leaf-function" attribute on call sites as well.
Manuel Jacob [Tue, 5 Jan 2016 23:59:08 +0000 (23:59 +0000)]
[Statepoints] Check for the "gc-leaf-function" attribute on call sites as well.

Reviewers: sanjoy, reames

Subscribers: sanjoy, llvm-commits

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

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

8 years ago[LibCallSimplfier] use instruction-level fast-math-flags for fmin/fmax transforms
Sanjay Patel [Tue, 5 Jan 2016 20:46:19 +0000 (20:46 +0000)]
[LibCallSimplfier] use instruction-level fast-math-flags for fmin/fmax transforms

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

8 years agoAMDGPU/SI: Do not move scratch resource register on Tonga & Iceland
Nicolai Haehnle [Tue, 5 Jan 2016 20:42:49 +0000 (20:42 +0000)]
AMDGPU/SI: Do not move scratch resource register on Tonga & Iceland

Due to the SGPR init bug, every program claims to use the same number
of SGPRs anyway, so there's no point in trying to shift those registers
down from their initial spot of reservation.

Add a test that uses VGPR spilling and blocks most SGPRs from being used for
the scratch resource register. Previously, this would run into an assertion.

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

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

8 years agoImplement load to store => memcpy in MemCpyOpt for aggregates
Amaury Sechet [Tue, 5 Jan 2016 20:17:48 +0000 (20:17 +0000)]
Implement load to store => memcpy in MemCpyOpt for aggregates

Summary:
Most of the tool chain is able to optimize scalar and memcpy like operation effisciently while it isn't that good with aggregates. In order to improve the support of aggregate, we try to change aggregate manipulation into either scalar or memcpy like ones whenever possible without loosing informations.

This is one such opportunity.

Reviewers: craig.topper, spatel, dexonsmith, Prazek, chandlerc

Subscribers: llvm-commits

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

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

8 years ago[Clang/Support/Windows/Unix] Command lines created by clang may exceed the command...
Oleg Ranevskyy [Tue, 5 Jan 2016 19:56:12 +0000 (19:56 +0000)]
[Clang/Support/Windows/Unix] Command lines created by clang may exceed the command length limit set by the OS

Summary:
Hi Rafael,

Would you be able to review this patch, please?

(Clang part of the patch is D15832).

When clang runs an external tool, e.g. a linker, it may create a command line that exceeds the length limit.

Clang uses the llvm::sys::argumentsFitWithinSystemLimits function to check if command line length fits the OS

limitation. There are two problems in this function that may cause exceeding of the limit:

1. It ignores the length of the program path in its calculations. On the other hand, clang adds the program

path to the command line when it runs the program.

2. It assumes no space character is inserted after the last argument, which is not true for Windows. The flattenArgs function adds the trailing space for *each* argument. The result of this is that the terminating NULL character is not counted and may be placed beyond the length limit if the command line is exactly 32768 characters long. The WinAPI's CreateProcess does not find the NULL character and fails.

Reviewers: rafael, ygao, probinson

Subscribers: asl, llvm-commits

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

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

8 years agoCorrect my last commit (revision 256860).
Manuel Jacob [Tue, 5 Jan 2016 19:45:54 +0000 (19:45 +0000)]
Correct my last commit (revision 256860).

I forgot to save a small wording improvement before committing.

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

8 years ago[PlaceSafepoints] Add a test.
Manuel Jacob [Tue, 5 Jan 2016 19:40:58 +0000 (19:40 +0000)]
[PlaceSafepoints] Add a test.

Calls of functions with the "gc-leaf-function" attribute shouldn't be turned
into a safepoint.

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

8 years ago[InstCombine] insert a new shuffle before its uses (PR26015)
Sanjay Patel [Tue, 5 Jan 2016 19:09:47 +0000 (19:09 +0000)]
[InstCombine] insert a new shuffle before its uses (PR26015)

Although this solves the test case in PR26015:
https://llvm.org/bugs/show_bug.cgi?id=26015

And may solve PR25999:
https://llvm.org/bugs/show_bug.cgi?id=25999

...I suspect this is not the best solution. I think we want to insert the new shuffle
just ahead of the earliest ExtractElementInst that we're replacing, but I don't know
how that should be implemented.

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

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

8 years agoAdd function for testing string attributes to InvokeInst and CallSite. NFC.
Manuel Jacob [Tue, 5 Jan 2016 19:08:33 +0000 (19:08 +0000)]
Add function for testing string attributes to InvokeInst and CallSite.  NFC.

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

8 years ago[X86] Determine if we have an OpaqueSPAdjustment earlier
David Majnemer [Tue, 5 Jan 2016 17:46:36 +0000 (17:46 +0000)]
[X86] Determine if we have an OpaqueSPAdjustment earlier

We queried hasFP before we hit ExpandISelPseudos.  ExpandISelPseudos
manipulated state that hasFP relied on, potentially changing the result
after it has been queried elsewhere.

While I am not aware of any particular bug due to this state of affairs,
it seems best to avoid it entirely by changing the state during DAG
construction.

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

8 years ago[AVX512] add PSLLD and PSLLQ Intrinsic
Michael Zuckerman [Tue, 5 Jan 2016 15:17:39 +0000 (15:17 +0000)]
[AVX512] add PSLLD and PSLLQ Intrinsic

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

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

8 years ago[MISched] Explanatory error message when machine model is not complete. NFC
MinSeong Kim [Tue, 5 Jan 2016 14:50:15 +0000 (14:50 +0000)]
[MISched] Explanatory error message when machine model is not complete. NFC

When not all instructions have a scheduling class,
the error message now provides a possible solution.

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

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

8 years agoReverting r256836; it causes a build bot failure: http://lab.llvm.org:8011/builders...
Aaron Ballman [Tue, 5 Jan 2016 14:35:01 +0000 (14:35 +0000)]
Reverting r256836; it causes a build bot failure: lab.llvm.org:8011/builders/lldb-x86-win7-msvc/builds/14050/steps/build/logs/stdio

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

8 years agoEnable more strict standards conformance in MSVC for rvalue casting and string litera...
Aaron Ballman [Tue, 5 Jan 2016 14:24:01 +0000 (14:24 +0000)]
Enable more strict standards conformance in MSVC for rvalue casting and string literal type conversion to non-const types. Also enables generation of intrinsics for more functions.

Patch by Alexander Riccio

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

8 years ago[AArch64] Add support for Samsung Exynos-M1
MinSeong Kim [Tue, 5 Jan 2016 12:51:59 +0000 (12:51 +0000)]
[AArch64] Add support for Samsung Exynos-M1

Adds core tuning support for new Samsung Exynos-M1 core (ARMv8-A).

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

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

8 years ago(NFC) Change SubtargetFeatures::ToggleFeature and
Artyom Skrobov [Tue, 5 Jan 2016 10:25:56 +0000 (10:25 +0000)]
(NFC) Change SubtargetFeatures::ToggleFeature and
SubtargetFeatures::ApplyFeatureFlag to be static, so that
MCSubtargetInfo doesn't need to instantiate SubtargetFeatures
for nothing. Also change the return type to void, as it
wasn't ever used.

This is a partial commit of http://reviews.llvm.org/D15746

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

8 years agoRemove extra whitespace. NFC.
Junmo Park [Tue, 5 Jan 2016 09:40:03 +0000 (09:40 +0000)]
Remove extra whitespace. NFC.

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

8 years agoRemove extra whitespace. NFC.
Junmo Park [Tue, 5 Jan 2016 09:36:47 +0000 (09:36 +0000)]
Remove extra whitespace. NFC.

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

8 years ago[X86][SSE] Merge PerformBLENDICombine into PerformShuffleCombine
Simon Pilgrim [Tue, 5 Jan 2016 09:12:17 +0000 (09:12 +0000)]
[X86][SSE] Merge PerformBLENDICombine into PerformShuffleCombine

PBLEND/BLENDPD/BLENDPS are no different to the other target shuffles and this will make future improvements to the target shuffle combines more straightforward.

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

8 years ago[X86] Make MOV32ri64 a post-RA pseudo instead of a CodeGenOnly instruction. It was...
Craig Topper [Tue, 5 Jan 2016 07:44:14 +0000 (07:44 +0000)]
[X86] Make MOV32ri64 a post-RA pseudo instead of a CodeGenOnly instruction. It was only needed for rematerialization.

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

8 years ago[X86] Add OpSize32 to OR32mrLocked instruction to match the normal OR32mr instruction.
Craig Topper [Tue, 5 Jan 2016 07:44:11 +0000 (07:44 +0000)]
[X86] Add OpSize32 to OR32mrLocked instruction to match the normal OR32mr instruction.

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

8 years ago[AVX512] Add hasSideEffects=0 to kunpck instructions since they lack a pattern in...
Craig Topper [Tue, 5 Jan 2016 07:44:08 +0000 (07:44 +0000)]
[AVX512] Add hasSideEffects=0 to kunpck instructions since they lack a pattern in their instructions.

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

8 years ago[SimplifyCFG] Further improve our ability to remove redundant catchpads
David Majnemer [Tue, 5 Jan 2016 07:42:17 +0000 (07:42 +0000)]
[SimplifyCFG] Further improve our ability to remove redundant catchpads

In r256814, we managed to remove catchpads which were trivially redudant
because they were the same SSA value.  We can do better using the same
algorithm but with a smarter datastructure by hashing the SSA values
within the catchpad and comparing them structurally.

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

8 years ago[SimplifyCFG] Remove redundant catchpads
David Majnemer [Tue, 5 Jan 2016 06:27:50 +0000 (06:27 +0000)]
[SimplifyCFG] Remove redundant catchpads

Remove duplicate catchpad handlers from a catchswitch.

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

8 years agoAMDGPU: Remove redundant let mayLoad = 1
Matt Arsenault [Tue, 5 Jan 2016 04:50:28 +0000 (04:50 +0000)]
AMDGPU: Remove redundant let mayLoad = 1

This is already set on the SMRD format class.

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

8 years ago[RS4GC] Simplify handling of Constants in findBaseDefiningValue(). NFC.
Manuel Jacob [Tue, 5 Jan 2016 04:06:21 +0000 (04:06 +0000)]
[RS4GC] Simplify handling of Constants in findBaseDefiningValue().  NFC.

Summary:
Previously there were three conditionals, checking for global
variables, undef values and everything constant except these two, all three
returning the same value.  This commit replaces them by one conditional.

Reviewers: reames

Subscribers: llvm-commits

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

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

8 years ago[Statepoints] Refactor GCRelocateOperands into an intrinsic wrapper. NFC.
Manuel Jacob [Tue, 5 Jan 2016 04:03:00 +0000 (04:03 +0000)]
[Statepoints] Refactor GCRelocateOperands into an intrinsic wrapper.  NFC.

Summary:
This commit renames GCRelocateOperands to GCRelocateInst and makes it an
intrinsic wrapper, similar to e.g. MemCpyInst.  Also, all users of
GCRelocateOperands were changed to use the new intrinsic wrapper instead.

Reviewers: sanjoy, reames

Subscribers: reames, sanjoy, llvm-commits

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

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

8 years agoAMDGPU/SI: Select non-uniform constant addrspace loads to flat instructions for HSA
Tom Stellard [Tue, 5 Jan 2016 03:40:16 +0000 (03:40 +0000)]
AMDGPU/SI: Select non-uniform constant addrspace loads to flat instructions for HSA

Summary: This fixes a regression caused by r256282.

Reviewers: arsenm, cfang

Subscribers: arsenm, llvm-commits

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

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

8 years ago[WinEH] Simplify unreachable catchpads
Joseph Tremoulet [Tue, 5 Jan 2016 02:37:41 +0000 (02:37 +0000)]
[WinEH] Simplify unreachable catchpads

Summary:
At least for CoreCLR, a catchpad which immediately executes an
`unreachable` instruction indicates that the exception can never have a
matching type, and so such catchpads can be removed, and so can their
catchswitches if the catchswitch becomes empty.

Reviewers: rnk, andrew.w.kaylor, majnemer

Subscribers: llvm-commits

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

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

8 years agoRevert "[X86] Use push-pop for materializing small constants under 'minsize'"
David Majnemer [Tue, 5 Jan 2016 02:32:06 +0000 (02:32 +0000)]
Revert "[X86] Use push-pop for materializing small constants under 'minsize'"

The red zone consists of 128 bytes beyond the stack pointer so that the
allocation of objects in leaf functions doesn't require decrementing
rsp.  In r255656, we introduced an optimization that would cheaply
materialize certain constants via push/pop.  Push decrements the stack
pointer and stores it's result at what is now the top of the stack.
However, this means that using push/pop would encroach on the red zone.
PR26023 gives an example where this corrupts an object in the red zone.

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

8 years agoAMDGPU/SI: Consolidate FLAT patterns
Tom Stellard [Tue, 5 Jan 2016 02:26:37 +0000 (02:26 +0000)]
AMDGPU/SI: Consolidate FLAT patterns

Summary:
We had to sets of identical FLAT patterns one inside the
HasFlatAddressSpace predicate and one inside the useFlatForGloabl
predicate.  This patch merges these sets into a single pattern
under the isCIVI predicate.

The reason we can remove the predicates is that when MUBUF instructions
are legal, the instruction selector will prefer selecting those over
FLAT instructions because MUBUF patterns have a higher complexity score.
So, in this case having patterns for FLAT instructions will have no effect.

This change also simplifies the process for forcing global address space
loads to use FLAT instructions, since we no only have to disable the
MUBUF patterns instead of having to disable the MUBUF patterns and
enable the FLAT patterns.

Reviewers: arsenm, cfang

Subscribers: llvm-commits

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

8 years ago[MDA] Don't be quite as conservative for noalias functions
Philip Reames [Tue, 5 Jan 2016 00:49:14 +0000 (00:49 +0000)]
[MDA] Don't be quite as conservative for noalias functions

If we encounter a noalias call that alias analysis can't analyse, we can fall down into the generic call handling rather than giving up entirely. I noticed this while reading through the code for another purpose.

I can't seem to write a test case which changes; that sorta makes sense given any test case would have to be an inconsistency in AA. Suggestions welcome.

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

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

8 years agoX86: Add a testcase for PR25951
Matthias Braun [Tue, 5 Jan 2016 00:48:16 +0000 (00:48 +0000)]
X86: Add a testcase for PR25951

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

8 years agoMachineInstrBundle: Fix reversed isSuperRegisterEq() call
Matthias Braun [Tue, 5 Jan 2016 00:45:35 +0000 (00:45 +0000)]
MachineInstrBundle: Fix reversed isSuperRegisterEq() call

Unfortunately this fix had the effect of exposing the
-verify-machineinstrs FIXME of X86InstrInfo.cpp in two testcases for
which I disabled it for now.
Two testcases also have additional pushq/popq where the corrected code
cannot prove that %rax is dead any longer. Looking at the examples, this
could potentially be fixed by improving computeRegisterLiveness() to check
the live-in lists of the successors blocks when reaching the end of a
block.

This fixes http://llvm.org/PR25951.

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

8 years agoFix typo in comment
Matthias Braun [Tue, 5 Jan 2016 00:45:31 +0000 (00:45 +0000)]
Fix typo in comment

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

8 years agoAdd explicit string checks in test
Xinliang David Li [Mon, 4 Jan 2016 23:59:14 +0000 (23:59 +0000)]
Add explicit string checks in test

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

8 years agoAMDGPU: add +xnack feature
Nicolai Haehnle [Mon, 4 Jan 2016 23:35:53 +0000 (23:35 +0000)]
AMDGPU: add +xnack feature

Summary:
Enabling this feature will account for the two SGPRs used by the hardware
to store the XNACK_MASK physically.

The hardware only requires this reservation when the XNACK feature is
explicitly enabled. At some point, HSA will probably want to do that, but
it does increase SGPR register pressure, so leave it disabled by default
for now (but do add a small test).

Reviewers: arsenm, tstellarAMD

Subscribers: arsenm, llvm-commits

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

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

8 years ago[InstructionCombining] prepareICWorklistFromFunction halts in infinite loop with...
Chen Li [Mon, 4 Jan 2016 23:28:57 +0000 (23:28 +0000)]
[InstructionCombining] prepareICWorklistFromFunction halts in infinite loop with instructions of token type

Summary: This patch fixes a bug in prepareICWorklistFromFunction, where the loop becomes infinite with instructions of token type. The patch checks if the instruction is token type, and if so it updates EndInst with the current instruction.

Reviewers: reames, majnemer

Subscribers: llvm-commits, sanjoy

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

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

8 years agoUpdate docs to recommend CMake >= v3.2.
Eric Christopher [Mon, 4 Jan 2016 23:22:43 +0000 (23:22 +0000)]
Update docs to recommend CMake >= v3.2.

CMake v3.2 or newer is necessary to get interactive output when running
Lit via Ninja. Otherwise Ninja will buffer Lit's output, which makes
for a crummy experience -- you can't tell if your tests are hung!

Patch by Justin Lebar!

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

8 years agoClarify that the bypassSlowDivision optimization operates on a single BB [v2]
Eric Christopher [Mon, 4 Jan 2016 23:18:58 +0000 (23:18 +0000)]
Clarify that the bypassSlowDivision optimization operates on a single BB [v2]

Update some comments to be more explicit.

Change bypassSlowDivision and the functions it calls so that they take
BasicBlock*s and Instruction*s, rather than Function::iterator&s and
BasicBlock::iterator&s.

Change the APIs so that the caller is responsible for updating the
iterator, rather than the callee. This makes control flow much easier
to follow.

Patch by Justin Lebar!

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

8 years ago[LICM] Fix a small oversight introduced in r256763
David Majnemer [Mon, 4 Jan 2016 23:16:22 +0000 (23:16 +0000)]
[LICM] Fix a small oversight introduced in r256763

r256763 had promoteLoopAccessesToScalars check for the existence of a
catchswitch when the exit blocks were populated but
promoteLoopAccessesToScalars may be called with a prepopulated set of
exit blocks which would also need to be checked.

This fixes PR26019.

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

8 years ago[MemoryBuiltins] Remove isOperatorNewLike by consolidating non-null inference handling
Philip Reames [Mon, 4 Jan 2016 22:49:23 +0000 (22:49 +0000)]
[MemoryBuiltins] Remove isOperatorNewLike by consolidating non-null inference handling

This patch removes the isOperatorNewLike predicate since it was only being used to establish a non-null return value and we have attributes specifically for that purpose with generic handling. To keep approximate the same behaviour for existing frontends, I added the various operator new like (i.e. instances of operator new) to InferFunctionAttrs. It's not really clear to me why this isn't handled in Clang, but I didn't want to break existing code and any subtle assumptions it might have.

Once this patch is in, I'm going to start separating the isAllocLike family of predicates. These appear to be being used for a mixture of things which should be more clearly separated and documented. Today, they're being used to indicate (at least) aliasing facts, CSE-ability, and default values from an allocation site.

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

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

8 years ago[PGO] Simplify string parsing
Xinliang David Li [Mon, 4 Jan 2016 22:09:26 +0000 (22:09 +0000)]
[PGO] Simplify string parsing

Patch Suggested by Vedant.

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

8 years ago[PGO] Refactor string writer code
Xinliang David Li [Mon, 4 Jan 2016 22:01:02 +0000 (22:01 +0000)]
[PGO] Refactor string writer code

For readability and code sharing.
(Adapted from Suggestions by Vedant).

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

8 years ago[LIR] General refactoring to simplify code and the ease future code review
Haicheng Wu [Mon, 4 Jan 2016 21:43:14 +0000 (21:43 +0000)]
[LIR] General refactoring to simplify code and the ease future code review

This is a resubmission of r256336 which was reverted in r256361. The issue was the lack of the invariant check of the memset value in processLooMemSet().

The original message:

Move several checks into isLegalStores. Also, delineate between those stores that are memset-able and those that are memcpy-able.

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

8 years ago[X86][SSE] Ensure BLENDPD/BLENDPS/PBLEND inputs are both of the correct input type
Simon Pilgrim [Mon, 4 Jan 2016 21:41:11 +0000 (21:41 +0000)]
[X86][SSE] Ensure BLENDPD/BLENDPS/PBLEND inputs are both of the correct input type

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

8 years ago[PGO]: Use efficient 'join' API for uncompressed string
Xinliang David Li [Mon, 4 Jan 2016 21:31:09 +0000 (21:31 +0000)]
[PGO]: Use efficient 'join' API for uncompressed string

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