mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
bf4eac0c1d
We encountered an issue where LTO running on IR that used the DSOLocalEquivalent constant would result in bad codegen. The underlying issue was ValueMapper wasn't properly handling DSOLocalEquivalent, so this just adds the machinery for handling it. This code path is triggered by a fix to DSOLocalEquivalent::handleOperandChangeImpl where DSOLocalEquivalent could potentially not have the same type as its underlying GV. This updates DSOLocalEquivalent::handleOperandChangeImpl to change the type if the GV type changes and handles this constant in ValueMapper. Differential Revision: https://reviews.llvm.org/D97978
35 lines
1014 B
LLVM
35 lines
1014 B
LLVM
; RUN: llvm-link %s %S/Inputs/DSOLocalEquivalent.ll -S | FileCheck %s
|
|
; RUN: llvm-link %S/Inputs/DSOLocalEquivalent.ll %s -S | FileCheck %s
|
|
|
|
declare void @extern_func()
|
|
declare void @defined_extern_func()
|
|
declare hidden void @hidden_func()
|
|
|
|
; CHECK: define void @call_extern_func() {
|
|
; CHECK-NEXT: call void dso_local_equivalent @extern_func()
|
|
; CHECK-NEXT: ret void
|
|
; CHECK-NEXT: }
|
|
define void @call_extern_func() {
|
|
|
|
call void dso_local_equivalent @extern_func()
|
|
ret void
|
|
}
|
|
|
|
; CHECK: define void @call_defined_extern_func() {
|
|
; CHECK-NEXT: call void dso_local_equivalent @defined_extern_func()
|
|
; CHECK-NEXT: ret void
|
|
; CHECK-NEXT: }
|
|
define void @call_defined_extern_func() {
|
|
call void dso_local_equivalent @defined_extern_func()
|
|
ret void
|
|
}
|
|
|
|
; CHECK: define void @call_hidden_func() {
|
|
; CHECK-NEXT: call void dso_local_equivalent @hidden_func()
|
|
; CHECK-NEXT: ret void
|
|
; CHECK-NEXT: }
|
|
define void @call_hidden_func() {
|
|
call void dso_local_equivalent @hidden_func()
|
|
ret void
|
|
}
|