diff options
author | Sanjay Patel <spatel@rotateright.com> | 2018-05-15 14:16:24 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2018-05-15 14:16:24 +0000 |
commit | 8652c53d291f26691e359c115d58574ddf742a0b (patch) | |
tree | f2726f60023f82d65065de28025da482c5b5f545 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h | |
parent | 891ebcdbaad113b81511af0cf232908c484d3cc6 (diff) | |
download | bcm5719-llvm-8652c53d291f26691e359c115d58574ddf742a0b.tar.gz bcm5719-llvm-8652c53d291f26691e359c115d58574ddf742a0b.zip |
[DAG] propagate FMF for all FPMathOperators
This is a simple hack based on what's proposed in D37686, but we can extend it if needed in follow-ups.
It gets us most of the FMF functionality that we want without adding any state bits to the flags. It
also intentionally leaves out non-FMF flags (nsw, etc) to minimize the patch.
It should provide a superset of the functionality from D46563 - the extra tests show propagation and
codegen diffs for fcmp, vecreduce, and FP libcalls.
The PPC log2() test shows the limits of this most basic approach - we only applied 'afn' to the last
node created for the call. AFAIK, there aren't any libcall optimizations based on the flags currently,
so that shouldn't make any difference.
Differential Revision: https://reviews.llvm.org/D46854
llvm-svn: 332358
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h index bcea94ec5a4..c5c02bff793 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h @@ -687,6 +687,13 @@ public: SDValue getValue(const Value *V); bool findValue(const Value *V) const; + /// Return the SDNode for the specified IR value if it exists. + SDNode *getNodeForIRValue(const Value *V) { + if (NodeMap.find(V) == NodeMap.end()) + return nullptr; + return NodeMap[V].getNode(); + } + SDValue getNonRegisterValue(const Value *V); SDValue getValueImpl(const Value *V); |