mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-09-28 06:58:19 +00:00
change some vectors to smallvectors. This speeds up instcombine on 447.dealII
by 5%. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34332 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b3ff6b7539
commit
72588fc3f4
@ -7748,9 +7748,9 @@ Instruction *InstCombiner::visitGetElementPtrInst(GetElementPtrInst &GEP) {
|
|||||||
// is a getelementptr instruction, combine the indices of the two
|
// is a getelementptr instruction, combine the indices of the two
|
||||||
// getelementptr instructions into a single instruction.
|
// getelementptr instructions into a single instruction.
|
||||||
//
|
//
|
||||||
std::vector<Value*> SrcGEPOperands;
|
SmallVector<Value*, 8> SrcGEPOperands;
|
||||||
if (User *Src = dyn_castGetElementPtr(PtrOp))
|
if (User *Src = dyn_castGetElementPtr(PtrOp))
|
||||||
SrcGEPOperands.assign(Src->op_begin(), Src->op_end());
|
SrcGEPOperands.append(Src->op_begin(), Src->op_end());
|
||||||
|
|
||||||
if (!SrcGEPOperands.empty()) {
|
if (!SrcGEPOperands.empty()) {
|
||||||
// Note that if our source is a gep chain itself that we wait for that
|
// Note that if our source is a gep chain itself that we wait for that
|
||||||
@ -7761,7 +7761,7 @@ Instruction *InstCombiner::visitGetElementPtrInst(GetElementPtrInst &GEP) {
|
|||||||
cast<Instruction>(SrcGEPOperands[0])->getNumOperands() == 2)
|
cast<Instruction>(SrcGEPOperands[0])->getNumOperands() == 2)
|
||||||
return 0; // Wait until our source is folded to completion.
|
return 0; // Wait until our source is folded to completion.
|
||||||
|
|
||||||
std::vector<Value *> Indices;
|
SmallVector<Value*, 8> Indices;
|
||||||
|
|
||||||
// Find out whether the last index in the source GEP is a sequential idx.
|
// Find out whether the last index in the source GEP is a sequential idx.
|
||||||
bool EndsWithSequential = false;
|
bool EndsWithSequential = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user