mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
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
This commit is contained in:
@ -231,6 +231,7 @@ public:
|
||||
//
|
||||
SDValue getConstant(uint64_t Val, MVT VT, bool isTarget = false);
|
||||
SDValue getConstant(const APInt &Val, MVT VT, bool isTarget = false);
|
||||
SDValue getConstant(const ConstantInt &Val, MVT VT, bool isTarget = false);
|
||||
SDValue getIntPtrConstant(uint64_t Val, bool isTarget = false);
|
||||
SDValue getTargetConstant(uint64_t Val, MVT VT) {
|
||||
return getConstant(Val, VT, true);
|
||||
@ -238,14 +239,21 @@ public:
|
||||
SDValue getTargetConstant(const APInt &Val, MVT VT) {
|
||||
return getConstant(Val, VT, true);
|
||||
}
|
||||
SDValue getTargetConstant(const ConstantInt &Val, MVT VT) {
|
||||
return getConstant(Val, VT, true);
|
||||
}
|
||||
SDValue getConstantFP(double Val, MVT VT, bool isTarget = false);
|
||||
SDValue getConstantFP(const APFloat& Val, MVT VT, bool isTarget = false);
|
||||
SDValue getConstantFP(const ConstantFP &CF, MVT VT, bool isTarget = false);
|
||||
SDValue getTargetConstantFP(double Val, MVT VT) {
|
||||
return getConstantFP(Val, VT, true);
|
||||
}
|
||||
SDValue getTargetConstantFP(const APFloat& Val, MVT VT) {
|
||||
return getConstantFP(Val, VT, true);
|
||||
}
|
||||
SDValue getTargetConstantFP(const ConstantFP &Val, MVT VT) {
|
||||
return getConstantFP(Val, VT, true);
|
||||
}
|
||||
SDValue getGlobalAddress(const GlobalValue *GV, MVT VT,
|
||||
int offset = 0, bool isTargetGA = false);
|
||||
SDValue getTargetGlobalAddress(const GlobalValue *GV, MVT VT,
|
||||
|
Reference in New Issue
Block a user