mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 16:24:23 +00:00
Constant folding for insertvalue and extractvalue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51889 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -2305,9 +2305,10 @@ Constant *ConstantExpr::getInsertValueTy(const Type *ReqTy, Constant *Agg,
|
||||
"insertvalue indices invalid!");
|
||||
assert(Agg->getType() == ReqTy &&
|
||||
"insertvalue type invalid!");
|
||||
|
||||
assert(Agg->getType()->isFirstClassType() &&
|
||||
"Non-first-class type for constant InsertValue expression");
|
||||
if (Constant *FC = ConstantFoldInsertValueInstruction(Agg, Val, Idxs, NumIdx))
|
||||
return FC; // Fold a few common cases...
|
||||
// Look up the constant in the table first to ensure uniqueness
|
||||
std::vector<Constant*> ArgVec;
|
||||
ArgVec.push_back(Agg);
|
||||
@ -2336,6 +2337,8 @@ Constant *ConstantExpr::getExtractValueTy(const Type *ReqTy, Constant *Agg,
|
||||
"extractvalue indices invalid!");
|
||||
assert(Agg->getType()->isFirstClassType() &&
|
||||
"Non-first-class type for constant extractvalue expression");
|
||||
if (Constant *FC = ConstantFoldExtractValueInstruction(Agg, Idxs, NumIdx))
|
||||
return FC; // Fold a few common cases...
|
||||
// Look up the constant in the table first to ensure uniqueness
|
||||
std::vector<Constant*> ArgVec;
|
||||
ArgVec.push_back(Agg);
|
||||
|
Reference in New Issue
Block a user