diff options
| author | Hans Wennborg <hans@chromium.org> | 2019-12-09 09:39:31 +0100 |
|---|---|---|
| committer | Hans Wennborg <hans@chromium.org> | 2019-12-09 09:39:31 +0100 |
| commit | a38396939c548f9ad8e94c9baa7198fdb26dedc2 (patch) | |
| tree | 5b6bc79307a3189c8f4019368b19f9fce06a9ec1 /llvm/lib/CodeGen | |
| parent | cafc7416baf7eecef8ecaf05802f2f7c0da725c0 (diff) | |
| download | bcm5719-llvm-a38396939c548f9ad8e94c9baa7198fdb26dedc2.tar.gz bcm5719-llvm-a38396939c548f9ad8e94c9baa7198fdb26dedc2.zip | |
Revert 393dacacf7e7 "[ARM] Enable TypePromotion by default"
This caused "Too many bits for uint64_t" asserts when building Chromium. See
https://crbug.com/1031978#c2 for a reproducer. I'll follow up on the
llvm-commits thread with a creduced version.
> ARMCodeGenPrepare has already been generalized and renamed to
> TypePromotion. We've had it enabled and tested downstream for a
> while, so enable it by default.
>
> Differential Revision: https://reviews.llvm.org/D70998
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/TypePromotion.cpp | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/llvm/lib/CodeGen/TypePromotion.cpp b/llvm/lib/CodeGen/TypePromotion.cpp index 596ad0c4ec2..94fe7d2c703 100644 --- a/llvm/lib/CodeGen/TypePromotion.cpp +++ b/llvm/lib/CodeGen/TypePromotion.cpp @@ -45,7 +45,7 @@ using namespace llvm; static cl::opt<bool> -DisablePromotion("disable-type-promotion", cl::Hidden, cl::init(false), +DisablePromotion("disable-type-promotion", cl::Hidden, cl::init(true), cl::desc("Disable type promotion pass")); // The goal of this pass is to enable more efficient code generation for @@ -899,34 +899,16 @@ bool TypePromotion::TryToPromote(Value *V, unsigned PromotedWidth) { for (auto *I : CurrentVisited) I->dump(); ); - - // Check that promoting this at the IR level is most likely beneficial. It's - // more likely if we're operating over multiple blocks and handling wrapping - // instructions. unsigned ToPromote = 0; - unsigned NonFreeArgs = 0; - SmallPtrSet<BasicBlock*, 4> Blocks; for (auto *V : CurrentVisited) { - if (auto *I = dyn_cast<Instruction>(V)) - Blocks.insert(I->getParent()); - - if (Sources.count(V)) { - if (auto *Arg = dyn_cast<Argument>(V)) { - if (!Arg->hasZExtAttr() && !Arg->hasSExtAttr()) - ++NonFreeArgs; - } + if (Sources.count(V)) continue; - } - if (Sinks.count(cast<Instruction>(V))) continue; - ++ToPromote; } - // DAG optimisations should be able to handle these cases better, especially - // for function arguments. - if (ToPromote < 2 || (Blocks.size() == 1 && (NonFreeArgs > SafeWrap.size()))) + if (ToPromote < 2) return false; Promoter->Mutate(OrigTy, PromotedWidth, CurrentVisited, Sources, Sinks, |

