summaryrefslogtreecommitdiff
path: root/lib/Target/ARM/ARMISelLowering.h
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2012-12-11 23:26:14 +0000
committerEvan Cheng <evan.cheng@apple.com>2012-12-11 23:26:14 +0000
commite07f85eb76a0254d3adbdf8b5d61ff5c07858cef (patch)
tree373200035521581fe63234d1b69ec1245637a85c /lib/Target/ARM/ARMISelLowering.h
parent76a130b3617a6bd411359092dfd8d287f15c36e6 (diff)
downloadllvm-e07f85eb76a0254d3adbdf8b5d61ff5c07858cef.tar.gz
llvm-e07f85eb76a0254d3adbdf8b5d61ff5c07858cef.tar.bz2
llvm-e07f85eb76a0254d3adbdf8b5d61ff5c07858cef.tar.xz
Replace TargetLowering::isIntImmLegal() with
ScalarTargetTransformInfo::getIntImmCost() instead. "Legal" is a poorly defined term for something like integer immediate materialization. It is always possible to materialize an integer immediate. Whether to use it for memcpy expansion is more a "cost" conceern. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169929 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMISelLowering.h')
-rw-r--r--lib/Target/ARM/ARMISelLowering.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/Target/ARM/ARMISelLowering.h b/lib/Target/ARM/ARMISelLowering.h
index 5cf40236c5..5a44201ec4 100644
--- a/lib/Target/ARM/ARMISelLowering.h
+++ b/lib/Target/ARM/ARMISelLowering.h
@@ -22,6 +22,7 @@
#include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/Target/TargetLowering.h"
#include "llvm/Target/TargetRegisterInfo.h"
+#include "llvm/Target/TargetTransformImpl.h"
#include <vector>
namespace llvm {
@@ -387,8 +388,6 @@ namespace llvm {
/// materialize the FP immediate as a load from a constant pool.
virtual bool isFPImmLegal(const APFloat &Imm, EVT VT) const;
- virtual bool isIntImmLegal(const APInt &Imm, EVT VT) const;
-
virtual bool getTgtMemIntrinsic(IntrinsicInfo &Info,
const CallInst &I,
unsigned Intrinsic) const;
@@ -575,6 +574,16 @@ namespace llvm {
FastISel *createFastISel(FunctionLoweringInfo &funcInfo,
const TargetLibraryInfo *libInfo);
}
+
+ class ARMScalarTargetTransformImpl : public ScalarTargetTransformImpl {
+ const ARMSubtarget *Subtarget;
+ public:
+ explicit ARMScalarTargetTransformImpl(const TargetLowering *TL) :
+ ScalarTargetTransformImpl(TL),
+ Subtarget(&TL->getTargetMachine().getSubtarget<ARMSubtarget>()) {};
+
+ virtual unsigned getIntImmCost(const APInt &Imm, Type *Ty) const;
+ };
}
#endif // ARMISELLOWERING_H