mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-19 04:29:21 +00:00
Teach the constant folder how to do select instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12321 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cfdd148972
commit
e97148628f
@ -582,6 +582,17 @@ Constant *llvm::ConstantFoldCastInstruction(const Constant *V,
|
||||
}
|
||||
}
|
||||
|
||||
Constant *llvm::ConstantFoldSelectInstruction(const Constant *Cond,
|
||||
const Constant *V1,
|
||||
const Constant *V2) {
|
||||
if (Cond == ConstantBool::True)
|
||||
return const_cast<Constant*>(V1);
|
||||
else if (Cond == ConstantBool::False)
|
||||
return const_cast<Constant*>(V2);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/// IdxCompare - Compare the two constants as though they were getelementptr
|
||||
/// indices. This allows coersion of the types to be the same thing.
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user