Commit Graph

133549 Commits

Author SHA1 Message Date
Vedant Kumar
d1714dc208 Add support for collating profiles for use with code coverage
Differential Revision: http://reviews.llvm.org/D20993

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272599 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13 23:33:48 +00:00
Davide Italiano
ba53b88904 [PM/MergedLoadStoreMotion] Remove unneeded pass dependency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272598 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13 23:28:35 +00:00
Sean Silva
b8cca8451c [PM] Port JumpThreading to the new PM
This follows the approach in r263208 (for GVN) pretty closely:
- move the bulk of the body of the function to the new PM class.
- expose a runImpl method on the new-PM class that takes the IRUnitT and
  pointers/references to any analyses and use that to implement the
  old-PM class.
- use a private namespace in the header for stuff that used to be file
  scope

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272597 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13 22:52:52 +00:00
Davide Italiano
194b42effb [PM/MergeLoadStoreMotion] Convert the logic to static functions.
Pass AliasAnalyis and MemoryDepResult around. This is in preparation
for porting this pass to the new PM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272595 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13 22:27:30 +00:00
Xinliang David Li
121cd17fd6 [MBP] Interface cleanups /NFC
Save machine function pointer so that
the reference does not need to be passed around.

This also gives other methods access to machine
function for information such as entry count etc.

 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272594 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13 22:23:44 +00:00
Sean Silva
9ce41c3e97 [PM] Port LVI to the new PM.
This is a bit gnarly since LVI is maintaining its own cache.
I think this port could be somewhat cleaner, but I'd rather not spend
too much time on it while we still have the old pass hanging around and
limiting how much we can clean things up.
Once the old pass is gone it will be easier (less time spent) to clean
it up anyway.

This is the last dependency needed for porting JumpThreading which I'll
do in a follow-up commit (there's no printer pass for LVI or anything to
test it, so porting a pass that depends on it seems best).

I've been mostly following:
r269370 / D18834 which ported Dependence Analysis
r268601 / D19839 which ported BPI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272593 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13 22:01:25 +00:00
Kevin Enderby
f50be3faf2 Update the AArch64ExternalSymbolizer to print literal strings as escaped strings
so it is the same as the MCExternalSymbolizer.

rdar://17349181


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272588 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13 21:08:57 +00:00
Xinliang David Li
fa405a6dcc [MBP] Code cleanup #3 /NFC
This is third patch to clean up the code.

Included in this patch:
1. Further unclutter trace/chain formation main routine;
2. Isolate the logic to compute global cost/conflict detection
   into its own method;
3. Heavily document the selection algorithm;
4. Added helper hook to allow PGO specific logic to be
   added in the future.
 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272582 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13 20:24:19 +00:00
Sanjoy Das
60271907e7 Move previously added test case to the right location
In rL272580 I accidentally added a test case to test/CodeGen when
test/Transforms/DeadStoreElimination/ is a better place for it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272581 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13 20:12:07 +00:00
Sanjoy Das
ae9ac9ce84 Fix AAResults::callCapturesBefore for operand bundles
Summary:
AAResults::callCapturesBefore would previously ignore operand
bundles. It was possible for a later instruction to miss its memory
dependency on a call site that would only access the pointer through a
bundle.

Patch by Oscar Blumberg!

Reviewers: sanjoy

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272580 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13 19:55:04 +00:00
George Burgess IV
2caddbf39d Attempt to make windows buildbots happy.
Broken by r272578. I didn't realize that the default move ctor
complaints would happen for non-template classes. :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272579 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13 19:38:49 +00:00
George Burgess IV
b7ebc01945 [CFLAA] Refactor to remove redundant maps. NFC.
Patch by Jia Chen.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272578 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13 19:21:18 +00:00
Simon Pilgrim
933aa2e6be [X86][SSE] Added extract to scalar nontemporal store tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272577 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13 19:08:28 +00:00
David Majnemer
204d45582a [X86] Remove llvm.x86.bit.scan.{forward,reverse}.32
The need for these intrinsics has been obviated by r272564 which
reimplements their functionality using generic IR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272566 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13 17:33:13 +00:00
Rafael Espindola
0baaa63266 Add triple to input file.
Patch by H.J. Lu.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272563 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13 17:08:15 +00:00
Marek Olsak
760c36c5ae AMDGPU/SI: Set INDEX_STRIDE for scratch coalescing
Summary:
Mesa and other users must set this to enable coalescing:
- STRIDE = 0
- SWIZZLE_ENABLE = 1

