| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Parse reversed smax and umax as smin and umin and express them with negative
or binary-not SCEVs (which are really just subtract under the hood).
Parse 'xor %x, -1' as (-1 - %x).
Remove dead code (ConstantInt::get always returns a ConstantInt).
Don't use getIntegerSCEV(-1, Ty). The first value is an int, then it gets
passed into a uint64_t. Instead, create the -1 directly from
ConstantInt::getAllOnesValue().
llvm-svn: 47360
|
|
|
|
| |
llvm-svn: 47062
|
|
|
|
| |
llvm-svn: 47061
|
|
|
|
|
|
|
|
|
|
| |
variable (with step 1) and m is its final value. Then, the correct trip
count is SMAX(m,n)-n. Previously, we used SMAX(0,m-n), but m-n may
overflow and can't in general be interpreted as signed.
Patch by Nick Lewycky.
llvm-svn: 47007
|
|
|
|
|
|
|
|
| |
to the RHS. This simple change allows to compute loop iteration count
for loops with condition similar to the one in the testcase (which seems
to be quite common).
llvm-svn: 46959
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
arbitrary iteration.
The patch:
1) changes SCEVSDivExpr into SCEVUDivExpr,
2) replaces PartialFact() function with BinomialCoefficient(); the
computations (essentially, the division) in BinomialCoefficient() are
performed with the apprioprate bitwidth necessary to avoid overflow;
unsigned division is used instead of the signed one.
Computations in BinomialCoefficient() require support from the code
generator for APInts. Currently, we use a hack rounding up the
neccessary bitwidth to the nearest power of 2. The hack is easy to turn
off in future.
One remaining issue: we assume the divisor of the binomial coefficient
formula can be computed accurately using 16 bits. It means we can handle
AddRecs of length up to 9. In future, we should use APInts to evaluate
the divisor.
Thanks to Nicholas for cooperation!
llvm-svn: 46955
|
|
|
|
| |
llvm-svn: 46591
|
|
|
|
| |
llvm-svn: 45485
|
|
|
|
| |
llvm-svn: 45418
|
|
|
|
|
|
|
|
| |
Reimplement the xform in Analysis/ConstantFolding.cpp where we can use
targetdata to validate that it is safe. While I'm in there, fix some const
correctness issues and generalize the interface to the "operand folder".
llvm-svn: 44817
|
|
|
|
| |
llvm-svn: 44319
|
|
|
|
| |
llvm-svn: 44295
|
|
|
|
|
|
|
| |
even though the bitcast operand did not have integer type. This fixes
PR1814.
llvm-svn: 44286
|
|
|
|
|
|
| |
bits. Patch from Wojciech Matyjewicz.
llvm-svn: 44268
|
|
|
|
|
|
| |
"setcc" -> "icmp op" in comments. No functionality change.
llvm-svn: 44249
|
|
|
|
| |
llvm-svn: 44248
|
|
|
|
| |
llvm-svn: 44177
|
|
|
|
|
|
|
| |
is disabled in the sense that it will refuse to create one from a UDiv
instruction, until the code is better tested.
llvm-svn: 44163
|
|
|
|
|
|
|
| |
SCEV subclasses to being non-static member functions of the ScalarEvolution
class.
llvm-svn: 43224
|
|
|
|
| |
llvm-svn: 42394
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use APFloat in UpgradeParser and AsmParser.
Change all references to ConstantFP to use the
APFloat interface rather than double. Remove
the ConstantFP double interfaces.
Use APFloat functions for constant folding arithmetic
and comparisons.
(There are still way too many places APFloat is
just a wrapper around host float/double, but we're
getting there.)
llvm-svn: 41747
|
|
|
|
| |
llvm-svn: 41207
|
|
|
|
|
|
| |
condition. Fixes 1597.
llvm-svn: 40867
|
|
|
|
|
|
| |
comparison. Fixes bug 1598.
llvm-svn: 40866
|
|
|
|
|
|
|
|
| |
Always pass the constant as the second parameter to HowManyLessThans.
Remove obsolete "isSigned" parameter.
llvm-svn: 39893
|
|
|
|
|
|
|
| |
use SCEVConstant::get instead of SCEVUnknown::get when constructing a SCEV
for a ConstantInt.
llvm-svn: 38457
|
|
|
|
|
|
|
|
|
| |
deleteValueFromRecords and loosen the types to all it to accept
Value* instead of just Instruction*, since this is what
ScalarEvolution uses internally anyway. This allows more flexibility
for future uses.
llvm-svn: 37657
|
|
|
|
|
|
|
| |
add operands after constant operands. The recent change to recognize
sign-extend expressions caused this to be exposed more often.
llvm-svn: 37628
|
|
|
|
|
|
|
|
|
|
| |
This created an ambiguity for expandInTy to decide when to use
sign-extension or zero-extension, but it turns out that most of its callers
don't actually need a type conversion, now that LLVM types don't have
explicit signedness. Drop expandInTy in favor of plain expand, and change
the few places that actually need a type conversion to do it themselves.
llvm-svn: 37591
|
|
|
|
|
|
|
| |
Secondly, checking whether removal succeeded tells you whether it was in
the map to begin with.
llvm-svn: 37469
|
|
|
|
| |
llvm-svn: 37459
|
|
|
|
| |
llvm-svn: 36662
|
|
|
|
|
|
|
| |
Due to darwin gcc bug, one version of darwin linker coalesces
static const int, which defauts PassID based pass identification.
llvm-svn: 36652
|
|
|
|
| |
llvm-svn: 36648
|
|
|
|
| |
llvm-svn: 36632
|
|
|
|
| |
llvm-svn: 36102
|
|
|
|
|
|
|
| |
Fix a div-by-zero bug noticed by APInt. This fixes:
test/Transforms/IndVarsSimplify/exit_value_tests.llx
llvm-svn: 36099
|
|
|
|
|
|
| |
Transforms/IndVarsSimplify/exit_value_tests.llx
llvm-svn: 36081
|
|
|
|
| |
llvm-svn: 35740
|
|
|
|
|
|
| |
ConstantExpr::getXX if possible.
llvm-svn: 35738
|
|
|
|
| |
llvm-svn: 35737
|
|
|
|
| |
llvm-svn: 35586
|
|
|
|
| |
llvm-svn: 34897
|
|
|
|
| |
llvm-svn: 34831
|
|
|
|
|
|
| |
Constant::isNullValue() in situations where it is possible.
llvm-svn: 34821
|
|
|
|
| |
llvm-svn: 34816
|
|
|
|
| |
llvm-svn: 34795
|
|
|
|
|
|
| |
APInt's of unequal bitwidth.
llvm-svn: 34790
|
|
|
|
|
|
|
|
| |
are not needed as the results are the same with or without it.
Patch by Nicholas Lewycky.
llvm-svn: 34782
|
|
|
|
| |
llvm-svn: 34780
|