OSDN Git Service

android-x86/external-llvm.git
8 years agoStyle fix in Core.h / Core.cpp. NFC
Amaury Sechet [Sat, 23 Apr 2016 00:12:45 +0000 (00:12 +0000)]
Style fix in Core.h / Core.cpp. NFC

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

8 years agollvm-objdump: deal with invalid ARM encodings slightly better.
Tim Northover [Fri, 22 Apr 2016 23:23:31 +0000 (23:23 +0000)]
llvm-objdump: deal with invalid ARM encodings slightly better.

Before we printed a warning to stderr and left the actual output stream in a
mess. This tries to print a .long or .short representation of what we saw (as
if there was a data-in-code directive).

This isn't guaranteed to restore synchronization in Thumb-mode (if the invalid
instruction was supposed to be 32-bits, we may be off-by-16 for the rest of the
function). But there's no certain way to deal with that, and it's invalid code
anyway (if the data really wasn't an instruction, the user can add proper
.data_in_code directives if they care)

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

8 years agoMachO: remove weird ARM/Thumb interface from MachOObjectFile
Tim Northover [Fri, 22 Apr 2016 23:21:13 +0000 (23:21 +0000)]
MachO: remove weird ARM/Thumb interface from MachOObjectFile

Only one consumer (llvm-objdump) actually cared about the fact that there were
two triples. Others were actively working around the fact that the Triple
returned by getArch might have been invalid. As for llvm-objdump, it needs to
be acutely aware of both Triples anyway, so being generic in the exposed API is
no benefit.

Also rename the version of getArch returning a Triple. Users were having to
pass an unwanted nullptr to disambiguate the two, which was nasty.

The only functional change here is that armv7m and armv7em object files no
longer crash llvm-objdump.

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

8 years agoAMDGPU: sext_inreg (srl x, K), vt -> bfe x, K, vt.Size
Matt Arsenault [Fri, 22 Apr 2016 22:59:16 +0000 (22:59 +0000)]
AMDGPU: sext_inreg (srl x, K), vt -> bfe x, K, vt.Size

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

8 years agoFix llvm/test/CodeGen/ARM/Windows/dbzchk.ll not to check mixed output, take #2.
NAKAMURA Takumi [Fri, 22 Apr 2016 22:51:48 +0000 (22:51 +0000)]
Fix llvm/test/CodeGen/ARM/Windows/dbzchk.ll not to check mixed output, take #2.

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

8 years agollvm-symbolizer: Avoid infinite recursion walking dwos where the dwo contains a dwo_n...
David Blaikie [Fri, 22 Apr 2016 22:50:56 +0000 (22:50 +0000)]
llvm-symbolizer: Avoid infinite recursion walking dwos where the dwo contains a dwo_name attribute

The dwo_name was added to dwo files to improve diagnostics in dwp, but
it confuses tools that attempt to load any dwo named by a dwo_name, even
ones inside dwos. Avoid this by keeping track of whether a unit is
already a dwo unit, and if so, not loading further dwos.

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

8 years agoAMDGPU: Re-visit nodes in performAndCombine
Matt Arsenault [Fri, 22 Apr 2016 22:48:38 +0000 (22:48 +0000)]
AMDGPU: Re-visit nodes in performAndCombine

This fixes test regressions when i64 loads/stores are made promote.

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

8 years agoAdd some release notes about the fix for PR26774
Sanjoy Das [Fri, 22 Apr 2016 22:45:23 +0000 (22:45 +0000)]
Add some release notes about the fix for PR26774

As suggested by Chandler on the review thread for D18634.

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

8 years agoFix comment about Intr*Mem properties
Nicolai Haehnle [Fri, 22 Apr 2016 22:37:58 +0000 (22:37 +0000)]
Fix comment about Intr*Mem properties

Summary:
Follow up to D19291: it now makes sense to use two Intr*Mem properties,
in particular IntrReadMem + IntrArgMemOnly is common.

Pointed out by Mikael Holmén.

Reviewers: uabelho, joker.eph, reames

Subscribers: llvm-commits

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

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

8 years agoRemoving unused function.
Andrew Kaylor [Fri, 22 Apr 2016 22:24:20 +0000 (22:24 +0000)]
Removing unused function.

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

8 years agoRevert r267210, it makes clang assert (PR27490).
Nico Weber [Fri, 22 Apr 2016 22:08:42 +0000 (22:08 +0000)]
Revert r267210, it makes clang assert (PR27490).

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

8 years agoRe-commit optimization bisect support (r267022) without new pass manager support.
Andrew Kaylor [Fri, 22 Apr 2016 22:06:11 +0000 (22:06 +0000)]
Re-commit optimization bisect support (r267022) without new pass manager support.

The original commit was reverted because of a buildbot problem with LazyCallGraph::SCC handling (not related to the OptBisect handling).

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

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

8 years agoDifferential Revision: http://reviews.llvm.org/D19040
Sriraman Tallam [Fri, 22 Apr 2016 21:41:58 +0000 (21:41 +0000)]
Differential Revision: reviews.llvm.org/D19040

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

8 years agollvm-symbolizer: prefer .dwo contents over fission-gmlt-like-data when .dwo file...
David Blaikie [Fri, 22 Apr 2016 21:32:59 +0000 (21:32 +0000)]
llvm-symbolizer: prefer .dwo contents over fission-gmlt-like-data when .dwo file is present

Rather than relying on the gmlt-like data emitted into the .o/executable
which only contains the simple name of any inlined functions, use the
.dwo file if present.