This makes one particular compute shader 8x faster.

Reviewers: tstellarAMD, arsenm

Subscribers: arsenm, kzhuravl

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272556 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13 16:05:57 +00:00
Taewook Oh
4133ef3efb In openFileForRead, attempt to fetch the actual name of the file on disk -- including case -- so that clang can later warn about non-portable #include and #import directives.
Differential Revision: http://reviews.llvm.org/D19842
Corresponding clang patch: http://reviews.llvm.org/D19843

Re-commit after addressing issues with of generating too many warnings for Windows and asan test failures

Patch by Eric Niebler



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272555 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13 15:54:56 +00:00
Matt Arsenault
8cd24fa644 AMDGPU: Fix post-RA verifier errors with trackLivenessAfterRegAlloc
The condition reg of the cndmask_b64 expansion can't be killed by
the first one, and the implicit super register implicit def is needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272554 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13 15:53:52 +00:00
Ulrich Weigand
603d680eb5 [SystemZ] Enable index register memory constraints for inline ASM
This enables use of the 'R' and 'T' memory constraints for inline ASM
operands on SystemZ, which allow an index register as well as an
immediate displacement. This patch includes corresponding documentation
and test case updates.

As with the last patch of this kind, I moved the 'm' constraint to the
most general case, which is now 'T' (base + 20-bit signed displacement +
index register).

Author: colpell
Differential Revision: http://reviews.llvm.org/D21239



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272547 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13 14:24:05 +00:00
Ranjeet Singh
1dd5b28858 [ARM] Reverting r272544 because clang patch needs
to go in as soon as llvm patch has gone in because
tests will start breaking in Clang.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272546 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13 10:58:24 +00:00
Vikram TV
f2db0fa31a Fix a typo in loop versioning.
Reviewers: ashutosh.nema

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272545 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13 10:49:28 +00:00
Ranjeet Singh
84bf8bc6d0 [ARM] Add mrrc/mrrc2 co-processor intrinsics
MRRC/MRRC2 instruction writes to two registers. The
intrinsic definition returns a single uint64_t to
represent the write, this is a compact way of
representing a write to two 32 bit registers,
the alternative might have been two return a
struct of 2 uint32_t's but this isn't as nice.

Differential Revision: 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272544 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13 10:43:50 +00:00
Strahinja Petrovic
7417e35311 This patch fixes handling long double type when it is
constant in soft float mode on PowerPC 32 architecture.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272543 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13 10:29:29 +00:00
Simon Pilgrim
dc051d0c8c [X86][SSE4A] Renamed tests to correspond with the the instruction with being tested
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272542 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13 10:14:42 +00:00
Haojian Wu
2bc15c9efd Fix an enumeral mismatch warning.
Summary:
The "-Werror=enum-compare" shows that the statement is using two different enums:

enumeral mismatch in conditional expression: 'llvm::X86ISD::NodeType' vs 'llvm::ISD::NodeType'

A follow-up fix on D21235.

Reviewers: klimek

Subscribers: spatel, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272539 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13 09:03:45 +00:00
Zijiao Ma
28712da449 [AArch64] Add RAS extensions support in AArch64TargetParser.
RAS extensions are part of ARMv8.2,now supported in Clang.
Add RAS extensions support in AArch64TargetParser.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272533 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13 05:27:58 +00:00
Craig Topper
dbd262941c [AVX512] Remove maksed pshufd, pshuflw, and phufhw intrinsics and autoupgrade them to selects and shufflevector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272527 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13 02:36:48 +00:00
Craig Topper
26778f96df [X86] Refactor some of the X86 autoupgrade code to split mask vector and select generation into routines that can be reused for future intrinsic upgrades. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272526 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13 02:36:42 +00:00
Mike Spertus
2a6b57b9f7 Improved Visual Studio 2015 visualization of SmallVectorImpl
When visualizing small vectors in VS2015, show the first few elements in the DisplayString instead of the size. For example, a SmallVector of DeclAccessPair will visualize like

  {public typename ...Ts, public typename U}

