[PATCH] D90924: [ConstantRange] Sign-flipping of signedness-invariant comparisons
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 31 12:35:04 PDT 2021
nikic accepted this revision.
nikic added a comment.
This revision is now accepted and ready to land.
LGTM, thanks!
================
Comment at: llvm/include/llvm/IR/ConstantRange.h:146
+ /// return a predicate equivalent to \p Pred, with flipped signedness
+ /// (i.e. unsigned instead of signed or vice versa), and maybe swapped.
+ CmpInst::Predicate
----------------
nit: "maybe inverted" now
Might be worth mentioning that BAD_ICMP_PREDICATE is returned on failure.
================
Comment at: llvm/include/llvm/IR/ConstantRange.h:149
+ getEquivalentPredWithFlippedSignedness(CmpInst::Predicate Pred,
+ const ConstantRange &Other) const;
+
----------------
I find it slightly odd that the other two are static methods but this one is an instance method -- any particular reason for that choice?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D90924/new/
https://reviews.llvm.org/D90924
More information about the llvm-commits
mailing list