aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/MachineOperand.h
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-09-12 18:08:03 +0000
committerDan Gohman <gohman@apple.com>2008-09-12 18:08:03 +0000
commit4fbd796a1251a27e6590765a0a34876f436a0af9 (patch)
treef45e414877d264b7244d93b7fdcf28bcbd85fc20 /include/llvm/CodeGen/MachineOperand.h
parent913d3dfac43f29921467f33aa743f28ee1bfc5d1 (diff)
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 'include/llvm/CodeGen/MachineOperand.h')
-rw-r--r--include/llvm/CodeGen/MachineOperand.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/llvm/CodeGen/MachineOperand.h b/include/llvm/CodeGen/MachineOperand.h
index a6830a5c37..28af8ad01f 100644
--- a/include/llvm/CodeGen/MachineOperand.h
+++ b/include/llvm/CodeGen/MachineOperand.h
@@ -86,7 +86,7 @@ private:
/// Contents union - This contains the payload for the various operand types.
union {
MachineBasicBlock *MBB; // For MO_MachineBasicBlock.
- ConstantFP *CFP; // For MO_FPImmediate.
+ const ConstantFP *CFP; // For MO_FPImmediate.
int64_t ImmVal; // For MO_Immediate.
struct { // For MO_Register.
@@ -252,7 +252,7 @@ public:
return Contents.ImmVal;
}
- ConstantFP *getFPImm() const {
+ const ConstantFP *getFPImm() const {
assert(isFPImmediate() && "Wrong MachineOperand accessor");
return Contents.CFP;
}
@@ -340,7 +340,7 @@ public:
return Op;
}
- static MachineOperand CreateFPImm(ConstantFP *CFP) {
+ static MachineOperand CreateFPImm(const ConstantFP *CFP) {
MachineOperand Op(MachineOperand::MO_FPImmediate);
Op.Contents.CFP = CFP;
return Op;