[PATCH] D98288: [DSE] Translate killing locations through phis.

Alina Sbirlea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 6 15:59:33 PDT 2021


asbirlea added a comment.

I'm seeing a crash with this. Repro: `opt -passes=dse` on:

  %"struct.type" = type <{ i8 }>
  
  ; Function Attrs: noreturn
  define void @f() {
  entry:
    br label %while.cond
  
  while.cond:                                       ; preds = %exit, %entry
    br i1 undef, label %if.end.i, label %if.then.i
  
  if.then.i:                                        ; preds = %while.cond
    br label %exit
  
  if.end.i:                                         ; preds = %while.cond
    store i8* undef, i8** inttoptr (i64 16 to i8**), align 16
    %.cast1.i = bitcast i8* undef to %"struct.type"*
    %IsMemberPointer.i.i = getelementptr inbounds %"struct.type", %"struct.type"* %.cast1.i, i64 0, i32 0
    store i8 0, i8* %IsMemberPointer.i.i, align 4
    br label %exit
  
  exit: ; preds = %if.end.i, %if.then.i
    %retval.0.i = phi %"struct.type"* [ undef, %if.then.i ], [ %.cast1.i, %if.end.i ]
    %IsMemberPointer = getelementptr inbounds %"struct.type", %"struct.type"* %retval.0.i, i64 0, i32 0
    store i8 1, i8* %IsMemberPointer, align 4
    br label %while.cond
  }



================
Comment at: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1886
 
     MemoryAccess *Current = KillingDef;
     LLVM_DEBUG(dbgs() << "Trying to eliminate MemoryDefs killed by "
----------------
`Current` unused in release builds.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98288/new/

https://reviews.llvm.org/D98288



More information about the llvm-commits mailing list