HomePhabricator

Fix DSE miscompile when store is clobbered across loop iterations

Authored by apilipenko on Feb 21 2020, 2:40 PM.

Description

Fix DSE miscompile when store is clobbered across loop iterations

DSE would mistakenly remove store (2):

a = calloc(n+1)
for (int i = 0; i < n; i++) {
  store 1, a[i+1] // (1)
  store 0, a[i]   // (2)
}

The fix is to do PHI transaltion while looking for clobbering
instructions between the store and the calloc.

Reviewed By: efriedma, bjope

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

Details

Committed
apilipenkoFeb 27 2020, 2:43 PM
Reviewer
efriedma
Differential Revision
D68006: DSE miscompile when store is clobbered across loop iterations
Parents
rG4c2a6567bb12: Avoid ASTContext.h -> TargetInfo.h dep
Branches
Unknown
Tags
Unknown