Test symbolication with/without a .dwo, and the old test that was
testing behavior when no gmlt-like data was present. (I haven't included
a test of non-gmlt-like data + no .dwo (that would be akin to
symbolication with no debug info) but we could add one for completeness)

The test was simplified a bit to be a little clearer (unoptimized, force
inline, using a function call as the inlined entity) and regenerated
with ToT clang. For the no-gmlt-like-data case, I modified Clang back to
its old behavior temporarily & the .dwo file is identical so it is
shared between the two executables.

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

8 years agoUpdate discriminator assignment algorithm in clang assembler.
Dehao Chen [Fri, 22 Apr 2016 21:31:18 +0000 (21:31 +0000)]
Update discriminator assignment algorithm in clang assembler.

Summary: The clang assembler assumes that the discriminator remains the same when there is source line change. The correct behavior is that when there is line change, discriminator will automatically reset to 0.

Reviewers: dnovillo, davidxl, echristo

Subscribers: echristo, llvm-commits

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

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

8 years agoAMDGPU: Fix crash when dumping unknown opcode
Matt Arsenault [Fri, 22 Apr 2016 21:23:41 +0000 (21:23 +0000)]
AMDGPU: Fix crash when dumping unknown opcode

I'm for some reason having a problem producing a test.
It should be the same as test/MC/X86/invalid_opcode.s,
but llvm-mc seems to ignore random bytes.

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

8 years agoIntroduce llvm.load.relative intrinsic.
Peter Collingbourne [Fri, 22 Apr 2016 21:18:02 +0000 (21:18 +0000)]
Introduce llvm.load.relative intrinsic.

This intrinsic takes two arguments, ``%ptr`` and ``%offset``. It loads
a 32-bit value from the address ``%ptr + %offset``, adds ``%ptr`` to that
value and returns it. The constant folder specifically recognizes the form of
this intrinsic and the constant initializers it may load from; if a loaded
constant initializer is known to have the form ``i32 trunc(x - %ptr)``,
the intrinsic call is folded to ``x``.

LLVM provides that the calculation of such a constant initializer will
not overflow at link time under the medium code model if ``x`` is an
``unnamed_addr`` function. However, it does not provide this guarantee for
a constant initializer folded into a function body. This intrinsic can be
used to avoid the possibility of overflows when loading from such a constant.

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

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

8 years agoTLI: Only iterate over integer vector types
Matt Arsenault [Fri, 22 Apr 2016 21:16:17 +0000 (21:16 +0000)]
TLI: Only iterate over integer vector types

Instead of iterating over all vectors and skipping integers.

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

8 years agoDAGCombiner: Relax alignment restriction when changing store type
Matt Arsenault [Fri, 22 Apr 2016 21:01:41 +0000 (21:01 +0000)]
DAGCombiner: Relax alignment restriction when changing store type

If the target allows the alignment, this should be OK.

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

8 years ago[PGO] change the interface for createPGOFuncNameMetadata()
Rong Xu [Fri, 22 Apr 2016 21:00:17 +0000 (21:00 +0000)]
[PGO] change the interface for createPGOFuncNameMetadata()

This patch changes the interface for createPGOFuncNameMetadata() where we add
another PGOFuncName argument.

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

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

8 years ago[unordered] sink unordered stores at end of blocks
Philip Reames [Fri, 22 Apr 2016 20:53:32 +0000 (20:53 +0000)]
[unordered] sink unordered stores at end of blocks

The existing code turned out to be completely correct when auditted.  Thus, only minor code changes and adding a couple of tests.

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

8 years agoFold compares for distinct allocations
Sanjoy Das [Fri, 22 Apr 2016 20:52:25 +0000 (20:52 +0000)]
Fold compares for distinct allocations

Summary:
We can fold compares to false when two distinct allocations within a
function are compared for equality.

Patch by Anna Thomas!

Reviewers: majnemer, reames, sanjoy

Subscribers: llvm-commits

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

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

8 years agoCodeGen: Use PLT relocations for relative references to unnamed_addr functions.
Peter Collingbourne [Fri, 22 Apr 2016 20:40:10 +0000 (20:40 +0000)]
CodeGen: Use PLT relocations for relative references to unnamed_addr functions.

The relative vtable ABI (PR26723) needs PLT relocations to refer to virtual
functions defined in other DSOs. The unnamed_addr attribute means that the
function's address is not significant, so we're allowed to substitute it
with the address of a PLT entry.

Also includes a bonus feature: addends for COFF image-relative references.

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

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

8 years ago[unordered] Extend load/store type canonicalization to handle unordered operations
Philip Reames [Fri, 22 Apr 2016 20:33:48 +0000 (20:33 +0000)]
[unordered] Extend load/store type canonicalization to handle unordered operations

Extend the type canonicalization logic to work for unordered atomic loads and stores.  Note that while this change itself is fairly simple and low risk, there's a reasonable chance this will expose problems in the backends by suddenly generating IR they wouldn't have seen before.  Anything of this nature will be an existing bug in the backend (you could write an atomic float load), but this will definitely change the frequency with which such cases are encountered.  If you see problems, feel free to revert this change, but please make sure you collect a test case.

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

8 years agoDAGCombiner: Relax alignment restriction when changing load type
Matt Arsenault [Fri, 22 Apr 2016 20:21:36 +0000 (20:21 +0000)]
DAGCombiner: Relax alignment restriction when changing load type

If the target allows the alignment, this should still be OK.

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

