Commit Graph

58489 Commits

Author SHA1 Message Date
Hal Finkel
82860f63e1 Add a subtype parameter to VTTI::getShuffleCost
In order to cost subvector insertion and extraction, we need to know
the type of the subvector being extracted.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171453 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-03 02:34:09 +00:00
Bill Wendling
e5ab1bee8c Revert everything to r171366 to try to fix the build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171450 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-03 02:01:50 +00:00
Bill Wendling
22bd641739 Try again to revert the bad patch. The tree was reverted for some unknown reason
before the last time.

--- Reverse-merging r171442 into '.':
U    include/llvm/IR/Attributes.h
U    lib/IR/Attributes.cpp
U    lib/IR/AttributeImpl.h



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171448 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-03 01:54:39 +00:00
Bill Wendling
ded28aca61 Revert patch. Something snuck in there that shouldn't be.
--- Reverse-merging r171441 into '.':
U    include/llvm/IR/Attributes.h
U    lib/IR/Attributes.cpp




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171444 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-03 01:46:27 +00:00
Bill Wendling
8351a60d6d Remove the 'contains' methods in favor of the 'operator==' method.
The 'operator==' method is a bit clearer and much less verbose for somethings
that should have only one value. Remove from the AttrBuilder for consistency.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171442 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-03 01:43:05 +00:00
NAKAMURA Takumi
3ac03815e1 Revert r171427, "An intermediate step in the Attributes rewrite."
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171441 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-03 01:42:06 +00:00
Michael J. Spencer
f94cfb65f5 [MC][COFF] Switch the COFF streamer over to using the MCObjectStreamer version of EmitInstruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171437 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-03 01:09:22 +00:00
Nadav Rotem
e4159491a7 LoopVectorizer: Add support for loop-unrolling during vectorization for increasing the ILP. At the moment this feature is disabled by default and this commit should not cause any functional changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171436 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-03 00:52:27 +00:00
Jakob Stoklund Olesen
251ed7f3e5 Fix PR14732 by handling all kinds of IMPLICIT_DEF live ranges.
Most IMPLICIT_DEF instructions are removed by the ProcessImplicitDefs
pass, and a few are reinserted by PHIElimination when a PHI argument is
<undef>.

RegisterCoalescer was assuming that all IMPLICIT_DEF live ranges look
like those created by PHIElimination, and that their live range never
leaves the basic block.

The PR14732 test case does tricks with PHI nodes that causes a longer
IMPLICIT_DEF live range to appear. This happens very rarely, but
RegisterCoalescer should be able to handle it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171435 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-03 00:47:51 +00:00
Bill Wendling
47990e9743 Make the type signature more strict.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171434 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-03 00:46:43 +00:00
Nadav Rotem
00a6bcaeb4 Avoid vectorization when the function has the "noimplicitflot" attribute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171429 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-02 23:54:43 +00:00
Eric Christopher
82de10a34c Extend the dumping infrastructure to deal with additional
sections for debug info. These are some of the dwo sections from the
DWARF5 split debug info proposal. Update the fission-cu.ll testcase
to show what we should be able to dump more of now.

Work in progress: Ultimately the relocations will be gone for the
dwo section and the strings will be a different form (as well as
the rest of the sections will be included).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171428 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-02 23:52:13 +00:00
Bill Wendling
278bac3fba An intermediate step in the Attributes rewrite.
Modify the AttrBuilder class to store the attributes as a set instead of as a
bit mask. The Attribute class will represent only one attribute instead of a
collection of attributes.

This is the wave of the future!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171427 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-02 23:45:09 +00:00
Tom Stellard
d40758b24e DAGCombiner: Avoid generating illegal vector INT_TO_FP nodes
DAGCombiner::reduceBuildVecConvertToConvertBuildVec() was making two
mistakes:

1. It was checking the legality of scalar INT_TO_FP nodes and then generating
vector nodes.

2. It was passing the result value type to
TargetLoweringInfo::getOperationAction() when it should have been
passing the value type of the first operand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171420 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-02 22:13:01 +00:00
Kevin Enderby
5bf3a28b36 Adds missing aliases for fcom and fcomp instructions without arguments.
Patch by Michael M Kuperstein!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171414 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-02 21:20:15 +00:00
Shuxin Yang
cbf5373603 - Add comment to two functions which might be considered as dead code.
- Fix a typo


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171399 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-02 18:26:31 +00:00
Nadav Rotem
e3b2489f4f AVX: Fix a bug in WidenMaskArithmetic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171398 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-02 17:41:03 +00:00
Chandler Carruth
351ba145a7 Actually update the CMake and Makefile builds correctly, and update the
code that includes Intrinsics.gen directly.

This never showed up in my testing because the old Intrinsics.gen was
still kicking around in the make build system and was correct there. =[
Thankfully, some of the bots to clean rebuilds and that caught this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171373 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-02 12:09:16 +00:00
Chandler Carruth
0b8c9a80f2 Move all of the header files which are involved in modelling the LLVM IR
into their new header subdirectory: include/llvm/IR. This matches the
directory structure of lib, and begins to correct a long standing point
of file layout clutter in LLVM.

There are still more header files to move here, but I wanted to handle
them in separate commits to make tracking what files make sense at each
layer easier.

The only really questionable files here are the target intrinsic
tablegen files. But that's a battle I'd rather not fight today.

I've updated both CMake and Makefile build systems (I think, and my
tests think, but I may have missed something).

I've also re-sorted the includes throughout the project. I'll be
committing updates to Clang, DragonEgg, and Polly momentarily.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171366 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-02 11:36:10 +00:00
Chandler Carruth
58a2cbef4a Resort the #include lines in include/... and lib/... with the
utils/sort_includes.py script.

Most of these are updating the new R600 target and fixing up a few
regressions that have creeped in since the last time I sorted the
includes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171362 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-02 10:22:59 +00:00
Chandler Carruth
c2c50cdcdc Rename VMCore directory to IR.
Aside from moving the actual files, this patch only updates the build
system and the source file comments under lib/... that are relevant.

I'll be updating other docs and other files in smaller subsequnet
commits.

While I've tried to test this, but it is entirely possible that there
will still be some build system fallout.

