[PATCH] D108837: [SimplifyCFG] Ignore free instructions when computing cost for folding branch to common dest

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 16 11:21:38 PDT 2021


aeubanks added a comment.

some tests are crashing in `CloneInstructionsIntoPredecessorBlockAndUpdateSSAUses()`, reduced to running simplifycfg on

  define i32 @test(i32 %len) local_unnamed_addr {
  entry:
    br i1 undef, label %for.cond.preheader, label %if.end
  
  for.cond.preheader:                               ; preds = %entry
    %0 = bitcast [1 x i64]* undef to i8*
    %cmp15 = icmp slt i32 1, %len
    br i1 %cmp15, label %for.body.lr.ph, label %if.end.loopexit
  
  for.body.lr.ph:                                   ; preds = %for.cond.preheader
    br label %for.body
  
  for.body:                                         ; preds = %for.body, %for.body.lr.ph
    call void @llvm.lifetime.start.p0i8(i64 8, i8* %0)
    br label %for.body
  
  if.end.loopexit:                                  ; preds = %for.cond.preheader
    br label %if.end
  
  if.end:                                           ; preds = %if.end.loopexit, %entry
    ret i32 0
  }
  
  ; Function Attrs: argmemonly nofree nosync nounwind willreturn
  declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #0
  
  declare void @foo() local_unnamed_addr
  
  ; Function Attrs: argmemonly nofree nosync nounwind willreturn
  declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #0
  
  attributes #0 = { argmemonly nofree nosync nounwind willreturn }

taking a look


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108837



More information about the llvm-commits mailing list