File: pr52689-not-all-uses-rebased.ll

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (47 lines) | stat: -rw-r--r-- 2,009 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
; RUN: not --crash opt -passes='consthoist' -S -o - -consthoist-gep=1 -mtriple=x86_64-unknown-linux-gnu < %s 2>&1 | FileCheck %s

; REQUIRES: asserts

; My changes fixed this likely by accident, please update as necessary when
; you work on this:
; XFAIL: *

; Matching assertion strings is not easy as they might differ on different
; platforms. So limit this to x86_64-linux.
; REQUIRES: x86_64-linux

; This is a reproducer for https://github.com/llvm/llvm-project/issues/52689
;
; opt: ../lib/Transforms/Scalar/ConstantHoisting.cpp:919: bool llvm::ConstantHoistingPass::emitBaseConstants(llvm::GlobalVariable *): Assertion `UsesNum == (ReBasesNum + NotRebasedNum) && "Not all uses are rebased"' failed.

; CHECK: UsesNum == (ReBasesNum + NotRebasedNum)
; CHECK-SAME: Not all uses are rebased

@g_77 = external global [5 x i32]

define internal ptr @func_29(i1 %p1, i1 %p2, ptr %p3) {
entry:
  br i1 %p1, label %crit_edge, label %if.else3089

crit_edge:                                        ; preds = %entry
  br label %for.cond1063

for.cond1063:                                     ; preds = %cleanup1660, %crit_edge
  %l_323.sroa.0.0 = phi ptr [ getelementptr inbounds ([5 x i32], ptr @g_77, i32 0, i32 3), %cleanup1660 ], [ null, %crit_edge ]
  %l_323.sroa.2.0 = phi ptr [ getelementptr inbounds ([5 x i32], ptr @g_77, i32 0, i32 3), %cleanup1660 ], [ null, %crit_edge ]
  br i1 %p2, label %cleanup1660.thread, label %cleanup1674

cleanup1660.thread:                               ; preds = %for.cond1063
  br label %cleanup1674

cleanup1660:                                      ; No predecessors!
  br label %for.cond1063

cleanup1674:                                      ; preds = %cleanup1660.thread, %for.cond1063
  store ptr getelementptr inbounds ([5 x i32], ptr @g_77, i32 0, i32 1), ptr %p3, align 1
  ret ptr null

if.else3089:                                      ; preds = %entry
  store ptr getelementptr inbounds ([5 x i32], ptr @g_77, i32 0, i32 1), ptr %p3, align 1
  ret ptr null
}