mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
LICM: Hoist insertvalue/extractvalue out of loops.
Fixes PR14854. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171984 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -440,13 +440,12 @@ bool LICM::canSinkOrHoistInst(Instruction &I) {
|
||||
}
|
||||
|
||||
// Only these instructions are hoistable/sinkable.
|
||||
bool HoistableKind = (isa<BinaryOperator>(I) || isa<CastInst>(I) ||
|
||||
isa<SelectInst>(I) || isa<GetElementPtrInst>(I) ||
|
||||
isa<CmpInst>(I) || isa<InsertElementInst>(I) ||
|
||||
isa<ExtractElementInst>(I) ||
|
||||
isa<ShuffleVectorInst>(I));
|
||||
if (!HoistableKind)
|
||||
return false;
|
||||
if (!isa<BinaryOperator>(I) && !isa<CastInst>(I) && !isa<SelectInst>(I) &&
|
||||
!isa<GetElementPtrInst>(I) && !isa<CmpInst>(I) &&
|
||||
!isa<InsertElementInst>(I) && !isa<ExtractElementInst>(I) &&
|
||||
!isa<ShuffleVectorInst>(I) && !isa<ExtractValueInst>(I) &&
|
||||
!isa<InsertValueInst>(I))
|
||||
return false;
|
||||
|
||||
return isSafeToExecuteUnconditionally(I);
|
||||
}
|
||||
|
Reference in New Issue
Block a user