[PATCH] D92270: [ConstantFold] Fold more operations to poison

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 28 12:15:51 PST 2020


aqjune added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/partally-redundant-left-shift-input-masking-after-truncation-variant-c.ll:113
 ; CHECK-NEXT:    [[TMP2:%.*]] = shl <8 x i32> [[TMP1]], [[T2]]
-; CHECK-NEXT:    [[T5:%.*]] = and <8 x i32> [[TMP2]], <i32 undef, i32 1, i32 2147483647, i32 -1, i32 -1, i32 -1, i32 undef, i32 undef>
 ; CHECK-NEXT:    ret <8 x i32> [[T5]]
----------------
This change is valid.
Take the first element of T5 for example:
Since it is poison, either t1's first element should be poison or t5's shift should overflow (t2[0] >= 32).
t1's first element is non-poison if 0 <= nbits[0] < 32.
Therefore, (0 <= nbits[0] < 32) should imply (t2[0] >= 32).
Since t2[0] = nbits[0] - 64 (using 2's complement), this expression is always true.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92270



More information about the llvm-commits mailing list