llvm-project/llvm/lib/Transforms
Vedant Kumar 60f54084bf [Debug] Add dbg.value intrinsics for PHIs created during LCSSA.
This patch is an enhancement to propagate dbg.value information when
Phis are created on behalf of LCSSA.  I noticed a case where a value
carried across a loop was reported as <optimized out>.

Specifically this case:

  int bar(int x, int y) {
    return x + y;
  }

  int foo(int size) {
    int val = 0;
    for (int i = 0; i < size; ++i) {
      val = bar(val, i);  // Both val and i are correct
    }
    return val; // <optimized out>
  }

In the above case, after all of the interesting computation completes
our value is reported as "optimized out." This change will add a
dbg.value to correct this.

This patch also moves the dbg.value insertion routine from
LoopRotation.cpp into Local.cpp, so that we can share it in both places
(LoopRotation and LCSSA).

Patch by Matt Davis!

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

llvm-svn: 323472
2018-01-25 21:37:07 +00:00
..
AggressiveInstCombine Another try to commit 323321 (aggressive instruction combine). 2018-01-25 12:06:32 +00:00
Coroutines Make internal/private GVs implicitly dso_local. 2018-01-11 22:15:05 +00:00
Hello Add auto-exporting of symbols from tools so that plugins work on Windows 2016-05-26 11:16:43 +00:00
IPO Re-land "[ThinLTO] Add call edges' relative block frequency to per-module summary." 2018-01-25 19:27:17 +00:00
InstCombine [InstCombine] narrow masked zexted binops (PR35792) 2018-01-25 16:34:36 +00:00
Instrumentation [asan] Fix kernel callback naming in instrumentation module. 2018-01-25 21:28:51 +00:00
ObjCARC [ObjCARC] Do not turn a call to @objc_autoreleaseReturnValue into a call 2018-01-19 23:51:13 +00:00
Scalar [Debug] Add a utility to propagate dbg.value to new PHIs, NFC 2018-01-25 21:37:05 +00:00
Utils [Debug] Add dbg.value intrinsics for PHIs created during LCSSA. 2018-01-25 21:37:07 +00:00
Vectorize Revert "[SLP] Fix for PR32086: Count InsertElementInstr of the same elements as shuffle." 2018-01-25 17:28:12 +00:00
CMakeLists.txt Another try to commit 323321 (aggressive instruction combine). 2018-01-25 12:06:32 +00:00
LLVMBuild.txt Another try to commit 323321 (aggressive instruction combine). 2018-01-25 12:06:32 +00:00