[PATCH] D149033: [NFC]Fix 2 logic dead code

vdonaldson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 1 17:32:56 PDT 2023


vdonaldson added a comment.

As noted, it looks like this change is causing compilation of an edge case to hang.

Fortran source:

  x = 1.0
  print*, x ** (-huge(1)-1)
  end

.ll file:

  ; ModuleID = 'FIRModule'
  source_filename = "FIRModule"
  target triple = "x86_64-unknown-linux-gnu"
  
  @_QQcl.2F686F6D652F76646F6E616C64736F6E2F742E66393000 = linkonce constant [23 x i8] c"/home/vdonaldson/t.f90\00"
  @_QQEnvironmentDefaults = constant ptr null
  
  declare ptr @malloc(i64)
  
  declare void @free(ptr)
  
  define void @_QQmain() !dbg !3 {
    %1 = alloca float, i64 1, align 4, !dbg !7
    store float 1.000000e+00, ptr %1, align 4, !dbg !7, !tbaa !8
    %2 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr @_QQcl.2F686F6D652F76646F6E616C64736F6E2F742E66393000, i32 2), !dbg !12
    %3 = load float, ptr %1, align 4, !dbg !13, !tbaa !8
    %4 = call contract float @llvm.powi.f32.i32(float %3, i32 -2147483648), !dbg !13
    %5 = call i1 @_FortranAioOutputReal32(ptr %2, float %4), !dbg !13
    %6 = call i32 @_FortranAioEndIoStatement(ptr %2), !dbg !12
    ret void, !dbg !14
  }
  
  declare ptr @_FortranAioBeginExternalListOutput(i32, ptr, i32)
  
  declare zeroext i1 @_FortranAioOutputReal32(ptr, float)
  
  declare i32 @_FortranAioEndIoStatement(ptr)
  
  ; Function Attrs: nocallback nofree nosync nounwind willreturn
  declare ptr @llvm.stacksave() #0
  
  ; Function Attrs: nocallback nofree nosync nounwind willreturn
  declare void @llvm.stackrestore(ptr) #0
  
  ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
  declare float @llvm.powi.f32.i32(float, i32) #1
  
  attributes #0 = { nocallback nofree nosync nounwind willreturn }
  attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
  
  !llvm.module.flags = !{!0}
  !llvm.dbg.cu = !{!1}
  
  !0 = !{i32 2, !"Debug Info Version", i32 3}
  !1 = distinct !DICompileUnit(language: DW_LANG_Fortran95, file: !2, producer: "Flang", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
  !2 = !DIFile(filename: "t.f90", directory: "/home/vdonaldson")
  !3 = distinct !DISubprogram(name: "_QQmain", linkageName: "_QQmain", scope: !2, file: !2, line: 1, type: !4, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !1)
  !4 = !DISubroutineType(cc: DW_CC_normal, types: !5)
  !5 = !{!6, !6}
  !6 = !DIBasicType(name: "void", encoding: DW_ATE_address)
  !7 = !DILocation(line: 1, column: 1, scope: !3)
  !8 = !{!9, !9, i64 0}
  !9 = !{!"any data access", !10, i64 0}
  !10 = !{!"any access", !11, i64 0}
  !11 = !{!"Flang Type TBAA Root"}
  !12 = !DILocation(line: 2, column: 1, scope: !3)
  !13 = !DILocation(line: 2, column: 9, scope: !3)
  !14 = !DILocation(line: 3, column: 1, scope: !3)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149033



More information about the llvm-commits mailing list