[PATCH] D51398: [InstCombine] Fold (min/max ~X, Y) -> ~(max/min X, ~Y) when Y is freely invertible

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 3 23:04:49 PDT 2018


davidxl added a comment.

The meta data update code looks fine to me.



================
Comment at: lib/Transforms/InstCombine/InstCombineSelect.cpp:1825
+      // MIN(~a, C)  -> ~MAX(a, ~C)
+      auto moveNotAfterMinMax = [&](Value *X, Value *Y) -> Instruction * {
+        Value *A;
----------------
Can the  operands_swapped passed as an argument?


https://reviews.llvm.org/D51398





More information about the llvm-commits mailing list