Skip to content

"Instruction does not dominate all uses!" after IRCE pass #63984

@topolarity

Description

@topolarity
; ModuleID = 'bugpoint-reduced-simplified.bc'
source_filename = "_generic_matvecmul!"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128-ni:10:11:12:13"
target triple = "x86_64-pc-linux-gnu"

define swiftcc void @"julia__generic_matvecmul!_1420"() #0 {
top:
  br label %L1618

L1618:                                            ; preds = %top
  %0 = icmp slt i64 undef, 1
  br i1 %0, label %L1843, label %L1634.preheader

L1634.preheader:                                  ; preds = %L1618
  br label %L1634

L1634:                                            ; preds = %L1830, %L1634.preheader
  %value_phi590 = phi i64 [ %5, %L1830 ], [ 1, %L1634.preheader ]
  %1 = add i64 %value_phi590, -1
  %.not1038 = icmp ult i64 %1, undef
  br i1 %.not1038, label %L1655, label %L1652

L1652:                                            ; preds = %L1634
  unreachable

L1655:                                            ; preds = %L1634
  %2 = call token (...) @llvm.julia.gc_preserve_begin({} addrspace(10)* nonnull undef)
  %3 = call token (...) @llvm.julia.gc_preserve_begin({} addrspace(10)* nonnull undef)
  %4 = call token (...) @llvm.julia.gc_preserve_begin({} addrspace(10)* nonnull undef)
  br label %pass625

L1711:                                            ; preds = %pass625
  call void @llvm.julia.gc_preserve_end(token %4)
  unreachable

L1714:                                            ; preds = %pass625
  br label %L1830

L1830:                                            ; preds = %L1714
  %.not1049.not = icmp eq i64 %value_phi590, undef
  %5 = add i64 %value_phi590, 1
  br i1 %.not1049.not, label %L1843.loopexit1105, label %L1634

L1843.loopexit1105:                               ; preds = %L1830
  unreachable

L1843:                                            ; preds = %L1618
  ret void

pass625:                                          ; preds = %L1655
  br i1 undef, label %L1711, label %L1714
}

declare token @llvm.julia.gc_preserve_begin(...)

declare void @llvm.julia.gc_preserve_end(token)

attributes #0 = { "probe-stack"="inline-asm" }

!llvm.module.flags = !{!0}

!0 = !{i32 2, !"julia.debug_level", i32 1}

Running with opt-15 --irce test.ll gives the following output:

$ opt-15 test.ll --irce
WARNING: You're attempting to print out a bitcode file.
This is inadvisable as it may cause display problems. If
you REALLY want to taste LLVM bitcode first-hand, you
can force output with the `-f' option.

Instruction does not dominate all uses!
  %6 = call token (...) @llvm.julia.gc_preserve_begin({} addrspace(10)* nonnull undef)
  call void @llvm.julia.gc_preserve_end(token %6)
LLVM ERROR: Broken module found, compilation aborted!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: opt-15 test.ll --irce
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamEi+0x31)[0x7f28a06723b1]
/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1(_ZN4llvm3sys17RunSignalHandlersEv+0xee)[0x7f28a06700fe]
/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1(+0xf048d6)[0x7f28a06728d6]
/lib/x86_64-linux-gnu/libc.so.6(+0x42520)[0x7f289f24b520]
/lib/x86_64-linux-gnu/libc.so.6(pthread_kill+0x12c)[0x7f289f29fa7c]
/lib/x86_64-linux-gnu/libc.so.6(raise+0x16)[0x7f289f24b476]
/lib/x86_64-linux-gnu/libc.so.6(abort+0xd3)[0x7f289f2317f3]
/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1(_ZN4llvm18report_fatal_errorERKNS_5TwineEb+0x1ab)[0x7f28a05a73db]
/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1(+0xe39226)[0x7f28a05a7226]
/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1(+0x10a452c)[0x7f28a081252c]
opt-15(+0x2b4ed)[0x55dec3ff44ed]
/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1(_ZN4llvm11PassManagerINS_6ModuleENS_15AnalysisManagerIS1_JEEEJEE3runERS1_RS3_+0x1a9)[0x7f28a07e30d9]
opt-15(_ZN4llvm15runPassPipelineENS_9StringRefERNS_6ModuleEPNS_13TargetMachineEPNS_21TargetLibraryInfoImplEPNS_14ToolOutputFileES8_S8_S0_NS_8ArrayRefIS0_EENS9_INS_10PassPluginEEENS_8opt_tool10OutputKindENSD_12VerifierKindEbbbbbb+0x45e7)[0x55dec3febf37]
opt-15(main+0x2b64)[0x55dec3ffdc04]
/lib/x86_64-linux-gnu/libc.so.6(+0x29d90)[0x7f289f232d90]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80)[0x7f289f232e40]
opt-15(_start+0x25)[0x55dec3fe4905]

Trunk also fails similarly: https://godbolt.org/z/ns3zff996

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions