[llvm] [InstCombine] Fold negation of unsigned div of non-negatives (PR #84951)

Antonio Frighetto via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 13 08:17:37 PDT 2024


================
@@ -2062,6 +2062,26 @@ static Instruction *foldSubOfMinMax(BinaryOperator &I,
   return nullptr;
 }
 
+/// Fold `sub 0, (udiv nneg X, nneg C)` into `sdiv nneg X, -C`
----------------
antoniofrighetto wrote:

If I'm not wrong, the second example should make sense if RHS is not a constant.

https://github.com/llvm/llvm-project/pull/84951


More information about the llvm-commits mailing list