Use ConstantRange::toKnownBits(ConstantRange::makeExactICmpRegion)
to get the constraints on the incoming phi edge instead of bespoke logic.
This covers a lot more cases.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Analysis/ValueTracking.cpp | ||
---|---|---|
1530 | Can this code be reduced to ConstantRange::makeExactICmpRegion() + ConstantRange::toKnownBits()? |
llvm/lib/Analysis/ValueTracking.cpp | ||
---|---|---|
1530 | Convenient :) |
Comment Actions
Just fill in missing cases (TODO) for ugt, uge, sgt, sge,
slt, and sle. These are all in the same spirit as ult/uge, but
each of the other conditions have different constraints.
Update the description?
llvm/lib/Analysis/ValueTracking.cpp | ||
---|---|---|
1470 | I don't quite understand this TODO, but it seems *maybe* you have implemented what it was suggesting? |
llvm/lib/Analysis/ValueTracking.cpp | ||
---|---|---|
1470 | I interpretted it to mean use computeKnownBits on RHS instead of only accepting constant RHS. |
I don't quite understand this TODO, but it seems *maybe* you have implemented what it was suggesting?