mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-19 04:32:19 +00:00
Add constant folding wrapper support for select instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12319 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6e32372fcd
commit
17fd273512
@ -79,6 +79,10 @@ Constant *llvm::ConstantFoldInstruction(Instruction *I) {
|
||||
default: return 0;
|
||||
case Instruction::Cast:
|
||||
return ConstantExpr::getCast(Op0, I->getType());
|
||||
case Instruction::Select:
|
||||
if (Constant *Op2 = dyn_cast<Constant>(I->getOperand(2)))
|
||||
return ConstantExpr::getSelect(Op0, Op1, Op2);
|
||||
return 0;
|
||||
case Instruction::GetElementPtr:
|
||||
std::vector<Constant*> IdxList;
|
||||
IdxList.reserve(I->getNumOperands()-1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user