Also, note that I've not changed the library name itself: libLLVMCore.a
is still the library name. I'd be interested in others' opinions about
whether we should rename this as well (I think we should, just not sure
what it might break)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171359 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-02 09:10:48 +00:00
Craig Topper
3af9323228 Merge SSE and AVX instruction definitions for scalar forms of SQRT, RSQRT, and RCP.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171356 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-02 08:00:39 +00:00
Craig Topper
3cca7df7c7 Merge SSE and AVX instruction definitions for PSHUFD/PSHUFHW/PSHUFLW.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171355 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-02 07:27:49 +00:00
Rafael Espindola
9478673ce0 Revert 171351. It broke MC/X86/x86-32-avx.s.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171352 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-02 01:35:11 +00:00
Craig Topper
b511048cd0 Merge SSE and AVX instruction definitions for scalar forms of SQRT, RSQRT, and RCP.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171351 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-01 20:53:20 +00:00
Benjamin Kramer
6c30749583 Add IRBuilder::CreateVectorSplat and use it to simplify code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171349 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-01 19:55:16 +00:00
Benjamin Kramer
0ea4c3d8c0 SROA: Clean up unused assignment warnings from clang's analyzer.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171348 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-01 16:13:35 +00:00
Michael Gottesman
a6e23cc535 Added DEBUG message when ObjCARC replaces a call which returns its argument verbatim with its argument to temporarily undo an optimization.
Specifically these calls return their argument verbatim, as a low-level
optimization. However, this makes high-level optimizations
harder. We undo any uses of this optimization that the front-end
emitted. We redo them later in the contract pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171346 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-01 16:05:54 +00:00
Michael Gottesman
8f22c8b5e1 Added DEBUG messages to the top of several processing loops in ObjCARC.cpp that emit what instructions are being visited.
This is a part of a larger effort of adding DEBUG messages to the ARC
Optimizer Backend.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171345 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-01 16:05:48 +00:00
Craig Topper
117e4d2e19 Remove unused argument from a multiclass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171340 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-01 03:42:44 +00:00
Craig Topper
76f94fd361 Merge intrinsic instruction definitions for SSE and AVX versions of RCPPS and RSQRTPS.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171339 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-01 03:30:21 +00:00
Craig Topper
42ab0d75ab Remove 2 unused multiclasses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171338 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-01 02:02:45 +00:00
Craig Topper
5284f97632 Merge AVX/SSE instruction definitions for SQRTPS/PD, RSQRTPS, RCPPS. No funcitonal change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171337 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-01 00:11:07 +00:00
Craig Topper
dd9ccdb050 Use packed instead of scalar itineraries for SSE1/2 SQRTPS/PD, RCPPS, and RSQRTPS. VEX-encoded forms already use packed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171336 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 23:49:05 +00:00
Chandler Carruth
a0d8f28a9c Remove an unused method on Program.
I'm simplifying this interface as much as I can before merging it with
the new process interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171334 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 23:44:47 +00:00
Chandler Carruth
2bbe466475 Remove an unused method on the Program class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171332 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 23:38:28 +00:00
Chandler Carruth
f5867ab717 Go ahead and get rid of the old page size interface and convert all the
users over to the new one. No sense maintaining this "compatibility"
layer it seems.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171331 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 23:31:56 +00:00
Chandler Carruth
814afe91cc Flesh out a page size accessor in the new API.
Implement the old API in terms of the new one. This simplifies the
implementation on Windows which can now re-use the self_process's once
initialization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171330 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 23:23:35 +00:00
Chandler Carruth
e0e1985b3b Remove an unused function in the old Process interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171327 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 22:17:59 +00:00
Nuno Lopes
5cec34754d reimplement GetPointerBaseWithConstantOffset().
The new code is an improved copy of the code I deleted from Analysis/Loads.cpp.
One less compute-constant-gep-offset implementation. yay :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171326 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 20:48:35 +00:00
Nuno Lopes
0a9ff4cab3 recommit r171298 (add support for PHI nodes to ObjectSizeOffsetVisitor). Hopefully with bugs corrected now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171325 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 20:45:10 +00:00
Benjamin Kramer
44365353a4 Revert "add support for PHI nodes to ObjectSizeOffsetVisitor"
This reverts r171298. Breaks clang selfhost.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171318 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 19:51:10 +00:00
Jakub Staszak
526057921d Add extra CHECK to make sure that 'or' instruction was replaced.
Also add an assert to avoid confusion in the code where is known that C1 <= C2.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171310 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 18:26:42 +00:00
Nuno Lopes
2e594fa85c revert r171306, since we cannot compare APInts with different bitwidths
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171308 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 18:01:36 +00:00
Nuno Lopes
1ef05b1a2a use ValueTracking's GetPointerBaseWithConstantOffset() function instead of a local implementation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171307 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 17:42:11 +00:00
Nuno Lopes
a44766a4dd minor code simplification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171306 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 17:25:24 +00:00
Nuno Lopes
41be2fb1f9 add support for GlobalAlias to ObjectSizeOffsetVisitor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171303 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 16:23:48 +00:00
Nuno Lopes
729e602082 add support for PHI nodes to ObjectSizeOffsetVisitor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171298 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 13:52:36 +00:00
Bill Wendling
92e287f5bd Add some comparison operators to compare the Attribute object with the AttrKind value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171294 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 11:51:54 +00:00
Chandler Carruth
9b4aba85a8 Switch this code to a more idiomatic double using namespace directive.
Fix a truly odd namespace qualifier that was flat out wrong in the
process. The fully qualified namespace would have been
llvm::sys::TimeValue, llvm::TimeValue makes no sense.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171292 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 11:45:20 +00:00
Chandler Carruth
8e98c1f254 Delete a cut/paste-o from r171290. Very sorry about the noise.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171291 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 11:40:04 +00:00
Chandler Carruth
c9bdcac412 Suppress a MSVC warning complaining about the code working as intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171290 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 11:39:02 +00:00
Chandler Carruth
0184a841d3 Begin sketching out the process interface.
The coding style used here is not LLVM's style because this is modeled
after a Boost interface and thus done in the style of a candidate C++
standard library interface. I'll probably end up proposing it as
a standard C++ library if it proves to be reasonably portable and
useful.

