1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
llvm-mirror/lib/Transforms
Mikael Holmen 2e96ed2e60 [SROA] Really remove associated dbg.declare when removing dead alloca
Summary:
There already was code that tried to remove the dbg.declare, but that code
was placed after we had called
 I->replaceAllUsesWith(UndefValue::get(I->getType()));
on the alloca, so when we searched for the relevant dbg.declare, we
couldn't find it.

Now we do the search before we call RAUW so there is a chance to find it.

An existing testcase needed update due to this. Two dbg.declare with undef
were removed and then suddenly one of the two CHECKS failed.

Before this patch we got

  call void @llvm.dbg.declare(metadata i24* undef, metadata !14, metadata !DIExpression(DW_OP_LLVM_fragment, 32, 24)), !dbg !15
  call void @llvm.dbg.declare(metadata %struct.prog_src_register* undef, metadata !14, metadata !DIExpression()), !dbg !15
  call void @llvm.dbg.value(metadata i32 0, metadata !14, metadata !DIExpression(DW_OP_LLVM_fragment, 0, 32)), !dbg !15
  call void @llvm.dbg.value(metadata i32 0, metadata !14, metadata !DIExpression(DW_OP_LLVM_fragment, 32, 24)), !dbg !15

and with it we get

  call void @llvm.dbg.value(metadata i32 0, metadata !14, metadata !DIExpression(DW_OP_LLVM_fragment, 0, 32)), !dbg !15
  call void @llvm.dbg.value(metadata i32 0, metadata !14, metadata !DIExpression(DW_OP_LLVM_fragment, 32, 24)), !dbg !15

However, the CHECKs in the testcase checked things in a silly order, so
they only passed since they found things in the first dbg.declare. Now
we changed the order of the checks and the test passes.

Reviewers: rnk

Reviewed By: rnk

Subscribers: llvm-commits

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

llvm-svn: 313875
2017-09-21 11:14:27 +00:00
..
Coroutines [Analysis] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes. Also affected in files (NFC). 2017-08-31 21:56:16 +00:00
Hello
InstCombine [InstCombine] Teach getDemandedBitsLHSMask to handle constant splat vectors 2017-09-20 23:48:58 +00:00
Instrumentation [MSan] Disable sanitization for __sanitizer_dtor_callback. 2017-09-20 22:53:08 +00:00
IPO Fixed reverted commit rL312318 2017-09-21 10:04:02 +00:00
ObjCARC [ObjCARC] Pass the correct BasicBlock to fix assertion failure. 2017-08-31 18:27:47 +00:00
Scalar [SROA] Really remove associated dbg.declare when removing dead alloca 2017-09-21 11:14:27 +00:00
Utils [SimplifyCFG] don't create a no-op subtract 2017-09-20 22:31:35 +00:00
Vectorize Revert r313771 "[SLP] Vectorize jumbled memory loads." 2017-09-20 18:00:03 +00:00
CMakeLists.txt
LLVMBuild.txt