mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Add ExtractValue instruction to SimplifyCFG's ComputeSpeculationCost
Since ExtractValue is not included in ComputeSpeculationCost CFGs containing ExtractValueInsts cannot be simplified. In particular this interacts with InstCombineCompare's tendency to insert add.with.overflow intrinsics for certain idiomatic math operations, preventing optimization. This patch adds ExtractValue to the ComputeSpeculationCost. Test case included rdar://14853450 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208434 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -213,6 +213,7 @@ static unsigned ComputeSpeculationCost(const User *I) {
|
||||
if (!cast<GEPOperator>(I)->hasAllConstantIndices())
|
||||
return UINT_MAX;
|
||||
return 1;
|
||||
case Instruction::ExtractValue:
|
||||
case Instruction::Load:
|
||||
case Instruction::Add:
|
||||
case Instruction::Sub:
|
||||
|
Reference in New Issue
Block a user