8 years ago[AArch64] Fix optimizeCondBranch logic.
Quentin Colombet [Fri, 22 Apr 2016 20:09:58 +0000 (20:09 +0000)]
[AArch64] Fix optimizeCondBranch logic.

The opcode for the optimized branch does not depend on the size
of the activate bits in the AND masks, but the AND opcode itself.
Indeed, we need to use a X or W variant based on the AND variant
not based on whether the mask fits into the related variant.
Otherwise, we may end up using the W variant of the optimized branch
for 64-bit register inputs!

This fixes the last make check verifier issues for AArch64: PR27479.

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

8 years agoPM: Port SinkingPass to the new pass manager
Justin Bogner [Fri, 22 Apr 2016 19:54:10 +0000 (19:54 +0000)]
PM: Port SinkingPass to the new pass manager

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

8 years agoPM: Reorder the functions used for SinkingPass. NFC
Justin Bogner [Fri, 22 Apr 2016 19:54:04 +0000 (19:54 +0000)]
PM: Reorder the functions used for SinkingPass. NFC

This will make the port to the new PM easier to follow.

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

8 years ago[DeadStoreElimination] Shorten beginning of memset overwritten by later stores
Jun Bum Lim [Fri, 22 Apr 2016 19:51:29 +0000 (19:51 +0000)]
[DeadStoreElimination] Shorten beginning of memset overwritten by later stores

Summary: This change will shorten memset if the beginning of memset is overwritten by later stores.

Reviewers: hfinkel, eeckstein, dberlin, mcrosier

Subscribers: mgrang, mcrosier, llvm-commits

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

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

8 years agoPM: Port DCE to the new pass manager
Justin Bogner [Fri, 22 Apr 2016 19:40:41 +0000 (19:40 +0000)]
PM: Port DCE to the new pass manager

Also add a very basic test, since apparently there aren't any tests
for DCE whatsoever to add the new pass version to.

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

8 years agoMachineScheduler: Move code to initialize a Candidate out of tryCandidate(); NFC
Matthias Braun [Fri, 22 Apr 2016 19:10:15 +0000 (19:10 +0000)]
MachineScheduler: Move code to initialize a Candidate out of tryCandidate(); NFC

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

8 years ago[LoopUtils] Extend findStringMetadataForLoop to return the value for metadata
Adam Nemet [Fri, 22 Apr 2016 19:10:05 +0000 (19:10 +0000)]
[LoopUtils] Extend findStringMetadataForLoop to return the value for metadata

E.g. for:

  !1 = {"llvm.distribute", i32 1}

it now returns the MDOperand for 1.

I will use this in LoopDistribution to check the value of the metadata.

Note that the change is backward-compatible with its current use in
LoopVersioningLICM.  An Optional implicitly converts to a bool depending
whether it contains a value or not.

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

8 years agoMachineScheduler: Limit the size of the ready list.
Matthias Braun [Fri, 22 Apr 2016 19:09:17 +0000 (19:09 +0000)]
MachineScheduler: Limit the size of the ready list.

Avoid quadratic complexity in unusually large basic blocks by limiting
the size of the ready lists.

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

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

8 years ago[EarlyCSE/CVP] Add stats for CVPs and make sure to account for any Changes.
Chad Rosier [Fri, 22 Apr 2016 18:47:21 +0000 (18:47 +0000)]
[EarlyCSE/CVP] Add stats for CVPs and make sure to account for any Changes.

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

8 years ago[AArch64] When creating MRS instruction, make sure the destination register is
Quentin Colombet [Fri, 22 Apr 2016 18:46:17 +0000 (18:46 +0000)]
[AArch64] When creating MRS instruction, make sure the destination register is
declared as a definition.

This fixes the machine verifier error for CodeGen/AArch64/nzcv-save.ll.

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

8 years ago[LoopVersioningLICM] Add test coverage for llvm.loop.licm_versioning.disable
Adam Nemet [Fri, 22 Apr 2016 18:34:50 +0000 (18:34 +0000)]
[LoopVersioningLICM] Add test coverage for llvm.loop.licm_versioning.disable

In the next change, I am generalizing the function
findStringMetadataForLoop and I want to make sure I don't break this.
Looks like there was no coverage for this so far.

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

8 years ago[AArch64][AdvSIMDScalar] Update the kill flags correctly.
Quentin Colombet [Fri, 22 Apr 2016 18:09:14 +0000 (18:09 +0000)]
[AArch64][AdvSIMDScalar] Update the kill flags correctly.

We used to simply set the kill flags to true when transforming a scalar
instruction to a vector one.
SrcScalar1 = copy SrcVector1
... = opScalar SrcScalar1
=>
SrcScalar1 = copy SrcVector1
... = opVector SrcVector1<kill>

This is obviously wrong. The proper update consists in:
1. Propagate the kill status from the copy to the new opVector
2. Reset the kill status on the copy, since the live-range of
   SrcVector1 got extended.

This fixes some of the machine verifier errors for AArch64 with make check.

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

8 years agotest: split test into two runs
Saleem Abdulrasool [Fri, 22 Apr 2016 18:06:51 +0000 (18:06 +0000)]
test: split test into two runs

Rather than checking both stdout and stderr simultaneously, split it into two
tests.  This apparently breaks on Windows where MSVCRT does not buffer output
correctly.  NFC.

Thanks to chapuni for bringing the issue to my attention!

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

8 years ago[Hexagon] Use common Pat classes for selecting code for intrinsics
Krzysztof Parzyszek [Fri, 22 Apr 2016 18:05:55 +0000 (18:05 +0000)]
[Hexagon] Use common Pat classes for selecting code for intrinsics

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

8 years ago[SimplifyCFG] Add final missing implications to isImpliedTrueByMatchingCmp.
Chad Rosier [Fri, 22 Apr 2016 17:57:34 +0000 (17:57 +0000)]
[SimplifyCFG] Add final missing implications to isImpliedTrueByMatchingCmp.

Summary: eq imply [u|s]ge and [u|s]le are true.

Remove redundant logic by implementing isImpliedFalseByMatchingCmp(Pred1, Pred2)
as isImpliedTrueByMatchingCmp(Pred1, getInversePredicate(Pred2)).

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

8 years agoPoint link to CODE_OWNERS.txt to klaus instead of viewvc.
Michael Kuperstein [Fri, 22 Apr 2016 17:41:12 +0000 (17:41 +0000)]
Point link to CODE_OWNERS.txt to klaus instead of viewvc.

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

8 years agoHave isKnownNotFullPoison be smarter around control flow
Sanjoy Das [Fri, 22 Apr 2016 17:41:06 +0000 (17:41 +0000)]
Have isKnownNotFullPoison be smarter around control flow

Summary:
(... while still not using a PostDomTree)

The way we use isKnownNotFullPoison from SCEV today, the new CFG walking
logic will not trigger for any realistic cases -- it will kick in only
for situations where we could have merged the contiguous basic blocks
anyway[0], since the poison generating instruction dominates all of its
non-PHI uses (which are the only uses we consider right now).

However, having this change in place will allow a later bugfix to break
fewer llvm-lit tests.

[0]: i.e. cases where block A branches to block B and B is A's only
successor and A is B's only predecessor.

Reviewers: broune, bjarke.roune

Subscribers: mcrosier, llvm-commits

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

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

8 years ago[Hexagon] Properly close live range in HexagonBlockRanges ---add testcase
Krzysztof Parzyszek [Fri, 22 Apr 2016 17:30:13 +0000 (17:30 +0000)]
[Hexagon] Properly close live range in HexagonBlockRanges ---add testcase

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

8 years ago[Hexagon] Properly close live range in HexagonBlockRanges
Krzysztof Parzyszek [Fri, 22 Apr 2016 17:27:22 +0000 (17:27 +0000)]
[Hexagon] Properly close live range in HexagonBlockRanges

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

8 years agoPM: Remove some redundant name() methods
Justin Bogner [Fri, 22 Apr 2016 17:25:43 +0000 (17:25 +0000)]
PM: Remove some redundant name() methods

These passes all get names from PassInfoMixin already, we don't need
to override them.

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

8 years ago[SimplifyCFG] Add missing implications to isImpliedTrueByMatchingCmp.
Chad Rosier [Fri, 22 Apr 2016 17:14:12 +0000 (17:14 +0000)]
[SimplifyCFG] Add missing implications to isImpliedTrueByMatchingCmp.

Summary: [u|s]gt and [u|s]lt imply [u|s]ge and [u|s]le are true, respectively.
I've simplified the existing tests and added additional tests to cover the new
cases mentioned above.  I've also added tests for all the cases where the
first compare doesn't imply anything about the second compare.

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

8 years ago[SimplifyCFG] Simplify code review by temporarily removing this test file.
Chad Rosier [Fri, 22 Apr 2016 17:14:08 +0000 (17:14 +0000)]
[SimplifyCFG] Simplify code review by temporarily removing this test file.

A followup commit will replace these tests with simplified and more inclusive
tests.  The diff is unreadable if this were to be done in a single commit.

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

8 years ago[AMDGPU] Insert nop pass: take care of outstanding feedback
Konstantin Zhuravlyov [Fri, 22 Apr 2016 17:04:51 +0000 (17:04 +0000)]
[AMDGPU] Insert nop pass: take care of outstanding feedback

- Switch few loops to range-based for loops
- Fix nop insertion at the end of BB
- Fix formatting
- Check for endpgm

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

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

8 years ago[mips][microMIPS] Revert commit r266861.
Zoran Jovanovic [Fri, 22 Apr 2016 16:53:15 +0000 (16:53 +0000)]
[mips][microMIPS] Revert commit r266861.
Commit r266861 was the reason for failing tests in LLVM test suite.

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

8 years ago[Hexagon] Teach mux expansion how to deal with undef predicates
Krzysztof Parzyszek [Fri, 22 Apr 2016 16:47:01 +0000 (16:47 +0000)]
[Hexagon] Teach mux expansion how to deal with undef predicates

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

8 years ago[Hexagon] Add definitions for trap/pause instructions
Krzysztof Parzyszek [Fri, 22 Apr 2016 16:25:00 +0000 (16:25 +0000)]
[Hexagon] Add definitions for trap/pause instructions

Also add tests for other instructions from HexagonSystemInst.td.

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

8 years agoPostRAHazardRecocgnizer: Fix unused-private-field warning
Tom Stellard [Fri, 22 Apr 2016 15:11:08 +0000 (15:11 +0000)]
PostRAHazardRecocgnizer: Fix unused-private-field warning

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

8 years ago[MemorySSA] Fix bug in CachingMemorySSAWalker::invalidateInfo
Geoff Berry [Fri, 22 Apr 2016 14:44:10 +0000 (14:44 +0000)]
[MemorySSA] Fix bug in CachingMemorySSAWalker::invalidateInfo