The visualization in VS2013 remains the same because we continue to include the old visualizer with a lower-than-default priority of MediumLow, and the same SmallVector would continue to be visualized as

  {size = 2}


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272525 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13 01:43:14 +00:00
NAKAMURA Takumi
229220275b Untabify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272523 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13 00:18:19 +00:00
Benjamin Kramer
d92b0de878 Use 'auto' to avoid implicit copies.
td_type is std::pair<std::string, std::string>, but the map returns
elements of std::pair<const std::string, std::string>. In well-designed
languages like C++ that yields an implicit copy perfectly hidden by
constref's lifetime extension. Just use auto, the typedef obscured the
real type anyways.

Found with a little help from clang-tidy's
performance-implicit-cast-in-loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272519 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-12 19:02:34 +00:00
Benjamin Kramer
8fc5df7092 [Verifier] Simplify code. No functionality change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272517 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-12 17:46:23 +00:00
Benjamin Kramer
13c42d2b20 Run clang-tidy's performance-unnecessary-copy-initialization over LLVM.
No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272516 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-12 17:30:47 +00:00
Xinliang David Li
4ecf7a9179 [MBP] Code cleanup /NFC
This is second patch to clean up the code.

In this patch, the logic to determine block outlinining
is refactored and more comments are added.
 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272514 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-12 16:54:03 +00:00
Benjamin Kramer
022a8990dd Move instances of std::function.
Or replace with llvm::function_ref if it's never stored. NFC intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272513 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-12 16:13:55 +00:00
Benjamin Kramer
af18e017d2 Pass DebugLoc and SDLoc by const ref.
This used to be free, copying and moving DebugLocs became expensive
after the metadata rewrite. Passing by reference eliminates a ton of
track/untrack operations. No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272512 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-12 15:39:02 +00:00
Sanjay Patel
9a476793c5 [x86, SSE] change patterns for CMPP to float types to allow matching with SSE1 (PR28044)
This patch is intended to solve:
https://llvm.org/bugs/show_bug.cgi?id=28044

By changing the definition of X86ISD::CMPP to use float types, we allow it to be created 
and pass legalization for an SSE1-only target where v4i32 is not legal.

The motivational trail for this change includes:
https://llvm.org/bugs/show_bug.cgi?id=28001

and eventually makes this trigger:
http://reviews.llvm.org/D21190

Ie, after this step, we should be free to have Clang generate FP compare IR instead of x86
intrinsics for SSE C packed compare intrinsics. (We can auto-upgrade and remove the LLVM 
sse.cmp intrinsics as a follow-up step.) Once we're generating vector IR instead of x86
intrinsics, a big pile of generic optimizations can trigger.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272511 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-12 15:03:25 +00:00
Craig Topper
b2cfb64e72 [X86] Remove sse2 pshufd/pshuflw/pshufhw intrinsics and upgrade them to shufflevector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272510 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-12 14:11:32 +00:00
Benjamin Kramer
de9d1e0d13 [RegUsageInfoCollector] Drop unneccesary const_cast. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272509 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-12 13:32:23 +00:00
Simon Pilgrim
e4f64b2456 [X86][BMI] Added fast-isel tests for BMI1 intrinsics
A lot of the codegen is pretty awful for these as they are mostly implemented as generic bit twiddling ops 

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272508 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-12 09:56:05 +00:00
Sean Silva
466d0a3f2a [PM] Port DeadArgumentElimination to the new PM
The approach taken here follows r267631.

deadarghaX0r should be easy to port when the time comes to add new-PM
support to bugpoint.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272507 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-12 09:16:39 +00:00
Amaury Sechet
58fd93ad90 Change () to (void) in the C API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272506 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-12 07:56:21 +00:00
Sean Silva
cc691dd8da [PM] Port ReversePostOrderFunctionAttrs to the new PM
Below are my super rough notes when porting. They can probably serve as
a basic guide for porting other passes to the new PM. As I port more
passes I'll expand and generalize this and make a proper
docs/HowToPortToNewPassManager.rst document. There is also missing
documentation for general concepts and API's in the new PM which will
require some documentation.
Once there is proper documentation in place we can put up a list of
passes that have to be ported and game-ify/crowdsource the rest of the
porting (at least of the middle end; the backend is still unclear).

