[PATCH] D102367: [Intrinsics] is_constant intrinsic on undef evaluates to false
Nick Desaulniers via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 12 17:51:23 PDT 2021
nickdesaulniers added inline comments.
================
Comment at: llvm/lib/Analysis/ConstantFolding.cpp:1843-1848
+ if (isa<UndefValue>(Operands[0]))
+ return ConstantInt::getFalse(Ty->getContext());
// We know we have a "Constant" argument. But we want to only
// return true for manifest constants, not those that depend on
// constants with unknowable values, e.g. GlobalValue or BlockAddress.
if (isManifestConstant(Operands[0]))
----------------
nickdesaulniers wrote:
> probably should just update `isManifestConstant`
Ah, no, then InstCombine would fail to fold `i1 @llvm.is.constant.i32(i32 undef)` into `i1 0`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D102367/new/
https://reviews.llvm.org/D102367
More information about the llvm-commits
mailing list