[PATCH] [DAGCombiner] Fix wrong folding of AND dag nodes.

Michael Kuperstein michael.m.kuperstein at intel.com
Fri Mar 6 15:16:29 PST 2015


LGTM, thanks for fixing this.


================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:2813
@@ +2812,3 @@
+        // multiple of 'BitWidth'. Otherwise, we could propagate a wrong value.
+        if (SplatBitSize % BitWidth == 0) {
+          Constant = APInt::getAllOnesValue(BitWidth);
----------------
It's a bit of a shame there's no early exit here, but I don't see how that can be done without outlining the entire "fold (and (X (load ([non_ext|any_ext|zero_ext] V))), c) -> (X (load ([non_ext|zero_ext] V)))" combine into a separate function, so I guess we'll have to live with it.

http://reviews.llvm.org/D8085

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list