I will however be taking personal responsibility for ensuring that the
LLD/ELF LTO pipeline is ported in a timely fashion. The remaining passes
to be ported are (do something like
`git grep "<the string in the bullet point below>"` to find the pass):

General Scalar:
[ ] Simplify the CFG
[ ] Jump Threading
[ ] MemCpy Optimization
[ ] Promote Memory to Register
[ ] MergedLoadStoreMotion
[ ] Lazy Value Information Analysis

General IPO:
[ ] Dead Argument Elimination
[ ] Deduce function attributes in RPO

Loop stuff / vectorization stuff:
[ ] Alignment from assumptions
[ ] Canonicalize natural loops
[ ] Delete dead loops
[ ] Loop Access Analysis
[ ] Loop Invariant Code Motion
[ ] Loop Vectorization
[ ] SLP Vectorizer
[ ] Unroll loops

Devirtualization / CFI:
[ ] Cross-DSO CFI
[ ] Whole program devirtualization
[ ] Lower bitset metadata

CGSCC passes:
[ ] Function Integration/Inlining
[ ] Remove unused exception handling info
[ ] Promote 'by reference' arguments to scalars

Please let me know if you are interested in working on any of the passes
in the above list (e.g. reply to the post-commit thread for this patch).
I'll probably be tackling "General Scalar" and "General IPO" first FWIW.

Steps as I port "Deduce function attributes in RPO"
---------------------------------------------------

(note: if you are doing any work based on these notes, please leave a
note in the post-commit review thread for this commit with any
improvements / suggestions / incompleteness you ran into!)

Note: "Deduce function attributes in RPO" is a module pass.

1. Do preparatory refactoring.

Do preparatory factoring. In this case all I had to do was to pull out a static helper (r272503).
(TODO: give more advice here e.g. if pass holds state or something)

2. Rename the old pass class.

llvm/lib/Transforms/IPO/FunctionAttrs.cpp
Rename class ReversePostOrderFunctionAttrs -> ReversePostOrderFunctionAttrsLegacyPass
in preparation for adding a class ReversePostOrderFunctionAttrs as the pass in the new PM.
(edit: actually wait what? The new class name will be
ReversePostOrderFunctionAttrsPass, so it doesn't conflict. So this step is
sort of useless churn).

llvm/include/llvm/InitializePasses.h
llvm/lib/LTO/LTOCodeGenerator.cpp
llvm/lib/Transforms/IPO/IPO.cpp
llvm/lib/Transforms/IPO/FunctionAttrs.cpp
Rename initializeReversePostOrderFunctionAttrsPass -> initializeReversePostOrderFunctionAttrsLegacyPassPass
(note that the "PassPass" thing falls out of `s/ReversePostOrderFunctionAttrs/ReversePostOrderFunctionAttrsLegacyPass/`)
Note that the INITIALIZE_PASS macro is what creates this identifier name, so renaming the class requires this renaming too.

Note that createReversePostOrderFunctionAttrsPass does not need to be
renamed since its name is not generated from the class name.

3. Add the new PM pass class.

In the new PM all passes need to have their
declaration in a header somewhere, so you will often need to add a header.
In this case
llvm/include/llvm/Transforms/IPO/FunctionAttrs.h is already there because
PostOrderFunctionAttrsPass was already ported.
The file-level comment from the .cpp file can be used as the file-level
comment for the new header. You may want to tweak the wording slightly
from "this file implements" to "this file provides" or similar.

Add declaration for the new PM pass in this header:

    class ReversePostOrderFunctionAttrsPass
        : public PassInfoMixin<ReversePostOrderFunctionAttrsPass> {
    public:
      PreservedAnalyses run(Module &M, AnalysisManager<Module> &AM);
    };

Its name should end with `Pass` for consistency (note that this doesn't
collide with the names of most old PM passes). E.g. call it
`<name of the old PM pass>Pass`.