This is just the most basic parts of the interface -- getting the
process ID out of it. However, it helps sketch out some of the boiler
plate such as the base class, derived class, shared code, and static
factory function. It also introduces a unittest so that I can
incrementally ensure this stuff works.

However, I've not even compiled this code for Windows yet. I'll try to
fix any Windows fallout from the bots, and if I can't fix it I'll revert
and get someone on Windows to help out. There isn't a lot more that is
mandatory, so soon I'll switch to just stubbing out the Windows side and
get Michael Spencer to help with implementation as he can test it
directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171289 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 11:17:50 +00:00
Chris Lattner
503fc1c488 Fix LICM's memory promotion optimization to preserve TBAA tags when
promoting a store in a loop.  This was noticed when working on PR14753,
but isn't directly related.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171281 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 08:37:17 +00:00
Chris Lattner
240b9b1d80 teach instcombine to preserve TBAA tag when merging two stores, part of
PR14753


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171279 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 08:10:58 +00:00
Jakub Staszak
b6d9c4181a Grammo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171272 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 01:40:44 +00:00
Bill Wendling
9d30e7208e Remove the getAttributesAtIndex and getNumAttrs methods in favor of using the getAttrSomewhere predicate. This prevents the uses of 'Attribute' as a collection of attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171271 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 00:49:59 +00:00
Jakub Staszak
d60b8ac64f Transform (A == C1 || A == C2) into (A & ~(C1 ^ C2)) == C1
if C1 and C2 differ only with one bit.
Fixes PR14708.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171270 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 00:34:55 +00:00
Hal Finkel
6eb7a4270b Support ppcf128 in SelectionDAG::getConstantFP
Fixes pr14751.

Patch by Kai; Thanks!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171261 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-30 19:03:32 +00:00
Nuno Lopes
98281a2050 convert a bunch of callers from DataLayout::getIndexedOffset() to GEP::accumulateConstantOffset().
The later API is nicer than the former, and is correct regarding wrap-around offsets (if anyone cares).
There are a few more places left with duplicated code, which I'll remove soon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171259 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-30 16:25:48 +00:00
Bill Wendling
94e94b3506 Use the predicate methods off of AttributeSet instead of Attribute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171257 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-30 13:50:49 +00:00
Bill Wendling
8b62abdd7b Remove the Function::getRetAttributes method in favor of using the AttributeSet accessor method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171256 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-30 13:01:51 +00:00
Bill Wendling
39cd0c8e47 Remove Function::getParamAttributes and use the AttributeSet accessor methods instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171255 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-30 12:45:13 +00:00
Bill Wendling
831737d329 Remove the Function::getFnAttributes method in favor of using the AttributeSet
directly.

This is in preparation for removing the use of the 'Attribute' class as a
collection of attributes. That will shift to the AttributeSet class instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171253 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-30 10:32:01 +00:00
Bill Wendling
377660355c s/hasAttribute/contains/g to be more consistent with other method names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171252 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-30 09:17:46 +00:00
Nadav Rotem
db2367512e LoopVectorizer: Fix a bug in the code that updates the loop exiting block.
LCSSA PHIs may have undef values. The vectorizer updates values that are used by outside users such as PHIs.
The bug happened because undefs are not loop values. This patch handles these PHIs.

PR14725



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171251 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-30 07:47:00 +00:00
Bill Wendling
979aff6399 Add a few more c'tors:
* One that accepts a single Attribute::AttrKind.

* One that accepts an Attribute::AttrKind plus a list of values. This is for
  attributes defined like this:

    #1 = attributes { align = 4 }

