mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Add an MCID::Select flag and TII hooks for optimizing selects.
Select instructions pick one of two virtual registers based on a condition, like x86 cmov. On targets like ARM that support predication, selects can sometimes be eliminated by predicating the instruction defining one of the operands. Teach PeepholeOptimizer to recognize select instructions, and ask the target to optimize them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162059 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -420,6 +420,12 @@ public:
|
||||
return hasProperty(MCID::Bitcast, Type);
|
||||
}
|
||||
|
||||
/// isSelect - Return true if this instruction is a select instruction.
|
||||
///
|
||||
bool isSelect(QueryType Type = IgnoreBundle) const {
|
||||
return hasProperty(MCID::Select, Type);
|
||||
}
|
||||
|
||||
/// isNotDuplicable - Return true if this instruction cannot be safely
|
||||
/// duplicated. For example, if the instruction has a unique labels attached
|
||||
/// to it, duplicating it would cause multiple definition errors.
|
||||
|
Reference in New Issue
Block a user