Summary:
CachingMemorySSAWalker::invalidateInfo was using IsCall to determine
which cache map needed to be cleared of entries referring to the invalidated
MemoryAccess, but there could also be entries referring to it in the
other cache map (value entries, not key entries).  This change just
clears both tables to be conservatively correct.

Also add a verifyRemoved() function, called when expensive
checks (i.e. XDEBUG) are enabled to verify that the invalidated
MemoryAccess object is not referenced in any of the caches.

Reviewers: dberlin, george.burgess.iv

Subscribers: mcrosier, llvm-commits

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

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

8 years agoCodeGen: Add a stand-alone hazard recognizer pass
Tom Stellard [Fri, 22 Apr 2016 14:43:50 +0000 (14:43 +0000)]
CodeGen: Add a stand-alone hazard recognizer pass

Summary:
This new pass allows targets to use the hazard recognizer without having
to also run one of the schedulers.  This is useful when compiling with
optimizations disabled for targets that still need noop hazards
to be handled correctly.

Reviewers: hfinkel, atrick

Subscribers: arsenm, llvm-commits

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

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

8 years ago[EarlyCSE] Don't add the overflow flags to the hash
David Majnemer [Fri, 22 Apr 2016 14:12:50 +0000 (14:12 +0000)]
[EarlyCSE] Don't add the overflow flags to the hash

We take the intersection of overflow flags while CSE'ing.
This permits us to consider two instructions with different overflow
behavior to be replaceable.

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

8 years agoEmit code16 in assembly in 16-bit mode
Nirav Dave [Fri, 22 Apr 2016 13:36:11 +0000 (13:36 +0000)]
Emit code16 in assembly in 16-bit mode

Summary:
When generating assembly using -m16 we must explicitly mark it as
16-bit. Emit .code16 at beginning of file. Fixes wrong results when
using -fno-integrated-as.

Reviewers: dwmw2

Subscribers: llvm-commits

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

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

8 years ago[mips] Fix select patterns for MIPS64
Simon Dardis [Fri, 22 Apr 2016 13:19:22 +0000 (13:19 +0000)]
[mips] Fix select patterns for MIPS64

When targetting MIPS64R6 some of the patterns for select were guarded by a
broken predicate. The predicate was supposed to test if a constant value
could fit in a 16 bit zero-extended field. Instead the value was tested to
fit in a 16 bit sign-extended field. For negative constants of native word
width this resulted in wrong code generation.

Reviewers: vkalintiris, dsanders

Differential Review: http://reviews.llvm.org/D19378

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

8 years agoDocument source_filename in LangRef.
Teresa Johnson [Fri, 22 Apr 2016 13:09:17 +0000 (13:09 +0000)]
Document source_filename in LangRef.

Summary: Add documentation for new LLVM IR source_filename identifier.

Reviewers: joker.eph, majnemer

Subscribers: llvm-commits

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

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

8 years ago[mips] Fix a small typo that would leave BLTZC out of getAnalyzableBrOpc().'
Vasileios Kalintiris [Fri, 22 Apr 2016 13:05:51 +0000 (13:05 +0000)]
[mips] Fix a small typo that would leave BLTZC out of getAnalyzableBrOpc().'

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

8 years agoRevert r267049, r26706[16789], r267071 - Refactor raw pdb dumper into library
Daniel Sanders [Fri, 22 Apr 2016 12:04:42 +0000 (12:04 +0000)]
Revert r267049, r26706[16789], r267071 - Refactor raw pdb dumper into library

r267049 broke multiple buildbots (e.g. clang-cmake-mips, and clang-x86_64-linux-selfhost-modules) which the follow-ups have not yet resolved and this is preventing subsequent committers from being notified about additional failures on the affected buildbots.

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

8 years agoAMDGPU/SI: Add test missed in rL266865
Nikolay Haustov [Fri, 22 Apr 2016 11:39:43 +0000 (11:39 +0000)]
AMDGPU/SI: Add test missed in rL266865

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

8 years ago[InstCombine] Preserve fast math flags when combining PHIs
Silviu Baranga [Fri, 22 Apr 2016 11:21:36 +0000 (11:21 +0000)]
[InstCombine] Preserve fast math flags when combining PHIs

Summary:
When optimizing PHIs which have inputs floating point binary
operators, we preserve all IR flags except the fast math
flags.

This change removes the logic which tracked some of the IR flags
(no wrap, exact) and replaces it by doing an and on the IR flags of
all inputs to the PHI - which will also handle the fast math
flags.

Reviewers: majnemer

Subscribers: llvm-commits

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

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

8 years ago[mips][microMIPS] Implement SLT, SLTI, SLTIU, SLTU microMIPS32r6 instructions
Hrvoje Varga [Fri, 22 Apr 2016 11:18:40 +0000 (11:18 +0000)]
[mips][microMIPS] Implement SLT, SLTI, SLTIU, SLTU microMIPS32r6 instructions
Differential Revision: http://reviews.llvm.org/D19354

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

8 years ago[mips][microMIPS] Add R_MICROMIPS_PC18_S3 relocation
Zoran Jovanovic [Fri, 22 Apr 2016 10:15:12 +0000 (10:15 +0000)]
[mips][microMIPS] Add R_MICROMIPS_PC18_S3 relocation

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

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

8 years agoFix -Wunused-variable in non-asserts build.
Eric Liu [Fri, 22 Apr 2016 09:50:31 +0000 (09:50 +0000)]
Fix -Wunused-variable in non-asserts build.

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