* One that accepts a string, for target-specific attributes like this:

    #2 = attributes { "cpu=cortex-a8" }


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171249 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-30 02:22:16 +00:00
Bill Wendling
529ec718ac Add a few (as yet unused) query methods to determine if the attribute that's
stored here is of a certain kind. This is in preparation for when an Attribute
object represents a single attribute, instead of a bitmask of attributes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171247 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-30 01:38:39 +00:00
Bill Wendling
435654b181 Uniquify the AttributeImpl based on the Constant pointer, since those are
already uniquified.

Note: This will be expanded in the future to add more than just one pointer
value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171245 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-30 01:23:08 +00:00
Bill Wendling
c966e08a98 s/Raw/getBitMask/g to be more in line with current naming conventions. This method won't be sticking around.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171244 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-30 01:05:42 +00:00
Craig Topper
22d8f0d685 Remove intrinsic specific instructions for (V)SQRTPS/PD. Instead lower to target-independent ISD nodes and use the existing patterns for those.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171237 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-29 18:18:20 +00:00
Craig Topper
6f57f39e4a Merge similar functionality using a nested switch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171229 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-29 17:19:06 +00:00
Craig Topper
6d183e4007 Remove intrinsic specific instructions for SSE/SSE2/AVX floating point max/min instructions. Lower them to target specific nodes and use those patterns instead. This also allows them to be commuted if UnsafeFPMath is enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171227 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-29 16:44:25 +00:00
Jakub Staszak
c20323a758 Simplify code, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171226 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-29 15:57:26 +00:00
Jakub Staszak
3c0307d760 Delete executive bit on ./lib/Target/Hexagon/HexagonAsmPrinter.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171225 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-29 15:23:06 +00:00
Bill Wendling
7c1683d47c Use a 'Constant' object instead of a bit field to store the attribute data.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171221 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-29 12:29:38 +00:00
Bill Wendling
4d5e5e5d61 Use the accessor method instead of the raw ivar to get the bits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171220 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-29 12:10:46 +00:00
Chandler Carruth
a84e7508eb Nuke some dead code that snuck in some how. I thought I had already
deleted this, but apparantly not. Charmingly, Clang didn't warn on it
but GCC did.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171197 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-28 14:50:51 +00:00
Chandler Carruth
73527d30cd Fix a stunning oversight in the inline cost analysis. It was never
propagating one of the values it simplified to a constant across
a myriad of instructions. Notably, ptrtoint instructions when we had
a constant pointer (say, 0) didn't propagate that, blocking a massive
number of down-stream optimizations.

This was uncovered when investigating why we fail to inline and delete
the boilerplate in:

  void f() {
    std::vector<int> v;
    v.push_back(1);
  }

It turns out most of the efforts I've made thus far to improve the
analysis weren't making it far purely because of this. After this is
fixed, the store-to-load forwarding patch enables LLVM to optimize the
above to an empty function. We still can't nuke a second push_back, but
for different reasons.

There is a very real chance this will cause somewhat noticable changes
in inlining behavior, so please let me know if you see regressions (or
improvements!) because of this patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171196 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-28 14:43:42 +00:00
Chandler Carruth
ba94204e94 Teach the inline cost analysis about calls that can be simplified and
how to propagate constants through insert and extract value
instructions.

With the recent improvements to instsimplify, this allows inline cost
analysis to constant fold through intrinsic functions, including notably
the with.overflow intrinsic math routines which often show up inside of
STL abstractions. This is yet another piece in the puzzle of breaking
down the code for:

  void f() {
    std::vector<int> v;
    v.push_back(1);
  }

