llvm-project/llvm/test/Analysis/ConstantFolding
Nikita Popov 9f6e9cf71b [ConstantFolding] Fold undef for integer intrinsics
This fixes https://bugs.llvm.org/show_bug.cgi?id=40110.

This implements handling of undef operands for integer intrinsics in
ConstantFolding, in particular for the bitcounting intrinsics (ctpop,
cttz, ctlz), the with.overflow intrinsics, the saturating math
intrinsics and the funnel shift intrinsics.

The undef behavior follows what InstSimplify does for the general cas
e of non-constant operands. For the bitcount intrinsics (where
InstSimplify doesn't do undef handling -- there cannot be a combination
of an undef + non-constant operand) I'm using a 0 result if the intrinsic
is defined for zero and undef otherwise.

Differential Revision: https://reviews.llvm.org/D55950

llvm-svn: 350971
2019-01-11 21:18:00 +00:00
..
bitcount.ll [ConstantFolding] Fold undef for integer intrinsics 2019-01-11 21:18:00 +00:00
cast-vector.ll
funnel-shift.ll [ConstantFolding] Fold undef for integer intrinsics 2019-01-11 21:18:00 +00:00
gep-constanfolding-error.ll
gep-zeroinit-vector.ll [ConstantFold] Disallow folding vector geps into bitcasts 2018-06-01 19:34:35 +00:00
gep.ll Prevent Constant Folding From Optimizing inrange GEP 2018-09-11 01:53:36 +00:00
min-max.ll [ConstantFolding] Constant fold minimum and maximum intrinsics 2018-10-19 18:15:32 +00:00
saturating-add-sub.ll [ConstantFolding] Fold undef for integer intrinsics 2019-01-11 21:18:00 +00:00
timeout.ll
vector-undef-elts.ll [InstCombine] remove unnecessary shuffle undef folding 2018-08-29 13:24:34 +00:00
vectorgep-crash.ll [ConstantFolding, InstSimplify] Handle more vector GEPs 2018-03-15 16:00:29 +00:00