Also, move the doxygen comment from the old PM pass to the declaration of
this class in the header.
Also, include the declaration for the new PM class
`llvm/Transforms/IPO/FunctionAttrs.h` at the top of the file (in this case,
it was already done when the other pass in this file was ported).

Now define the `run` method for the new class.
The main things here are:
a) Use AM.getResult<...>(M) to get results instead of `getAnalysis<...>()`

b) If the old PM pass would have returned "false" (i.e. `Changed ==
false`), then you should return PreservedAnalyses::all();

c) In the old PM getAnalysisUsage method, observe the calls
   `AU.addPreserved<...>();`.

   In the case `Changed == true`, for each preserved analysis you should do
   call `PA.preserve<...>()` on a PreservedAnalyses object and return it.
   E.g.:

       PreservedAnalyses PA;
       PA.preserve<CallGraphAnalysis>();
       return PA;

Note that calls to skipModule/skipFunction are not supported in the new PM
currently, so optnone and optimization bisect support do not work. You can
just drop those calls for now.

4. Add the pass to the new PM pass registry to make it available in opt.

In llvm/lib/Passes/PassBuilder.cpp add a #include for your header.
`#include "llvm/Transforms/IPO/FunctionAttrs.h"`
In this case there is already an include (from when
PostOrderFunctionAttrsPass was ported).

Add your pass to llvm/lib/Passes/PassRegistry.def
In this case, I added
`MODULE_PASS("rpo-functionattrs", ReversePostOrderFunctionAttrsPass())`
The string is from the `INITIALIZE_PASS*` macros used in the old pass
manager.

Then choose a test that uses the pass and use the new PM `-passes=...` to
run it.
E.g. in this case there is a test that does:
; RUN: opt < %s -basicaa -functionattrs -rpo-functionattrs -S | FileCheck %s
I have added the line:
; RUN: opt < %s -aa-pipeline=basic-aa -passes='require<targetlibinfo>,cgscc(function-attrs),rpo-functionattrs' -S | FileCheck %s
The `-aa-pipeline=basic-aa` and
`require<targetlibinfo>,cgscc(function-attrs)` are what is needed to run
functionattrs in the new PM (note that in the new PM "functionattrs"
becomes "function-attrs" for some reason). This is just pulled from
`readattrs.ll` which contains the change from when functionattrs was ported
to the new PM.
Adding rpo-functionattrs causes the pass that was just ported to run.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272505 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-12 07:48:51 +00:00
Amaury Sechet
ca669104bf Make sure we have a Add/Remove/Has function for various thing that can have attribute.
Summary: This also deprecated the get attribute function familly.

Reviewers: Wallbraker, whitequark, joker.eph, echristo, rafael, jyknight

Subscribers: axw, joker.eph, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272504 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-12 06:17:24 +00:00
Sean Silva
5f6317b293 Factor out a helper. NFC
Prep for porting to new PM.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272503 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-12 05:44:51 +00:00
Craig Topper
fa4b4ced7f [X86] Pre-allocate some of the shuffle mask SmallVectors in the auto upgrade code instead of calling push_back in a loop. This removes the need to check if the vector needs to grow on each iteration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272501 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-12 04:48:00 +00:00
Craig Topper
618e02d931 [AVX512] Remove the masked palignr intrinsics that I forgot to remove when I added auto-upgrade code to turn them into shufflevectors and selects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272497 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-12 04:14:13 +00:00
Craig Topper
44d1e38210 [X86] Greatly simplify the llvm.x86.avx.vpermil.* auto-upgrade code. We can fully derive everything using types of the intrinsic arguments rather than writing separate loops for each intrinsic. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272496 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-12 03:10:47 +00:00
Eli Friedman
9d9bfcf418 [MergedLoadStoreMotion] Use correct helper for load hoist safety.
It isn't legal to hoist a load past a call which might not return;
even if it doesn't throw, it could, for example, call exit().

Fixes http://llvm.org/PR27953.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272495 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-12 02:11:20 +00:00
Craig Topper
0771fcddeb [X86] Move tests for llvm.x86.avx.vpermil.* intrinsics to a -upgrade test since they are autoupgraded to shufflevector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272494 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-12 01:41:06 +00:00