But it still isn't enough. There are a pile of bugs in inline cost still
blocking this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171195 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-28 14:23:32 +00:00
Chandler Carruth
e949aa1c91 Teach instsimplify to use the constant folder where appropriate for
constant folding calls. Add the initial tests for this which show that
now instsimplify can simplify blindingly obvious code patterns expressed
with both intrinsics and library calls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171194 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-28 14:23:29 +00:00
Chandler Carruth
c98bd9f1a7 Add entry points to instsimplify for simplifying calls. The entry points
are nice and decomposed so that we can simplify synthesized calls as
easily as actually call instructions. The internal utility still has the
same behavior, it just now operates on a more generic interface so that
I can extend the set of call simplifications that instsimplify knows
about.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171189 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-28 11:30:55 +00:00
Alexey Samsonov
f045df1b8b Add proper support for -fsanitize-blacklist= flag for TSan and MSan. LLVM part.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171183 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-28 09:30:44 +00:00
Nadav Rotem
ae34b4280e CostModel: initial checkin for code that estimates the cost of special shuffles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171180 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-28 08:19:03 +00:00
Nadav Rotem
40ef8b7548 wrap 80-col lines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171179 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-28 07:28:43 +00:00
Nadav Rotem
0509db2738 AVX: Move the ZEXT/ANYEXT DAGCo optimizations to the lowering of these optimizations. The old test cases still cover all of these lowering/optimizations. The single change that we have is that now anyext does not need to zero a register, because it does not use the exact code path as the zero_extend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171178 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-28 05:45:24 +00:00
Nadav Rotem
587fb1dd30 Reverse the 'if' condition and reduce the indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171172 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-27 23:08:05 +00:00
Craig Topper
cccccabd07 Merge basic_sse12_fp_binop_p_int and basic_sse12_fp_binop_p_y_int multiclasses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171171 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-27 22:53:47 +00:00
Nadav Rotem
1a330af3b5 AVX/AVX2: Move the SEXT lowering code from a target specific DAGco to a lowering function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171170 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-27 22:47:16 +00:00
Craig Topper
d5fc507ff1 Merge basic_sse12_fp_binop_p and basic_sse12_fp_binop_p_y multiclasses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171166 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-27 18:51:50 +00:00
Chandler Carruth
7ccc2f7a78 Make this parameter be named consistently with most other
getAnalysisUsage implementations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171157 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-27 11:17:15 +00:00
Alexey Samsonov
1c8b825c43 [ASan] Fix lifetime intrinsics handling. Now for each intrinsic we check if it describes one of 'interesting' allocas. Assume that allocas can go through casts and phi-nodes before apperaring as llvm.lifetime arguments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171153 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-27 08:50:58 +00:00
Nadav Rotem
d6fb53adb1 On AVX/AVX2 the type v8i1 is legalized to v8i16, which is an XMM sized
register. In most cases we actually compare or select YMM-sized registers
and mixing the two types creates horrible code. This commit optimizes
some of the transition sequences.

PR14657.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171148 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-27 08:15:45 +00:00
Nadav Rotem
3c22a44400 AVX/AVX2: Move the code that lowers vector-trunc from a DAGCo-hook to custom lowering hook.
The vector truncs were scalarized during LegalizeVectorOps, later vectorized again by some DAGCombine optimization
and finally, lowered by a dagcombing optimization. Now, they are properly lowered during LegalizeVectorOps.
No new testcase because the original testcases still work.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171146 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-27 07:45:10 +00:00
Craig Topper
068aec586d Add hasSideEffects=0 to some forms of ROUND, RCP, and RSQRT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171143 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-27 07:16:08 +00:00
Nadav Rotem
444b4bf5c8 Refactor DAGCombinerInfo. Change the different booleans that indicate if we are before or after different runs of DAGCo, with the CombineLevel enum.
Also, added a new API for checking if we are running before or after the LegalizeVectorOps phase. 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171142 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-27 06:47:41 +00:00
Craig Topper
d0f28c0958 Move single letter 'P' prefix out of multiclass now that tablegen allows defm to start with #NAME. This makes instruction names more searchable again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171141 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-27 06:34:54 +00:00
Craig Topper
025c5de9ba Update tablegen parser to allow defm names to start with #NAME.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171140 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-27 06:32:52 +00:00
Craig Topper
87073aad8f Add hasSideEffects=0 to some shift and rotate instructions. None of which are currently used by code generation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171137 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-27 03:35:44 +00:00
Craig Topper
766cbae4b1 Mark the divide instructions as hasSideEffects=0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171136 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-27 03:01:18 +00:00