diff options
author | Dan Gohman <gohman@apple.com> | 2008-09-12 18:08:03 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-09-12 18:08:03 +0000 |
commit | 4fbd796a1251a27e6590765a0a34876f436a0af9 (patch) | |
tree | f45e414877d264b7244d93b7fdcf28bcbd85fc20 /utils | |
parent | 913d3dfac43f29921467f33aa743f28ee1bfc5d1 (diff) | |
download | external_llvm-4fbd796a1251a27e6590765a0a34876f436a0af9.zip external_llvm-4fbd796a1251a27e6590765a0a34876f436a0af9.tar.gz external_llvm-4fbd796a1251a27e6590765a0a34876f436a0af9.tar.bz2 |
Change ConstantSDNode and ConstantFPSDNode to use ConstantInt* and
ConstantFP* instead of APInt and APFloat directly.
This reduces the amount of time to create ConstantSDNode
and ConstantFPSDNode nodes when ConstantInt* and ConstantFP*
respectively are already available, as is the case in
SelectionDAGBuild.cpp. Also, it reduces the amount of time
to legalize constants into constant pools, and the amount of
time to add ConstantFP operands to MachineInstrs, due to
eliminating ConstantInt::get and ConstantFP::get calls.
It increases the amount of work needed to create new constants
in cases where the client doesn't already have a ConstantInt*
or ConstantFP*, such as legalize expanding 64-bit integer constants
to 32-bit constants. And it adds a layer of indirection for the
accessor methods. But these appear to be outweight by the benefits
in most cases.
It will also make it easier to make ConstantSDNode and
ConstantFPNode more consistent with ConstantInt and ConstantFP.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56162 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/TableGen/DAGISelEmitter.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/utils/TableGen/DAGISelEmitter.cpp b/utils/TableGen/DAGISelEmitter.cpp index 3bc7dc2..e4a3f09 100644 --- a/utils/TableGen/DAGISelEmitter.cpp +++ b/utils/TableGen/DAGISelEmitter.cpp @@ -792,9 +792,9 @@ public: assert(N->getExtTypes().size() == 1 && "Multiple types not handled!"); std::string TmpVar = "Tmp" + utostr(ResNo); emitCode("SDValue " + TmpVar + - " = CurDAG->getTargetConstantFP(cast<ConstantFPSDNode>(" + - Val + ")->getValueAPF(), cast<ConstantFPSDNode>(" + Val + - ")->getValueType(0));"); + " = CurDAG->getTargetConstantFP(*cast<ConstantFPSDNode>(" + + Val + ")->getConstantFPValue(), cast<ConstantFPSDNode>(" + + Val + ")->getValueType(0));"); // Add Tmp<ResNo> to VariableMap, so that we don't multiply select this // value if used multiple times by this pattern result. Val = TmpVar; |