Fold float comparisons like x >= y after assume(x > y). This treats fcmp like icmp, which already has this optimization.
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
This looks right. I made some cosmetic changes to this code in the last day (hopefully easier to read), so you'll need to rebase/update.
Please add the new tests with baseline (current) output to D131168. That way, we'll show the diffs in this patch.
It would be good to confirm that everything checks out with Alive2 as well. I don't know of any programmatic way to cycle through the predicates, but you can verify by pasting in the before/after IR for these (and possibly more) tests:
https://alive2.llvm.org/ce/z/5EEWrF
llvm/lib/Analysis/ValueTracking.cpp | ||
---|---|---|
6761 | Shorten: if (auto *LHSCmp = dyn_cast<CmpInst>(LHS)) return isImplied... | |
6784 | Similar to above: use "auto *" here to reduce code. |
Shorten: