diff options
author | Louis Gerbarg <lgg@apple.com> | 2014-05-09 17:02:46 +0000 |
---|---|---|
committer | Louis Gerbarg <lgg@apple.com> | 2014-05-09 17:02:46 +0000 |
commit | 1f54b821643b8a246a7a6161847caa177b81ee64 (patch) | |
tree | 2d275bac7376ac552ad31236569d1375c9264fdd /llvm/lib/Transforms/Utils | |
parent | c7c47681f6895ce617501dbec0ffbc39134c0a25 (diff) | |
download | bcm5719-llvm-1f54b821643b8a246a7a6161847caa177b81ee64.tar.gz bcm5719-llvm-1f54b821643b8a246a7a6161847caa177b81ee64.zip |
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
llvm-svn: 208434
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r-- | llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp index cb747f6f51c..bfc7f4ace73 100644 --- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -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: |