8 years agoRevert r267098 - [MachineCombiner] Support for floating-point FMA on ARM64
Daniel Sanders [Fri, 22 Apr 2016 09:37:26 +0000 (09:37 +0000)]
Revert r267098 - [MachineCombiner] Support for floating-point FMA on ARM64

It introduced buildbot failures on clang-cmake-mips, clang-ppc64le-linux, among others.

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

8 years ago[X86]: Changing cost for “TRUNCATE v16i32 to v16i8” in SSE4.1 mode.
Ashutosh Nema [Fri, 22 Apr 2016 08:34:05 +0000 (08:34 +0000)]
[X86]: Changing cost for “TRUNCATE v16i32 to v16i8” in SSE4.1 mode.

Summary:
rL256194 transforms truncations between vectors of integers into PACKUS/PACKSS
operations during DAG combine. This generates better code for truncate, so cost
of truncate needs to be changed but looks like it got changed only in SSE2 table
Whereas this change is also applicable for SSE4.1, so the cost of truncate needs
to be changed for that as well. Cost of “TRUNCATE v16i32 to v16i8” & “TRUNCATE
v16i16 to v16i8” should be same in SSE4.1 & SSE2 table. Removing their cost from
SSE4.1, so it will fall back to SSE2.

Reviewers: Simon Pilgrim

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

8 years ago[Sparc] This provides support for itineraries on Sparc.
Chris Dewhurst [Fri, 22 Apr 2016 08:17:17 +0000 (08:17 +0000)]
[Sparc] This provides support for itineraries on Sparc.

Specifically, itineraries for LEON processors has been added, along with several LEON processor Subtargets. Although currently all these targets are pretty much identical, support for features that will differ among these processors will be added in the very near future.

The different Instruction Itinerary Classes (IICs) added are sufficient to differentiate between the instruction timings used by LEON and, quite probably, by generic Sparc processors too, but the focus of the exercise has been for LEON processors, as the requirement of my project. If the IICs are not sufficient for other Sparc processor types and you want to add a new itinerary for one of those, it should be relatively trivial to adapt this.

As none of the LEON processors has Quad Floats, or is a Version 9 processor, none of those instructions have itinerary classes defined and revert to the default "NoItinerary" instruction itinerary.

Phabricator Review: http://reviews.llvm.org/D19359

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

8 years agoThe following code would not work before this patch, due to the inability to take...
Chris Dewhurst [Fri, 22 Apr 2016 08:13:47 +0000 (08:13 +0000)]
The following code would not work before this patch, due to the inability to take the address of a global object:

void func1() {

...
}

int main(int argc, char** argv) {

void (*pFunc)();
pFunc = &func1
pFunc();
...
}

Phabricator review: http://reviews.llvm.org/D19368

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

8 years agoRevert "Initial implementation of optimization bisect support."
Vedant Kumar [Fri, 22 Apr 2016 06:51:37 +0000 (06:51 +0000)]
Revert "Initial implementation of optimization bisect support."

This reverts commit r267022, due to an ASan failure:

  http://lab.llvm.org:8080/green/job/clang-stage2-cmake-RgSan_check/1549

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

8 years ago[mips][microMIPS] Implement DVP, EVP and JALRC.HB instructions
Zlatko Buljan [Fri, 22 Apr 2016 06:44:34 +0000 (06:44 +0000)]
[mips][microMIPS] Implement DVP, EVP and JALRC.HB instructions
Differential Revision: http://reviews.llvm.org/D18687

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

8 years ago[GVN] Respect fast-math-flags on fcmps
David Majnemer [Fri, 22 Apr 2016 06:37:51 +0000 (06:37 +0000)]
[GVN] Respect fast-math-flags on fcmps

We assumed that flags were only present on binary operators.  This is
not true, they may also be present on calls and fcmps.

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

8 years agoFix some spelling mistakes
David Majnemer [Fri, 22 Apr 2016 06:37:48 +0000 (06:37 +0000)]
Fix some spelling mistakes

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

8 years ago[EarlyCSE] Take the intersection of flags on instructions
David Majnemer [Fri, 22 Apr 2016 06:37:45 +0000 (06:37 +0000)]
[EarlyCSE] Take the intersection of flags on instructions

EarlyCSE had inconsistent behavior with regards to flag'd instructions:
- In some cases, it would pessimize if the available instruction had
  different flags by not performing CSE.
- In other cases, it would miscompile if it replaced an instruction
  which had no flags with an instruction which has flags.

Fix this by being more consistent with our flag handling by utilizing
andIRFlags.

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

8 years ago[SCEV] Extract out a `isSCEVExprNeverPoison` helper; NFCI
Sanjoy Das [Fri, 22 Apr 2016 05:38:54 +0000 (05:38 +0000)]
[SCEV] Extract out a `isSCEVExprNeverPoison` helper; NFCI

Summary:
Also adds a small comment blurb on control flow + no-wrap flags, since
that question came up a few days back on llvm-dev.

Reviewers: bjarke.roune, broune

Subscribers: sanjoy, mcrosier, llvm-commits, mzolotukhin

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

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

8 years ago[SystemZ] Mark CTTZ_ZERO_UNDEF/CTLZ_ZERO_UNDEF as Expand instead of Custom since...
Craig Topper [Fri, 22 Apr 2016 05:29:58 +0000 (05:29 +0000)]
[SystemZ] Mark CTTZ_ZERO_UNDEF/CTLZ_ZERO_UNDEF as Expand instead of Custom since the custom logic just did what Expand does when CTTZ/CTLZ are Legal. NFC

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

