summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNadav Rotem <nrotem@apple.com>2012-12-23 17:31:23 +0000
committerNadav Rotem <nrotem@apple.com>2012-12-23 17:31:23 +0000
commit6f3d81a92919954d156c863d3aeb4ff09f701480 (patch)
treea0bcf58e9f4f3578a1b39cec0832bef2f55d677e /include
parenta1acf55738a9d6c0376c7d36b27897817685e157 (diff)
downloadllvm-6f3d81a92919954d156c863d3aeb4ff09f701480.tar.gz
llvm-6f3d81a92919954d156c863d3aeb4ff09f701480.tar.bz2
llvm-6f3d81a92919954d156c863d3aeb4ff09f701480.tar.xz
CostModel: Change the default target-independent implementation for finding
the cost of arithmetic functions. We now assume that the cost of arithmetic operations that are marked as Legal or Promote is low, but ops that are marked as custom are higher. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171002 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Target/TargetLowering.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h
index 46d860c3c2..3a7053f288 100644
--- a/include/llvm/Target/TargetLowering.h
+++ b/include/llvm/Target/TargetLowering.h
@@ -413,6 +413,15 @@ public:
getOperationAction(Op, VT) == Custom);
}
+ /// isOperationLegalOrPromote - Return true if the specified operation is
+ /// legal on this target or can be made legal using promotion. This
+ /// is used to help guide high-level lowering decisions.
+ bool isOperationLegalOrPromote(unsigned Op, EVT VT) const {
+ return (VT == MVT::Other || isTypeLegal(VT)) &&
+ (getOperationAction(Op, VT) == Legal ||
+ getOperationAction(Op, VT) == Promote);
+ }
+
/// isOperationExpand - Return true if the specified operation is illegal on
/// this target or unlikely to be made legal with custom lowering. This is
/// used to help guide high-level lowering decisions.