[DAGCombiner] Do not remove the load of stored values when optimizations are disabled
authorKonstantin Zhuravlyov <kzhuravl_dev@outlook.com>
Wed, 12 Oct 2016 13:44:24 +0000 (13:44 +0000)
committerKonstantin Zhuravlyov <kzhuravl_dev@outlook.com>
Wed, 12 Oct 2016 13:44:24 +0000 (13:44 +0000)
commit081385a74e2798f2aec7863cd2afcad343a52a48
treeb7de8a7799ca09aee3fc73c89e9b79681c24d4a4
parentc215c3fd143d11f6fd051b5556b04970f9888381
[DAGCombiner] Do not remove the load of stored values when optimizations are disabled

This combiner breaks debug experience and should not be run when optimizations are disabled.

For example:
  int main() {
    int j = 0;
    j += 2;
    if (j == 2)
      return 0;
    return 5;
  }
When debugging this code compiled in /O0, it should be valid to break at line "j+=2;" and edit the value of j. It should change the return value of the function.

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

llvm-svn: 284014
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/ARM/alloc-no-stack-realign.ll
llvm/test/CodeGen/ARM/dag-combine-ldst.ll [new file with mode: 0644]
llvm/test/CodeGen/SystemZ/swift-return.ll
llvm/test/CodeGen/X86/inline-asm-tied.ll
llvm/test/CodeGen/X86/pr30430.ll