8 years ago[Lanai] Set CTLZ_ZERO_UNDEF/CTTZ_ZERO_UNDEF to Expand instead of Legal so they will...
Craig Topper [Fri, 22 Apr 2016 05:13:01 +0000 (05:13 +0000)]
[Lanai] Set CTLZ_ZERO_UNDEF/CTTZ_ZERO_UNDEF to Expand instead of Legal so they will be converted to CTLZ/CTTZ by LegalizeDAG. Remove extra instructions that only existed to to contain patterns that match the zero_undef operations. NFC

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

8 years ago[Lanai] Remove unused methods declarations. NFC
Craig Topper [Fri, 22 Apr 2016 05:12:57 +0000 (05:12 +0000)]
[Lanai] Remove unused methods declarations. NFC

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

8 years agoClean the API for CollectAsmUndefinedRefs, taking a Triple and a String InlineAsm...
Mehdi Amini [Fri, 22 Apr 2016 04:58:12 +0000 (04:58 +0000)]
Clean the API for CollectAsmUndefinedRefs, taking a Triple and a String InlineAsm instead of a Module (NFC)

From: Mehdi Amini <mehdi.amini@apple.com>

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

8 years agoIRObjectFile, clang-format fixup for r267104
Mehdi Amini [Fri, 22 Apr 2016 04:49:46 +0000 (04:49 +0000)]
IRObjectFile, clang-format fixup for r267104

From: Mehdi Amini <mehdi.amini@apple.com>

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

8 years agoUse std::move on the enum to insert it into the pair to please MSVC
Mehdi Amini [Fri, 22 Apr 2016 04:45:57 +0000 (04:45 +0000)]
Use std::move on the enum to insert it into the pair to please MSVC

(I have no idea why is it needed)
Fixup for r267103

From: Mehdi Amini <mehdi.amini@apple.com>

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

8 years agoRefactor IRObjectFile, extract a static CollectAsmUndefinedRefs() method to parse...
Mehdi Amini [Fri, 22 Apr 2016 04:28:05 +0000 (04:28 +0000)]
Refactor IRObjectFile, extract a static CollectAsmUndefinedRefs() method to parse inline assembly (NFC)

I plan to call this from ThinLTOCodeGenerator.

From: Mehdi Amini <mehdi.amini@apple.com>

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

8 years agoAMDGPU/SI: add llvm.amdgcn.ps.live intrinsic
Nicolai Haehnle [Fri, 22 Apr 2016 04:04:08 +0000 (04:04 +0000)]
AMDGPU/SI: add llvm.amdgcn.ps.live intrinsic

Summary:
This intrinsic returns true if the current thread belongs to a live pixel
and false if it belongs to a pixel that we are executing only for derivative
computation. It will be used by Mesa to implement gl_HelperInvocation.

Note that for pixels that are killed during the shader, this implementation
also returns true, but it doesn't matter because those pixels are always
disabled in the EXEC mask.

This unearthed a corner case in the instruction verifier, which complained
about a v_cndmask 0, 1, exec, exec<imp-use> instruction. That's stupid but
correct code, so make the verifier accept it as such.

Reviewers: arsenm, tstellarAMD

Subscribers: arsenm, llvm-commits

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

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

8 years ago[AVX512] Teach lowering to use vplzcntd/q to implement 128/256-bit CTTZ_ZERO_UNDEF...
Craig Topper [Fri, 22 Apr 2016 03:22:38 +0000 (03:22 +0000)]
[AVX512] Teach lowering to use vplzcntd/q to implement 128/256-bit CTTZ_ZERO_UNDEF even without VLX support. We can just extend to 512-bits and extract like we do for CTLZ.

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

8 years agoValueMapper/Enumerator: Clean up code in post-order traversals, NFC
Duncan P. N. Exon Smith [Fri, 22 Apr 2016 02:33:06 +0000 (02:33 +0000)]
ValueMapper/Enumerator: Clean up code in post-order traversals, NFC

Re-layer the functions in the new (i.e., newly correct) post-order
traversals in ValueEnumerator (r266947) and ValueMapper (r266949).
Instead of adding a node to the worklist in a helper function and
returning a flag to say what happened, return the node itself.  This
makes the code way cleaner: the worklist is local to the main function,
there is no flag for an early loop exit (since we can cleanly bury the
loop), and it's perfectly clear when pointers into the worklist might be
invalidated.

