Revision tags: llvmorg-3.6.0-rc1 |
|
#
d9903888 |
| 14-Jan-2015 |
Chandler Carruth <chandlerc@gmail.com> |
[cleanup] Re-sort all the #include lines in LLVM using utils/sort_includes.py.
I clearly haven't done this in a while, so more changed than usual. This even uncovered a missing include from the Inst
[cleanup] Re-sort all the #include lines in LLVM using utils/sort_includes.py.
I clearly haven't done this in a while, so more changed than usual. This even uncovered a missing include from the InstrProf library that I've added. No functionality changed here, just mechanical cleanup of the include order.
llvm-svn: 225974
show more ...
|
#
447e646e |
| 06-Jan-2015 |
Matt Arsenault <Matthew.Arsenault@amd.com> |
Add isNegative helper to ConstantFPSDNode
llvm-svn: 225309
|
#
95212a65 |
| 06-Jan-2015 |
Matt Arsenault <Matthew.Arsenault@amd.com> |
Add isInfinity helper to ConstantFPSDNode
llvm-svn: 225308
|
Revision tags: llvmorg-3.5.1, llvmorg-3.5.1-rc2 |
|
#
addddc44 |
| 15-Dec-2014 |
Michael Ilseman <milseman@apple.com> |
Silence more static analyzer warnings.
Add in definedness checks for shift operators, null checks when pointers are assumed by the code to be non-null, and explicit unreachables.
llvm-svn: 224255
|
#
5bf8fef5 |
| 09-Dec-2014 |
Duncan P. N. Exon Smith <dexonsmith@apple.com> |
IR: Split Metadata from Value
Split `Metadata` away from the `Value` class hierarchy, as part of PR21532. Assembly and bitcode changes are in the wings, but this is the bulk of the change for the I
IR: Split Metadata from Value
Split `Metadata` away from the `Value` class hierarchy, as part of PR21532. Assembly and bitcode changes are in the wings, but this is the bulk of the change for the IR C++ API.
I have a follow-up patch prepared for `clang`. If this breaks other sub-projects, I apologize in advance :(. Help me compile it on Darwin I'll try to fix it. FWIW, the errors should be easy to fix, so it may be simpler to just fix it yourself.
This breaks the build for all metadata-related code that's out-of-tree. Rest assured the transition is mechanical and the compiler should catch almost all of the problems.
Here's a quick guide for updating your code:
- `Metadata` is the root of a class hierarchy with three main classes: `MDNode`, `MDString`, and `ValueAsMetadata`. It is distinct from the `Value` class hierarchy. It is typeless -- i.e., instances do *not* have a `Type`.
- `MDNode`'s operands are all `Metadata *` (instead of `Value *`).
- `TrackingVH<MDNode>` and `WeakVH` referring to metadata can be replaced with `TrackingMDNodeRef` and `TrackingMDRef`, respectively.
If you're referring solely to resolved `MDNode`s -- post graph construction -- just use `MDNode*`.
- `MDNode` (and the rest of `Metadata`) have only limited support for `replaceAllUsesWith()`.
As long as an `MDNode` is pointing at a forward declaration -- the result of `MDNode::getTemporary()` -- it maintains a side map of its uses and can RAUW itself. Once the forward declarations are fully resolved RAUW support is dropped on the ground. This means that uniquing collisions on changing operands cause nodes to become "distinct". (This already happened fairly commonly, whenever an operand went to null.)
If you're constructing complex (non self-reference) `MDNode` cycles, you need to call `MDNode::resolveCycles()` on each node (or on a top-level node that somehow references all of the nodes). Also, don't do that. Metadata cycles (and the RAUW machinery needed to construct them) are expensive.
- An `MDNode` can only refer to a `Constant` through a bridge called `ConstantAsMetadata` (one of the subclasses of `ValueAsMetadata`).
As a side effect, accessing an operand of an `MDNode` that is known to be, e.g., `ConstantInt`, takes three steps: first, cast from `Metadata` to `ConstantAsMetadata`; second, extract the `Constant`; third, cast down to `ConstantInt`.
The eventual goal is to introduce `MDInt`/`MDFloat`/etc. and have metadata schema owners transition away from using `Constant`s when the type isn't important (and they don't care about referring to `GlobalValue`s).
In the meantime, I've added transitional API to the `mdconst` namespace that matches semantics with the old code, in order to avoid adding the error-prone three-step equivalent to every call site. If your old code was:
MDNode *N = foo(); bar(isa <ConstantInt>(N->getOperand(0))); baz(cast <ConstantInt>(N->getOperand(1))); bak(cast_or_null <ConstantInt>(N->getOperand(2))); bat(dyn_cast <ConstantInt>(N->getOperand(3))); bay(dyn_cast_or_null<ConstantInt>(N->getOperand(4)));
you can trivially match its semantics with:
MDNode *N = foo(); bar(mdconst::hasa <ConstantInt>(N->getOperand(0))); baz(mdconst::extract <ConstantInt>(N->getOperand(1))); bak(mdconst::extract_or_null <ConstantInt>(N->getOperand(2))); bat(mdconst::dyn_extract <ConstantInt>(N->getOperand(3))); bay(mdconst::dyn_extract_or_null<ConstantInt>(N->getOperand(4)));
and when you transition your metadata schema to `MDInt`:
MDNode *N = foo(); bar(isa <MDInt>(N->getOperand(0))); baz(cast <MDInt>(N->getOperand(1))); bak(cast_or_null <MDInt>(N->getOperand(2))); bat(dyn_cast <MDInt>(N->getOperand(3))); bay(dyn_cast_or_null<MDInt>(N->getOperand(4)));
- A `CallInst` -- specifically, intrinsic instructions -- can refer to metadata through a bridge called `MetadataAsValue`. This is a subclass of `Value` where `getType()->isMetadataTy()`.
`MetadataAsValue` is the *only* class that can legally refer to a `LocalAsMetadata`, which is a bridged form of non-`Constant` values like `Argument` and `Instruction`. It can also refer to any other `Metadata` subclass.
(I'll break all your testcases in a follow-up commit, when I propagate this change to assembly.)
llvm-svn: 223802
show more ...
|
Revision tags: llvmorg-3.5.1-rc1 |
|
#
f1de34b8 |
| 04-Dec-2014 |
Elena Demikhovsky <elena.demikhovsky@intel.com> |
Masked Load / Store Intrinsics - the CodeGen part. I'm recommiting the codegen part of the patch. The vectorizer part will be send to review again.
Masked Vector Load and Store Intrinsics. Introduce
Masked Load / Store Intrinsics - the CodeGen part. I'm recommiting the codegen part of the patch. The vectorizer part will be send to review again.
Masked Vector Load and Store Intrinsics. Introduced new target-independent intrinsics in order to support masked vector loads and stores. The loop vectorizer optimizes loops containing conditional memory accesses by generating these intrinsics for existing targets AVX2 and AVX-512. The vectorizer asks the target about availability of masked vector loads and stores. Added SDNodes for masked operations and lowering patterns for X86 code generator. Examples: <16 x i32> @llvm.masked.load.v16i32(i8* %addr, <16 x i32> %passthru, i32 4 /* align */, <16 x i1> %mask) declare void @llvm.masked.store.v8f64(i8* %addr, <8 x double> %value, i32 4, <8 x i1> %mask)
Scalarizer for other targets (not AVX2/AVX-512) will be done in a separate patch.
http://reviews.llvm.org/D6191
llvm-svn: 223348
show more ...
|
#
9bc81fbe |
| 28-Nov-2014 |
Duncan P. N. Exon Smith <dexonsmith@apple.com> |
Revert "Masked Vector Load and Store Intrinsics."
This reverts commit r222632 (and follow-up r222636), which caused a host of LNT failures on an internal bot. I'll respond to the commit on the list
Revert "Masked Vector Load and Store Intrinsics."
This reverts commit r222632 (and follow-up r222636), which caused a host of LNT failures on an internal bot. I'll respond to the commit on the list with a reproduction of one of the failures.
Conflicts: lib/Target/X86/X86TargetTransformInfo.cpp
llvm-svn: 222936
show more ...
|
#
9e5089a9 |
| 23-Nov-2014 |
Elena Demikhovsky <elena.demikhovsky@intel.com> |
Masked Vector Load and Store Intrinsics. Introduced new target-independent intrinsics in order to support masked vector loads and stores. The loop vectorizer optimizes loops containing conditional me
Masked Vector Load and Store Intrinsics. Introduced new target-independent intrinsics in order to support masked vector loads and stores. The loop vectorizer optimizes loops containing conditional memory accesses by generating these intrinsics for existing targets AVX2 and AVX-512. The vectorizer asks the target about availability of masked vector loads and stores. Added SDNodes for masked operations and lowering patterns for X86 code generator. Examples: <16 x i32> @llvm.masked.load.v16i32(i8* %addr, <16 x i32> %passthru, i32 4 /* align */, <16 x i1> %mask) declare void @llvm.masked.store.v8f64(i8* %addr, <8 x double> %value, i32 4, <8 x i1> %mask)
Scalarizer for other targets (not AVX2/AVX-512) will be done in a separate patch.
http://reviews.llvm.org/D6191
llvm-svn: 222632
show more ...
|
#
c15788a2 |
| 07-Nov-2014 |
David Majnemer <david.majnemer@gmail.com> |
SelectionDAG: Assert if we truncate SDNode's NumOperands or NumValues
No functionality change intended, this just stops us early if we created a bad SDNode.
llvm-svn: 221560
|
Revision tags: llvmorg-3.5.0, llvmorg-3.5.0-rc4 |
|
#
71b7b68b |
| 21-Aug-2014 |
Craig Topper <craig.topper@gmail.com> |
Repace SmallPtrSet with SmallPtrSetImpl in function arguments to avoid needing to mention the size.
llvm-svn: 216158
|
Revision tags: llvmorg-3.5.0-rc3 |
|
#
6230691c |
| 18-Aug-2014 |
Craig Topper <craig.topper@gmail.com> |
Revert "Repace SmallPtrSet with SmallPtrSetImpl in function arguments to avoid needing to mention the size."
Getting a weird buildbot failure that I need to investigate.
llvm-svn: 215870
|
#
5229cfd1 |
| 17-Aug-2014 |
Craig Topper <craig.topper@gmail.com> |
Repace SmallPtrSet with SmallPtrSetImpl in function arguments to avoid needing to mention the size.
llvm-svn: 215868
|
#
415e344f |
| 13-Aug-2014 |
Hal Finkel <hfinkel@anl.gov> |
Fix classof for ISD::INTRINSIC_W_CHAIN and INTRINSIC_VOID
Unfortunately, our use of the SDNode class hierarchy for INTRINSIC_W_CHAIN and INTRINSIC_VOID nodes is somewhat broken right now. These node
Fix classof for ISD::INTRINSIC_W_CHAIN and INTRINSIC_VOID
Unfortunately, our use of the SDNode class hierarchy for INTRINSIC_W_CHAIN and INTRINSIC_VOID nodes is somewhat broken right now. These nodes sometimes are used for memory intrinsics (those with MachineMemOperands), and sometimes not. When not, the nodes are not created as instances of MemIntrinsicSDNode, but rather created as some other subclass of SDNode using DAG::getNode. When they are memory intrinsics, they are created using DAG::getMemIntrinsicNode as instances of MemIntrinsicSDNode. MemIntrinsicSDNode is a subclass of MemSDNode, but prior to r214452, we had a non-self-consistent setup whereby MemIntrinsicSDNode::classof on INTRINSIC_W_CHAIN and INTRINSIC_VOID would return true but MemSDNode::classof on INTRINSIC_W_CHAIN and INTRINSIC_VOID would return false. In r214452, MemSDNode::classof was changed to return true for INTRINSIC_W_CHAIN and INTRINSIC_VOID, which is now self-consistent. The problem is that neither the pre-r214452 logic and the post-r214452 logic are really right. The truth is that not all INTRINSIC_W_CHAIN and INTRINSIC_VOID nodes are instances of MemIntrinsicSDNode (or MemSDNode for that matter), and the return value from classof needs to reflect that. This was broken before r214452 (because MemIntrinsicSDNode::classof always returned true), and was broken afterward (because MemSDNode::classof also always returned true), and will now be correct.
The minimal solution is to grab one of the SubclassData bits (there is one left for MemIntrinsicSDNode nodes) and use it to store whether or not a particular INTRINSIC_W_CHAIN or INTRINSIC_VOID is really an instance of MemIntrinsicSDNode or not. Doing this allows both MemIntrinsicSDNode::classof and MemSDNode::classof to return the correct answer for the underlying object for both the memory-intrinsic and non-memory-intrinsic cases.
This fixes the problem that r214452 created in the SelectionDAGDumper (thanks to Matt Arsenault for pointing it out).
Because PowerPC does not implement getTgtMemIntrinsic, this change breaks test/CodeGen/PowerPC/unal-altivec-wint.ll. I've XFAILed it for now, and will fix it in a follow-up commit.
llvm-svn: 215511
show more ...
|
Revision tags: llvmorg-3.5.0-rc2 |
|
#
9e529854 |
| 31-Jul-2014 |
Hal Finkel <hfinkel@anl.gov> |
Make classof in MemSDNode consistent with MemIntrinsicSDNode
If INTRINSIC_W_CHAIN and INTRINSIC_VOID are MemIntrinsicSDNodes, and a MemIntrinsicSDNode is a MemSDNode, then INTRINSIC_W_CHAIN and INTR
Make classof in MemSDNode consistent with MemIntrinsicSDNode
If INTRINSIC_W_CHAIN and INTRINSIC_VOID are MemIntrinsicSDNodes, and a MemIntrinsicSDNode is a MemSDNode, then INTRINSIC_W_CHAIN and INTRINSIC_VOID must be MemSDNodes too.
Noticed by inspection.
llvm-svn: 214452
show more ...
|
#
3de980d2 |
| 25-Jul-2014 |
Chandler Carruth <chandlerc@gmail.com> |
[SDAG] Enable the new assert for out-of-range result numbers in SDValues, fixing the two bugs left in the regression suite.
The key for both of these was the use a single value type rather than a VT
[SDAG] Enable the new assert for out-of-range result numbers in SDValues, fixing the two bugs left in the regression suite.
The key for both of these was the use a single value type rather than a VTList which caused an unintentionally single-result merge-value node. Fix this by getting the appropriate VTList in place.
Doing this exposed that the comments in x86's code abouth how MUL_LOHI operands are handle is wrong. The bug with the use of out-of-range result numbers was hiding the bug about the order of operands here (as best i can tell). There are more places where the code appears to get this backwards still...
llvm-svn: 213931
show more ...
|
#
94bd553e |
| 25-Jul-2014 |
Chandler Carruth <chandlerc@gmail.com> |
[SDAG] Start plumbing an assert into SDValues that we don't form one with a result number outside the range of results for the node.
I don't know how we managed to not really check this very basic i
[SDAG] Start plumbing an assert into SDValues that we don't form one with a result number outside the range of results for the node.
I don't know how we managed to not really check this very basic invariant for so long, but the code is *very* broken at this point. I have over 270 test failures with the assert enabled. I'm committing it disabled so that others can join in the cleanup effort and reproduce the issues. I've also included one of the obvious fixes that I already found. More fixes to come.
llvm-svn: 213926
show more ...
|
#
cc39b675 |
| 24-Jul-2014 |
Hal Finkel <hfinkel@anl.gov> |
AA metadata refactoring (introduce AAMDNodes)
In order to enable the preservation of noalias function parameter information after inlining, and the representation of block-level __restrict__ pointer
AA metadata refactoring (introduce AAMDNodes)
In order to enable the preservation of noalias function parameter information after inlining, and the representation of block-level __restrict__ pointer information (etc.), additional kinds of aliasing metadata will be introduced. This metadata needs to be carried around in AliasAnalysis::Location objects (and MMOs at the SDAG level), and so we need to generalize the current scheme (which is hard-coded to just one TBAA MDNode*).
This commit introduces only the necessary refactoring to allow for the introduction of other aliasing metadata types, but does not actually introduce any (that will come in a follow-up commit). What it does introduce is a new AAMDNodes structure to hold all of the aliasing metadata nodes associated with a particular memory-accessing instruction, and uses that structure instead of the raw MDNode* in AliasAnalysis::Location, etc.
No functionality change intended.
llvm-svn: 213859
show more ...
|
Revision tags: llvmorg-3.5.0-rc1 |
|
#
f0a33b71 |
| 09-Jul-2014 |
Chandler Carruth <chandlerc@gmail.com> |
[SDAG] At the suggestion of Hal, switch to an output parameter that tracks which elements of the build vector are in fact undef.
This should make actually inpsecting them (likely in my next patch) r
[SDAG] At the suggestion of Hal, switch to an output parameter that tracks which elements of the build vector are in fact undef.
This should make actually inpsecting them (likely in my next patch) reasonably pretty. Also makes the output parameter optional as it is clear now that *most* users are happy with undefs in their splats.
llvm-svn: 212581
show more ...
|
#
b844e72e |
| 08-Jul-2014 |
Chandler Carruth <chandlerc@gmail.com> |
[SDAG] Build up a more rich set of APIs for querying build-vector SDAG nodes about whether they are splats. This is factored out and improved from r212324 which got reverted as it was far too aggress
[SDAG] Build up a more rich set of APIs for querying build-vector SDAG nodes about whether they are splats. This is factored out and improved from r212324 which got reverted as it was far too aggressive. The new API should help more conservatively handle buildvectors that are a mixture of splatted and undef values.
No functionality change at this point. The hope is to slowly re-introduce the undef-tolerant optimization of splats, but each time being forced to make a concious decision about how to handle the undefs in a way that doesn't lead to contradicting assumptions about the collapsed value.
Hal has pointed out in discussions that this may not end up being the desired API and instead it may be more convenient to get a mask of the undef elements or something similar. I'm starting simple and will expand the API as I adapt actual callers and see exactly what they need.
llvm-svn: 212514
show more ...
|
#
beeacac0 |
| 07-Jul-2014 |
Chandler Carruth <chandlerc@gmail.com> |
[x86] Revert r212324 which was too aggressive w.r.t. allowing undef lanes in vector splats.
The core problem here is that undef lanes can't *unilaterally* be considered to contribute to splats. Thei
[x86] Revert r212324 which was too aggressive w.r.t. allowing undef lanes in vector splats.
The core problem here is that undef lanes can't *unilaterally* be considered to contribute to splats. Their handling needs to be more cautious. There is also a reported failure of the nightly testers (thanks Tobias!) that may well stem from the same core issue. I'm going to fix this theoretical issue, factor the APIs a bit better, and then verify that I don't see anything bad with Tobias's reduction from the test suite before recommitting.
Original commit message for r212324: [x86] Generalize BuildVectorSDNode::getConstantSplatValue to work for any constant, constant FP, or undef splat and to tolerate any undef lanes in a splat, then replace all uses of isSplatVector in X86's lowering with it.
This fixes issues where undef lanes in an otherwise splat vector would prevent the splat logic from firing. It is a touch more awkward to use this interface, but it is much more accurate. Suggestions for better interface structuring welcome.
With this fix, the code generated with the widening legalization strategy for widen_cast-4.ll is *dramatically* improved as the special lowering strategies for a v16i8 SRA kick in even though the high lanes are undef.
We also get a slightly different choice for broadcasting an aligned memory location, and use vpshufd instead of vbroadcastss. This looks like a minor win for pipelining and domain crossing, but a minor loss for the number of micro-ops. I suspect its a wash, but folks can easily tweak the lowering if they want.
llvm-svn: 212475
show more ...
|
#
5d79bb5d |
| 04-Jul-2014 |
Chandler Carruth <chandlerc@gmail.com> |
[x86] Generalize BuildVectorSDNode::getConstantSplatValue to work for any constant, constant FP, or undef splat and to tolerate any undef lanes in a splat, then replace all uses of isSplatVector in X
[x86] Generalize BuildVectorSDNode::getConstantSplatValue to work for any constant, constant FP, or undef splat and to tolerate any undef lanes in a splat, then replace all uses of isSplatVector in X86's lowering with it.
This fixes issues where undef lanes in an otherwise splat vector would prevent the splat logic from firing. It is a touch more awkward to use this interface, but it is much more accurate. Suggestions for better interface structuring welcome.
With this fix, the code generated with the widening legalization strategy for widen_cast-4.ll is *dramatically* improved as the special lowering strategies for a v16i8 SRA kick in even though the high lanes are undef.
We also get a slightly different choice for broadcasting an aligned memory location, and use vpshufd instead of vbroadcastss. This looks like a minor win for pipelining and domain crossing, but a minor loss for the number of micro-ops. I suspect its a wash, but folks can easily tweak the lowering if they want.
llvm-svn: 212324
show more ...
|
#
872d5923 |
| 04-Jul-2014 |
Chandler Carruth <chandlerc@gmail.com> |
Add an explicit bool operator to SDValue to make it easier to test for a non-null node. In particular, this makes it easier to use condition variables with SDValues, etc.
llvm-svn: 212323
|
#
66e588be |
| 29-Jun-2014 |
Craig Topper <craig.topper@gmail.com> |
Add ops() method to SDNode that returns an ArrayRef<SDUse>. Use it to simplify some code.
llvm-svn: 211993
|
#
420a2168 |
| 13-Jun-2014 |
Tim Northover <tnorthover@apple.com> |
IR: add "cmpxchg weak" variant to support permitted failure.
This commit adds a weak variant of the cmpxchg operation, as described in C++11. A cmpxchg instruction with this modifier is permitted to
IR: add "cmpxchg weak" variant to support permitted failure.
This commit adds a weak variant of the cmpxchg operation, as described in C++11. A cmpxchg instruction with this modifier is permitted to fail to store, even if the comparison indicated it should.
As a result, cmpxchg instructions must return a flag indicating success in addition to their original iN value loaded. Thus, for uniformity *all* cmpxchg instructions now return "{ iN, i1 }". The second flag is 1 when the store succeeded.
At the DAG level, a new ATOMIC_CMP_SWAP_WITH_SUCCESS node has been added as the natural representation for the new cmpxchg instructions. It is a strong cmpxchg.
By default this gets Expanded to the existing ATOMIC_CMP_SWAP during Legalization, so existing backends should see no change in behaviour. If they wish to deal with the enhanced node instead, they can call setOperationAction on it. Beware: as a node with 2 results, it cannot be selected from TableGen.
Currently, no use is made of the extra information provided in this patch. Test updates are almost entirely adapting the input IR to the new scheme.
Summary for out of tree users: ------------------------------
+ Legacy Bitcode files are upgraded during read. + Legacy assembly IR files will be invalid. + Front-ends must adapt to different type for "cmpxchg". + Backends should be unaffected by default.
llvm-svn: 210903
show more ...
|
#
4db1abea |
| 09-Jun-2014 |
Andrea Di Biagio <Andrea_DiBiagio@sn.scee.net> |
[DAG] Expose NoSignedWrap, NoUnsignedWrap and Exact flags to SelectionDAG.
This patch modifies SelectionDAGBuilder to construct SDNodes with associated NoSignedWrap, NoUnsignedWrap and Exact flags c
[DAG] Expose NoSignedWrap, NoUnsignedWrap and Exact flags to SelectionDAG.
This patch modifies SelectionDAGBuilder to construct SDNodes with associated NoSignedWrap, NoUnsignedWrap and Exact flags coming from IR BinaryOperator instructions.
Added a new SDNode type called 'BinaryWithFlagsSDNode' to allow accessing nsw/nuw/exact flags during codegen.
Patch by Marcello Maggioni.
llvm-svn: 210467
show more ...
|