[PATCH] D44919: [LoopUnroll][NFC] Remove redundant canPeel check

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 1 22:28:46 PDT 2018


mkazantsev added a comment.

Hi @iajbar , I've run `opt  -march=hexagon -O3 -S < test.ll` on your example and it worked fine for me. Here is the output I have:

  ; ModuleID = '<stdin>'
  source_filename = "<stdin>"
  target datalayout = "e-m:e-p:32:32:32-a:0-n16:32-i64:64:64-i32:32:32-i16:16:16-i1:8:8-f32:32:32-f64:64:64-v32:32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048:2048:2048"
  target triple = "hexagon"
  
  @g0 = external dso_local local_unnamed_addr global i32, align 4
  
  declare dso_local i64 @f0(i64, i32) local_unnamed_addr #0
  
  declare dso_local i32 @f1(i32, i32) local_unnamed_addr #0
  
  ; Function Attrs: noreturn
  define dso_local void @f2(i16* nocapture readnone %a0, i16* nocapture readnone %a1, i16* nocapture readnone %a2) local_unnamed_addr #1 {
  b0:
    %v6 = tail call i32 @f1(i32 undef, i32 undef)
    %v7 = load i32, i32* @g0, align 4, !tbaa !0
    %v8 = icmp eq i32 %v7, 1
    br i1 %v8, label %b4, label %b3
  
  b3:                                               ; preds = %b0
    %v6.1 = tail call i32 @f1(i32 undef, i32 undef)
    %v7.1 = load i32, i32* @g0, align 4, !tbaa !0
    %v8.1 = icmp eq i32 %v7.1, 1
    br i1 %v8.1, label %b4, label %b3.1
  
  b4:                                               ; preds = %b3.3, %b3.2, %b3.1, %b3, %b0
    %v14 = tail call i64 @f0(i64 undef, i32 0)
    unreachable
  
  b3.1:                                             ; preds = %b3
    %v6.2 = tail call i32 @f1(i32 undef, i32 undef)
    %v7.2 = load i32, i32* @g0, align 4, !tbaa !0
    %v8.2 = icmp eq i32 %v7.2, 1
    br i1 %v8.2, label %b4, label %b3.2
  
  b3.2:                                             ; preds = %b3.1
    %v6.3 = tail call i32 @f1(i32 undef, i32 undef)
    %v7.3 = load i32, i32* @g0, align 4, !tbaa !0
    %v8.3 = icmp eq i32 %v7.3, 1
    br i1 %v8.3, label %b4, label %b3.3
  
  b3.3:                                             ; preds = %b3.2
    %v6.4 = tail call i32 @f1(i32 undef, i32 undef)
    br label %b4
  }
  
  attributes #0 = { "target-cpu"="hexagonv60" "target-features"="+hvx-length64b,+hvxv60" }
  attributes #1 = { noreturn "target-cpu"="hexagonv60" "target-features"="+hvx-length64b,+hvxv60" }
  
  !0 = !{!1, !1, i64 0}
  !1 = !{!"int", !2, i64 0}
  !2 = !{!"omnipotent char", !3, i64 0}
  !3 = !{!"Simple C++ TBAA"}

Could you please take look into the stack trace of the failure that you are observing? Maybe `peelLoop` was called from some downstream code, in this case you need to just add a `canPeel` check right before it since the behavior has changed. If it is in upstream code, please double-check that you've given me the right run command and provide stack traces.

Thanks,
Max


Repository:
  rL LLVM

https://reviews.llvm.org/D44919





More information about the llvm-commits mailing list