diff options
author | Nadav Rotem <nrotem@apple.com> | 2012-09-02 12:10:19 +0000 |
---|---|---|
committer | Nadav Rotem <nrotem@apple.com> | 2012-09-02 12:10:19 +0000 |
commit | 9f40cb32ac31283f8636d516e7b10f3ad921955c (patch) | |
tree | 975488b92abdc8d73e2313554cff5e927e5f48f7 /include | |
parent | 7de7078933292b0487f1f39f539bece922e3dde5 (diff) | |
download | external_llvm-9f40cb32ac31283f8636d516e7b10f3ad921955c.zip external_llvm-9f40cb32ac31283f8636d516e7b10f3ad921955c.tar.gz external_llvm-9f40cb32ac31283f8636d516e7b10f3ad921955c.tar.bz2 |
Not all targets have efficient ISel code generation for select instructions.
For example, the ARM target does not have efficient ISel handling for vector
selects with scalar conditions. This patch adds a TLI hook which allows the
different targets to report which selects are supported well and which selects
should be converted to CF duting codegen prepare.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163093 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Target/TargetLowering.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h index acf0419..b8c070b 100644 --- a/include/llvm/Target/TargetLowering.h +++ b/include/llvm/Target/TargetLowering.h @@ -107,6 +107,14 @@ public: ZeroOrNegativeOneBooleanContent // All bits equal to bit 0. }; + enum SelectSupportKind { + ScalarValSelect, // The target supports scalar selects (ex: cmov). + ScalarCondVectorVal, // The target supports selects with a scalar condition + // and vector values (ex: cmov). + VectorMaskSelect // The target supports vector selects with a vector + // mask (ex: x86 blends). + }; + static ISD::NodeType getExtendForContent(BooleanContent Content) { switch (Content) { case UndefinedBooleanContent: @@ -140,6 +148,8 @@ public: /// this target. bool isSelectExpensive() const { return SelectIsExpensive; } + virtual bool isSelectSupported(SelectSupportKind kind) const { return true; } + /// isIntDivCheap() - Return true if integer divide is usually cheaper than /// a sequence of several shifts, adds, and multiplies for this target. bool isIntDivCheap() const { return IntDivIsCheap; } |