Revert 57dd4b03 "[ValueTracking] Allow context-sensitive nullness check for non-pointers"
This caused miscompiles of Chromium (https://crbug.com/1023818). The reduced repro is small enough to fit here: $ cat /tmp/a.c unsigned char f(unsigned char *p) { unsigned char result = 0; for (int shift = 0; shift < 1; ++shift) result |= p[0] << (shift * 8); return result; } $ bin/clang -O2 -S -o - /tmp/a.c | grep -A4 f: f: # @f .cfi_startproc # %bb.0: # %entry xorl %eax, %eax retq That's nicely optimized, but I don't think it's the right result :-) > Same as D60846 but with a fix for the problem encountered there which > was a missing context adjustment in the handling of PHI nodes. > > The test that caused D60846 to be reverted was added in e15ab8f2. > > Reviewers: nikic, nlopes, mkazantsev,spatel, dlrobertson, uabelho, hakzsam > > Subscribers: hiraditya, bollu, llvm-commits > > Tags: #llvm > > Differential Revision: https://reviews.llvm.org/D69571 This reverts commit 57dd4b03.
Showing
- llvm/lib/Analysis/InstructionSimplify.cpp 2 additions, 8 deletionsllvm/lib/Analysis/InstructionSimplify.cpp
- llvm/lib/Analysis/ValueTracking.cpp 5 additions, 4 deletionsllvm/lib/Analysis/ValueTracking.cpp
- llvm/test/Transforms/FunctionAttrs/nonnull.ll 1 addition, 1 deletionllvm/test/Transforms/FunctionAttrs/nonnull.ll
- llvm/test/Transforms/InstCombine/known-non-zero.ll 2 additions, 2 deletionsllvm/test/Transforms/InstCombine/known-non-zero.ll
- llvm/test/Transforms/InstSimplify/known-non-zero.ll 7 additions, 3 deletionsllvm/test/Transforms/InstSimplify/known-non-zero.ll
- llvm/test/Transforms/LICM/hoist-mustexec.ll 3 additions, 1 deletionllvm/test/Transforms/LICM/hoist-mustexec.ll
Loading
Please register or sign in to comment