summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2012-05-05 12:49:14 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2012-05-05 12:49:14 +0000
commite31f31e5c0b335c161a83bbdb0c9f884248b3ab4 (patch)
tree03a92932ea3570ba397516db490386865c3fc4d0 /llvm/include
parenta25a61b9e80eb84da5b823128a5c873bdb5e4201 (diff)
downloadbcm5719-llvm-e31f31e5c0b335c161a83bbdb0c9f884248b3ab4.tar.gz
bcm5719-llvm-e31f31e5c0b335c161a83bbdb0c9f884248b3ab4.zip
Add a new target hook "predictableSelectIsExpensive".
This will be used to determine whether it's profitable to turn a select into a branch when the branch is likely to be predicted. Currently enabled for everything but Atom on X86 and Cortex-A9 devices on ARM. I'm not entirely happy with the name of this flag, suggestions welcome ;) llvm-svn: 156233
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/Target/TargetLowering.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/include/llvm/Target/TargetLowering.h b/llvm/include/llvm/Target/TargetLowering.h
index 78ccb12d90f..29abc191dda 100644
--- a/llvm/include/llvm/Target/TargetLowering.h
+++ b/llvm/include/llvm/Target/TargetLowering.h
@@ -150,6 +150,12 @@ public:
/// that should be avoided.
bool isJumpExpensive() const { return JumpIsExpensive; }
+ /// isPredictableSelectExpensive - Return true if selects are only cheaper
+ /// than branches if the branch is unlikely to be predicted right.
+ bool isPredictableSelectExpensive() const {
+ return predictableSelectIsExpensive;
+ }
+
/// getSetCCResultType - Return the ValueType of the result of SETCC
/// operations. Also used to obtain the target's preferred type for
/// the condition operand of SELECT and BRCOND nodes. In the case of
@@ -2028,6 +2034,10 @@ protected:
/// optimization.
bool benefitFromCodePlacementOpt;
+ /// predictableSelectIsExpensive - Tells the code generator that select is
+ /// more expensive than a branch if the branch is usually predicted right.
+ bool predictableSelectIsExpensive;
+
private:
/// isLegalRC - Return true if the value types that can be represented by the
/// specified register class are all legal.
OpenPOWER on IntegriCloud