diff options
author | Justin Lebar <jlebar@google.com> | 2016-10-28 21:43:51 +0000 |
---|---|---|
committer | Justin Lebar <jlebar@google.com> | 2016-10-28 21:43:51 +0000 |
commit | 468bf732096c813a76fbad0ab204b0cf7269f82a (patch) | |
tree | d549b65bdbaa974473d3b84f05ac2edba0b902b1 /llvm/lib/Transforms/Utils | |
parent | d66d37cbd96f3e69d4b764fd02c3d7d4e66ee7c3 (diff) | |
download | bcm5719-llvm-468bf732096c813a76fbad0ab204b0cf7269f82a.tar.gz bcm5719-llvm-468bf732096c813a76fbad0ab204b0cf7269f82a.zip |
Don't claim the udiv created in BypassSlowDivision is exact.
Summary:
In BypassSlowDivision's short-dividend path, we would create e.g.
udiv exact i32 %a, %b
"exact" here means that we are asserting that %a is a multiple of %b.
But we have no reason to believe this must be true -- this is just a
bug, as far as I can tell.
Reviewers: tra
Subscribers: jholewinski, llvm-commits
Differential Revision: https://reviews.llvm.org/D26097
llvm-svn: 285459
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r-- | llvm/lib/Transforms/Utils/BypassSlowDivision.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/BypassSlowDivision.cpp b/llvm/lib/Transforms/Utils/BypassSlowDivision.cpp index 42287d3bb2e..41a854362c9 100644 --- a/llvm/lib/Transforms/Utils/BypassSlowDivision.cpp +++ b/llvm/lib/Transforms/Utils/BypassSlowDivision.cpp @@ -120,8 +120,7 @@ static bool insertFastDiv(Instruction *I, IntegerType *BypassType, BypassType); // udiv/urem because optimization only handles positive numbers - Value *ShortQuotientV = FastBuilder.CreateExactUDiv(ShortDividendV, - ShortDivisorV); + Value *ShortQuotientV = FastBuilder.CreateUDiv(ShortDividendV, ShortDivisorV); Value *ShortRemainderV = FastBuilder.CreateURem(ShortDividendV, ShortDivisorV); Value *FastQuotientV = FastBuilder.CreateCast(Instruction::ZExt, |