mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
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
This commit is contained in:
@@ -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; }
|
||||
|
Reference in New Issue
Block a user