[llvm] [DAG] visitFREEZE - always allow freezing multiple operands (PR #145939)
Jordan Rupprecht via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 17 08:32:13 PDT 2025
rupprecht wrote:
Full repro: https://godbolt.org/z/zTMxMbn8Y
```llvm
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%struct.bar = type { [10000 x ptr] }
@global = external dso_local global %struct.bar
define i1 @foo(ptr %arg, i1 %arg1) {
bb:
#dbg_value(ptr @global, !4, !DIExpression(), !11)
%load = load atomic i64, ptr null monotonic, align 8, !dbg !11
%icmp = icmp ne ptr %arg, getelementptr inbounds nuw (i8, ptr @global, i64 75736)
%select = select i1 %arg1, i1 %icmp, i1 false
ret i1 %select
}
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3}
!0 = distinct !DICompileUnit(language: DW_LANG_C11, file: !1, producer: "f8cb7987c64dcffb72414a40560055cb717dbf74", isOptimized: true, runtimeVersion: 0, emissionKind: NoDebug, enums: !2, retainedTypes: !2, globals: !2, splitDebugInlining: false, nameTableKind: GNU)
!1 = !DIFile(filename: "x.c", directory: "/proc/self/cwd", checksumkind: CSK_MD5, checksum: "4d7489561b2a8bea5d327644cd302f53")
!2 = !{}
!3 = !{i32 2, !"Debug Info Version", i32 3}
!4 = !DILocalVariable(name: "runtime", arg: 1, scope: !5, file: !7, line: 209, type: !8)
!5 = distinct !DISubprogram(name: "x", scope: !5, file: !1, line: 2, type: !6, scopeLine: 209, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2)
!6 = distinct !DISubroutineType(types: !2)
!7 = !DIFile(filename: "x.h", directory: "/proc/self/cwd", checksumkind: CSK_MD5, checksum: "6be6abfc4cffbc95453a5ca74a2265a6")
!8 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !9, size: 64)
!9 = !DIDerivedType(tag: DW_TAG_typedef, name: "x", file: !7, line: 187, baseType: !10)
!10 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "x", file: !7, line: 61, size: 6033664, elements: !2)
!11 = !DILocation(line: 0, scope: !5)
```
w/ `clang -g -fPIE -mcmodel=medium -O1` ->
```
clang++: /root/llvm-project/llvm/lib/CodeGen/MachineFunction.cpp:1135: llvm::MachineFunction::DebugInstrOperandPair llvm::MachineFunction::salvageCopySSAImpl(llvm::MachineInstr&): Assertion `MRI.hasOneDef(State.first)' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/clang++ -g -o /app/output.s -masm=intel -fno-verbose-asm -S -x ir -fcolor-diagnostics -fno-crash-diagnostics -g -fPIE -mcmodel=medium -O1 <source>
1. Code generation
2. Running pass 'Function Pass Manager' on module '<source>'.
3. Running pass 'X86 DAG->DAG Instruction Selection' on function '@foo'
```
https://github.com/llvm/llvm-project/pull/145939
More information about the llvm-commits
mailing list