[PATCH] D87197: [InstSimplify] Fold degenerate abs of abs form
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Sep 5 19:02:56 PDT 2020
efriedma accepted this revision.
efriedma added a comment.
This revision is now accepted and ready to land.
LGTM
In D87197#2257842 <https://reviews.llvm.org/D87197#2257842>, @nikic wrote:
> In D87197#2257839 <https://reviews.llvm.org/D87197#2257839>, @efriedma wrote:
>
>> It doesn't matter that the constant is 0 specifically, does it? Should work for any constant besides INT_MIN with the correct sign.
>
> I believe this is only valid for 0 specifically, because that's where abs(X) == -abs(X). (Well, and for INT_MIN in the non-poisoning case, as both abs and neg preserve it as well.)
Oh, right, it returns a value with the opposite sign.
> Given the still open correctness issues from https://bugs.llvm.org/show_bug.cgi?id=47322, it seems dangerous to try and generalize it further.
I think it's worth doing something here eventually, but this is fine for now, sure.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87197/new/
https://reviews.llvm.org/D87197
More information about the llvm-commits
mailing list