[PATCH] D21613: [DSE] Avoid iterator invalidation bugs by deferring deletion.

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 23 10:31:44 PDT 2016


eli.friedman added a comment.

Oh, I see what you mean about the http://reviews.llvm.org/rL273141 testcase; I thought the stores in the testcase were ordered differently. You run into the issue I was describing if you reorder the last two stores, like this:

  store i32 4, i32* @g_31, align 1, !dbg !20
  %_tmp16.i.i = load volatile i16*, i16** @g_30, align 1, !dbg !28
  %_tmp17.i.i = load i16, i16* %_tmp16.i.i, align 1, !dbg !28
  store i16 %_tmp17.i.i, i16* @g_118, align 1, !dbg !20
  store i16 0, i16* @g_118, align 1, !dbg !43
  store i32 0, i32* @g_31, align 1, !dbg !31

---

The primary point of http://reviews.llvm.org/rL273141 is that DSE shouldn't change behavior based on the presence of debug info... so as long as you're not breaking that invariant, it should be fine to modify/delete the testcase as necessary.


http://reviews.llvm.org/D21613





More information about the llvm-commits mailing list