[PATCH] D34822: [LVI] Constant-propagate a zero extension of the switch condition value through case edges
Wei Mi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 20 15:46:16 PDT 2017
wmi added a comment.
I think we can find many similar problems.
long g;
void foo(int b) {
int a = b;
g = a;
if (b == 3) {
// assume we have `a = b` here, current LVI should be able to find out `a` equals to 3.
__builtin_printf("%lx\n", a);
}
}
Is there a way to make LVI more context sensitive, so that when we try to get value info for `a` and call LazyValueInfoImpl::solveBlockValueCast for `a = b` to find out the value info for `b`, we know the context is in the branch instead of the entry block? I just throw out the question and I don't know it is possible or not.
https://reviews.llvm.org/D34822
More information about the llvm-commits
mailing list