I'm fixing both algorithms in the same commit to avoid repeating the
commit message; if you take the time to understand one the other should
be easy.  The diff itself isn't entirely obvious since the traversals
have some noise (i.e., things to do), but here's the high-level change:

    auto helper = [&WL](T *Op) {     auto helper = [](T **&I, T **E) {
                                 =>    while (I != E) {
      if (shouldVisit(Op)) {             T *Op = *I++;
        WL.push(Op, Op->begin());        if (shouldVisit(Op)) {
        return true;                       return Op;
      }                                }
      return false;                    return nullptr;
    };                               };
                                 =>
    WL.push(S, S->begin());          WL.push(S, S->begin());
    while (!empty()) {               while (!empty()) {
      auto *N = WL.top().N;            auto *N = WL.top().N;
      auto *&I = WL.top().I;           auto *&I = WL.top().I;
      bool DidChange = false;
      while (I != N->end())
        if (helper(*I++)) {      =>    if (T *Op = helper(I, N->end()) {
          DidChange = true;              WL.push(Op, Op->begin());
          break;                         continue;
        }                              }
      if (DidChange)
        continue;

      POT.push(WL.pop());        =>    POT.push(WL.pop());
    }                                }

Thanks to Mehdi for helping me find a better way to layer this.

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

8 years ago[MachineCombiner] Support for floating-point FMA on ARM64
Gerolf Hoflehner [Fri, 22 Apr 2016 02:15:19 +0000 (02:15 +0000)]
[MachineCombiner] Support for floating-point FMA on ARM64

Evaluates fmul+fadd -> fmadd combines and similar code sequences in the
machine combiner. It adds support for float and double similar to the existing
integer implementation. The key features are:

- DAGCombiner checks whether it should combine greedily or let the machine
combiner do the evaluation. This is only supported on ARM64.
- It gives preference to throughput over latency: the heuristic used is
to combine always in loops. The targets decides whether the machine
combiner should optimize for throughput or latency.
- Supports for fmadd, f(n)msub, fmla, fmls patterns
- On by default at O3 ffast-math

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

8 years ago[ThinLTO] Remove unused/incomplete lazy summary reading support (NFC)
Teresa Johnson [Fri, 22 Apr 2016 01:52:00 +0000 (01:52 +0000)]
[ThinLTO] Remove unused/incomplete lazy summary reading support (NFC)

This removes the interfaces added (and not yet complete) to support
lazy reading of summaries. This support is not expected to be needed
since we are moving to a model where the full index is only being
traversed in the thin link step, instead of the back ends.

(The second part of this that I plan to do next is remove the
GlobalValueInfo from the ModuleSummaryIndex - it was mostly needed to
support lazy parsing of summaries. The index can instead reference the
summary structures directly.)

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

8 years agoUntabify.
NAKAMURA Takumi [Fri, 22 Apr 2016 01:33:50 +0000 (01:33 +0000)]
Untabify.

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

8 years agoTry to fix UNRESOLVED: LLVM :: CodeGen/AArch64/arm64-regress-opt-cmp.s on bots.
Nico Weber [Fri, 22 Apr 2016 01:08:56 +0000 (01:08 +0000)]
Try to fix UNRESOLVED: LLVM :: CodeGen/AArch64/arm64-regress-opt-cmp.s on bots.

This test used to write a .s file until r266971 fixed that.  But on most bots,
the .s file still exists.  Add an rm statement to clean up the bots.  In a few
days, this statement can go away again.

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

8 years agoARM: fix test for Windows division
Saleem Abdulrasool [Fri, 22 Apr 2016 01:03:38 +0000 (01:03 +0000)]
ARM: fix test for Windows division

This was meant to be part of SVN r267080.  cbz cannot use a high register, which
would be silently truncated.  This has now been fixed.

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

8 years ago[WebAssembly] Limit alignment hints to natural alignment.
Dan Gohman [Thu, 21 Apr 2016 23:59:48 +0000 (23:59 +0000)]
[WebAssembly] Limit alignment hints to natural alignment.

This follows the current binary format rules.

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

8 years agoARM: restrict register class for WIN__DBZCHK
Saleem Abdulrasool [Thu, 21 Apr 2016 23:53:19 +0000 (23:53 +0000)]
ARM: restrict register class for WIN__DBZCHK

WIN__DBZCHK will insert a CBZ instruction into the stream.  This instruction
reserves 3 bits for the condition register (rn).  As such, we must ensure that
we restrict the register to a low register.  Use the tGPR class instead of GPR
to ensure that this is properly constrained.  In debug builds, we would attempt
to use lr as a condition register which would silently get truncated with no
hint that the register selection was incorrect.

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

8 years ago[sancov] using normalized filenames for blacklist checks.
Mike Aizatsky [Thu, 21 Apr 2016 23:38:45 +0000 (23:38 +0000)]
[sancov] using normalized filenames for blacklist checks.

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

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

8 years agoFix more -Wunused-variable in non-asserts build.
David Blaikie [Thu, 21 Apr 2016 23:24:09 +0000 (23:24 +0000)]
Fix more -Wunused-variable in non-asserts build.

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

8 years agoMachO: enable .data_region directives everywhere
Tim Northover [Thu, 21 Apr 2016 23:00:17 +0000 (23:00 +0000)]
MachO: enable .data_region directives everywhere

We'd disabled them on x86 because back in the early days some host tools
couldn't handle the new load commands. This no longer holds: anyone capable of
deploying Clang should be able to deploy its copies of ar/ranlib/etc.

rdar://25254790

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

8 years agoFix some -Wunused-variable warnings in non-asserts builds.
David Blaikie [Thu, 21 Apr 2016 22:53:33 +0000 (22:53 +0000)]
Fix some -Wunused-variable warnings in non-asserts builds.

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

8 years ago[Support] Fix Wcast-qual warning
Vedant Kumar [Thu, 21 Apr 2016 22:40:59 +0000 (22:40 +0000)]
[Support] Fix Wcast-qual warning

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

8 years agoFix PDB warnings and test
Reid Kleckner [Thu, 21 Apr 2016 22:37:55 +0000 (22:37 +0000)]
Fix PDB warnings and test

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

8 years agoImprove error message reporting for MachineFunctionProperties
Derek Schuff [Thu, 21 Apr 2016 22:19:24 +0000 (22:19 +0000)]
Improve error message reporting for MachineFunctionProperties

When printing the properties required by a pass, only print the
properties that are set, and not those that are clear (only properties
that are set are verified, clear properties are "don't-care").

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

8 years agoRemove dead code. NFC
Amaury Sechet [Thu, 21 Apr 2016 22:17:39 +0000 (22:17 +0000)]
Remove dead code. NFC

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