[PATCH] D156499: [InstCombine] Fold abs of known sign operand when source is sub

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 2 09:18:55 PDT 2023


goldstein.w.n added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp:1521
 
+    // abs(x-y) --> y-x where x <= y
+    Value *Y;
----------------
You also do `abs(x-y) --> x - y where x > y`.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156499/new/

https://reviews.llvm.org/D156499



More information about the llvm-commits mailing list