[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
Wed Aug 29 15:22:04 PDT 2018


davidxl added inline comments.


================
Comment at: test/Transforms/InstCombine/select_meta.ll:197
 
-; The compare should change, but the metadata remains the same because the select operands are not swapped.
+; FIXME: Should we preserve the metadata here when we push the not through?
 define i32 @smin1(i32 %x) {
----------------
spatel wrote:
> cc @davidxl 
> This is the same compare that we started with, so I think branch weight metadata should transfer as-is.
> If we drop metadata in this patch, it's possible we could see perf regressions, so we should try to get this right.
correct, the profile data should not change and be transferred as is.


https://reviews.llvm.org/D51398





More information about the llvm-commits mailing list