Imported Upstream version 5.18.0.167

Former-commit-id: 289509151e0fee68a1b591a20c9f109c3c789d3a
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-10-20 08:25:10 +00:00
parent e19d552987
commit b084638f15
28489 changed files with 184 additions and 3866856 deletions

View File

@ -1,276 +0,0 @@
; RUN: opt -mergefunc -disable-output < %s
; This used to crash.
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32"
target triple = "i386-pc-linux-gnu"
%"struct.kc::impl_Ccode_option" = type { %"struct.kc::impl_abstract_phylum" }
%"struct.kc::impl_CexpressionDQ" = type { %"struct.kc::impl_Ccode_option", %"struct.kc::impl_Ccode_option"*, %"struct.kc::impl_CexpressionDQ"* }
%"struct.kc::impl_Ctext" = type { %"struct.kc::impl_Ccode_option", i32, %"struct.kc::impl_casestring__Str"*, %"struct.kc::impl_Ctext_elem"*, %"struct.kc::impl_Ctext"* }
%"struct.kc::impl_Ctext_elem" = type { %"struct.kc::impl_abstract_phylum", i32, %"struct.kc::impl_casestring__Str"* }
%"struct.kc::impl_ID" = type { %"struct.kc::impl_abstract_phylum", %"struct.kc::impl_Ccode_option"*, %"struct.kc::impl_casestring__Str"*, i32, %"struct.kc::impl_casestring__Str"* }
%"struct.kc::impl_abstract_phylum" = type { i32 (...)** }
%"struct.kc::impl_ac_abstract_declarator_AcAbsdeclDirdecl" = type { %"struct.kc::impl_Ccode_option", %"struct.kc::impl_Ccode_option"*, %"struct.kc::impl_Ccode_option"* }
%"struct.kc::impl_casestring__Str" = type { %"struct.kc::impl_abstract_phylum", i8* }
%"struct.kc::impl_elem_patternrepresentation" = type { %"struct.kc::impl_abstract_phylum", i32, %"struct.kc::impl_casestring__Str"*, %"struct.kc::impl_ID"* }
%"struct.kc::impl_fileline" = type { %"struct.kc::impl_abstract_phylum", %"struct.kc::impl_casestring__Str"*, i32 }
%"struct.kc::impl_fileline_FileLine" = type { %"struct.kc::impl_fileline" }
%"struct.kc::impl_outmostpatterns" = type { %"struct.kc::impl_Ccode_option", %"struct.kc::impl_elem_patternrepresentation"*, %"struct.kc::impl_outmostpatterns"* }
%"struct.kc::impl_withcaseinfo_Withcaseinfo" = type { %"struct.kc::impl_Ccode_option", %"struct.kc::impl_outmostpatterns"*, %"struct.kc::impl_outmostpatterns"*, %"struct.kc::impl_Ctext"* }
@_ZTVN2kc13impl_filelineE = external constant [13 x i32 (...)*], align 32
@.str = external constant [1 x i8], align 1
@_ZTVN2kc22impl_fileline_FileLineE = external constant [13 x i32 (...)*], align 32
define void @_ZN2kc22impl_fileline_FileLineC2EPNS_20impl_casestring__StrEi(%"struct.kc::impl_fileline_FileLine"* %this, %"struct.kc::impl_casestring__Str"* %_file, i32 %_line) align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
%this_addr = alloca %"struct.kc::impl_fileline_FileLine"*, align 4
%_file_addr = alloca %"struct.kc::impl_casestring__Str"*, align 4
%_line_addr = alloca i32, align 4
%save_filt.150 = alloca i32
%save_eptr.149 = alloca i8*
%iftmp.99 = alloca %"struct.kc::impl_casestring__Str"*
%eh_exception = alloca i8*
%eh_selector = alloca i32
%"alloca point" = bitcast i32 0 to i32
store %"struct.kc::impl_fileline_FileLine"* %this, %"struct.kc::impl_fileline_FileLine"** %this_addr
store %"struct.kc::impl_casestring__Str"* %_file, %"struct.kc::impl_casestring__Str"** %_file_addr
store i32 %_line, i32* %_line_addr
%0 = load %"struct.kc::impl_fileline_FileLine"*, %"struct.kc::impl_fileline_FileLine"** %this_addr, align 4
%1 = getelementptr inbounds %"struct.kc::impl_fileline_FileLine", %"struct.kc::impl_fileline_FileLine"* %0, i32 0, i32 0
call void @_ZN2kc13impl_filelineC2Ev() nounwind
%2 = load %"struct.kc::impl_fileline_FileLine"*, %"struct.kc::impl_fileline_FileLine"** %this_addr, align 4
%3 = getelementptr inbounds %"struct.kc::impl_fileline_FileLine", %"struct.kc::impl_fileline_FileLine"* %2, i32 0, i32 0
%4 = getelementptr inbounds %"struct.kc::impl_fileline", %"struct.kc::impl_fileline"* %3, i32 0, i32 0
%5 = getelementptr inbounds %"struct.kc::impl_abstract_phylum", %"struct.kc::impl_abstract_phylum"* %4, i32 0, i32 0
store i32 (...)** getelementptr inbounds ([13 x i32 (...)*], [13 x i32 (...)*]* @_ZTVN2kc22impl_fileline_FileLineE, i32 0, i32 2), i32 (...)*** %5, align 4
%6 = load %"struct.kc::impl_casestring__Str"*, %"struct.kc::impl_casestring__Str"** %_file_addr, align 4
%7 = icmp eq %"struct.kc::impl_casestring__Str"* %6, null
br i1 %7, label %bb, label %bb1
bb: ; preds = %entry
%8 = invoke %"struct.kc::impl_casestring__Str"* @_ZN2kc12mkcasestringEPKci()
to label %invcont unwind label %lpad
invcont: ; preds = %bb
store %"struct.kc::impl_casestring__Str"* %8, %"struct.kc::impl_casestring__Str"** %iftmp.99, align 4
br label %bb2
bb1: ; preds = %entry
%9 = load %"struct.kc::impl_casestring__Str"*, %"struct.kc::impl_casestring__Str"** %_file_addr, align 4
store %"struct.kc::impl_casestring__Str"* %9, %"struct.kc::impl_casestring__Str"** %iftmp.99, align 4
br label %bb2
bb2: ; preds = %bb1, %invcont
%10 = load %"struct.kc::impl_fileline_FileLine"*, %"struct.kc::impl_fileline_FileLine"** %this_addr, align 4
%11 = getelementptr inbounds %"struct.kc::impl_fileline_FileLine", %"struct.kc::impl_fileline_FileLine"* %10, i32 0, i32 0
%12 = getelementptr inbounds %"struct.kc::impl_fileline", %"struct.kc::impl_fileline"* %11, i32 0, i32 1
%13 = load %"struct.kc::impl_casestring__Str"*, %"struct.kc::impl_casestring__Str"** %iftmp.99, align 4
store %"struct.kc::impl_casestring__Str"* %13, %"struct.kc::impl_casestring__Str"** %12, align 4
%14 = load %"struct.kc::impl_fileline_FileLine"*, %"struct.kc::impl_fileline_FileLine"** %this_addr, align 4
%15 = getelementptr inbounds %"struct.kc::impl_fileline_FileLine", %"struct.kc::impl_fileline_FileLine"* %14, i32 0, i32 0
%16 = getelementptr inbounds %"struct.kc::impl_fileline", %"struct.kc::impl_fileline"* %15, i32 0, i32 2
%17 = load i32, i32* %_line_addr, align 4
store i32 %17, i32* %16, align 4
ret void
lpad: ; preds = %bb
%eh_ptr = landingpad { i8*, i32 }
cleanup
%exn = extractvalue { i8*, i32 } %eh_ptr, 0
store i8* %exn, i8** %eh_exception
%eh_ptr4 = load i8*, i8** %eh_exception
%eh_select5 = extractvalue { i8*, i32 } %eh_ptr, 1
store i32 %eh_select5, i32* %eh_selector
%eh_select = load i32, i32* %eh_selector
store i32 %eh_select, i32* %save_filt.150, align 4
%eh_value = load i8*, i8** %eh_exception
store i8* %eh_value, i8** %save_eptr.149, align 4
%18 = load %"struct.kc::impl_fileline_FileLine"*, %"struct.kc::impl_fileline_FileLine"** %this_addr, align 4
%19 = bitcast %"struct.kc::impl_fileline_FileLine"* %18 to %"struct.kc::impl_fileline"*
call void @_ZN2kc13impl_filelineD2Ev(%"struct.kc::impl_fileline"* %19) nounwind
%20 = load i8*, i8** %save_eptr.149, align 4
store i8* %20, i8** %eh_exception, align 4
%21 = load i32, i32* %save_filt.150, align 4
store i32 %21, i32* %eh_selector, align 4
%eh_ptr6 = load i8*, i8** %eh_exception
call void @_Unwind_Resume_or_Rethrow()
unreachable
}
declare void @_ZN2kc13impl_filelineC2Ev() nounwind align 2
define void @_ZN2kc13impl_filelineD1Ev(%"struct.kc::impl_fileline"* %this) nounwind align 2 {
entry:
%this_addr = alloca %"struct.kc::impl_fileline"*, align 4
%"alloca point" = bitcast i32 0 to i32
store %"struct.kc::impl_fileline"* %this, %"struct.kc::impl_fileline"** %this_addr
%0 = load %"struct.kc::impl_fileline"*, %"struct.kc::impl_fileline"** %this_addr, align 4
%1 = getelementptr inbounds %"struct.kc::impl_fileline", %"struct.kc::impl_fileline"* %0, i32 0, i32 0
%2 = getelementptr inbounds %"struct.kc::impl_abstract_phylum", %"struct.kc::impl_abstract_phylum"* %1, i32 0, i32 0
store i32 (...)** getelementptr inbounds ([13 x i32 (...)*], [13 x i32 (...)*]* @_ZTVN2kc13impl_filelineE, i32 0, i32 2), i32 (...)*** %2, align 4
%3 = trunc i32 0 to i8
%toBool = icmp ne i8 %3, 0
br i1 %toBool, label %bb1, label %return
bb1: ; preds = %entry
%4 = load %"struct.kc::impl_fileline"*, %"struct.kc::impl_fileline"** %this_addr, align 4
%5 = bitcast %"struct.kc::impl_fileline"* %4 to i8*
call void @_ZdlPv() nounwind
br label %return
return: ; preds = %bb1, %entry
ret void
}
declare void @_ZdlPv() nounwind
define void @_ZN2kc13impl_filelineD2Ev(%"struct.kc::impl_fileline"* %this) nounwind align 2 {
entry:
%this_addr = alloca %"struct.kc::impl_fileline"*, align 4
%"alloca point" = bitcast i32 0 to i32
store %"struct.kc::impl_fileline"* %this, %"struct.kc::impl_fileline"** %this_addr
%0 = load %"struct.kc::impl_fileline"*, %"struct.kc::impl_fileline"** %this_addr, align 4
%1 = getelementptr inbounds %"struct.kc::impl_fileline", %"struct.kc::impl_fileline"* %0, i32 0, i32 0
%2 = getelementptr inbounds %"struct.kc::impl_abstract_phylum", %"struct.kc::impl_abstract_phylum"* %1, i32 0, i32 0
store i32 (...)** getelementptr inbounds ([13 x i32 (...)*], [13 x i32 (...)*]* @_ZTVN2kc13impl_filelineE, i32 0, i32 2), i32 (...)*** %2, align 4
%3 = trunc i32 0 to i8
%toBool = icmp ne i8 %3, 0
br i1 %toBool, label %bb1, label %return
bb1: ; preds = %entry
%4 = load %"struct.kc::impl_fileline"*, %"struct.kc::impl_fileline"** %this_addr, align 4
%5 = bitcast %"struct.kc::impl_fileline"* %4 to i8*
call void @_ZdlPv() nounwind
br label %return
return: ; preds = %bb1, %entry
ret void
}
define void @_ZN2kc22impl_fileline_FileLineC1EPNS_20impl_casestring__StrEi(%"struct.kc::impl_fileline_FileLine"* %this, %"struct.kc::impl_casestring__Str"* %_file, i32 %_line) align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
%this_addr = alloca %"struct.kc::impl_fileline_FileLine"*, align 4
%_file_addr = alloca %"struct.kc::impl_casestring__Str"*, align 4
%_line_addr = alloca i32, align 4
%save_filt.148 = alloca i32
%save_eptr.147 = alloca i8*
%iftmp.99 = alloca %"struct.kc::impl_casestring__Str"*
%eh_exception = alloca i8*
%eh_selector = alloca i32
%"alloca point" = bitcast i32 0 to i32
store %"struct.kc::impl_fileline_FileLine"* %this, %"struct.kc::impl_fileline_FileLine"** %this_addr
store %"struct.kc::impl_casestring__Str"* %_file, %"struct.kc::impl_casestring__Str"** %_file_addr
store i32 %_line, i32* %_line_addr
%0 = load %"struct.kc::impl_fileline_FileLine"*, %"struct.kc::impl_fileline_FileLine"** %this_addr, align 4
%1 = getelementptr inbounds %"struct.kc::impl_fileline_FileLine", %"struct.kc::impl_fileline_FileLine"* %0, i32 0, i32 0
call void @_ZN2kc13impl_filelineC2Ev() nounwind
%2 = load %"struct.kc::impl_fileline_FileLine"*, %"struct.kc::impl_fileline_FileLine"** %this_addr, align 4
%3 = getelementptr inbounds %"struct.kc::impl_fileline_FileLine", %"struct.kc::impl_fileline_FileLine"* %2, i32 0, i32 0
%4 = getelementptr inbounds %"struct.kc::impl_fileline", %"struct.kc::impl_fileline"* %3, i32 0, i32 0
%5 = getelementptr inbounds %"struct.kc::impl_abstract_phylum", %"struct.kc::impl_abstract_phylum"* %4, i32 0, i32 0
store i32 (...)** getelementptr inbounds ([13 x i32 (...)*], [13 x i32 (...)*]* @_ZTVN2kc22impl_fileline_FileLineE, i32 0, i32 2), i32 (...)*** %5, align 4
%6 = load %"struct.kc::impl_casestring__Str"*, %"struct.kc::impl_casestring__Str"** %_file_addr, align 4
%7 = icmp eq %"struct.kc::impl_casestring__Str"* %6, null
br i1 %7, label %bb, label %bb1
bb: ; preds = %entry
%8 = invoke %"struct.kc::impl_casestring__Str"* @_ZN2kc12mkcasestringEPKci()
to label %invcont unwind label %lpad
invcont: ; preds = %bb
store %"struct.kc::impl_casestring__Str"* %8, %"struct.kc::impl_casestring__Str"** %iftmp.99, align 4
br label %bb2
bb1: ; preds = %entry
%9 = load %"struct.kc::impl_casestring__Str"*, %"struct.kc::impl_casestring__Str"** %_file_addr, align 4
store %"struct.kc::impl_casestring__Str"* %9, %"struct.kc::impl_casestring__Str"** %iftmp.99, align 4
br label %bb2
bb2: ; preds = %bb1, %invcont
%10 = load %"struct.kc::impl_fileline_FileLine"*, %"struct.kc::impl_fileline_FileLine"** %this_addr, align 4
%11 = getelementptr inbounds %"struct.kc::impl_fileline_FileLine", %"struct.kc::impl_fileline_FileLine"* %10, i32 0, i32 0
%12 = getelementptr inbounds %"struct.kc::impl_fileline", %"struct.kc::impl_fileline"* %11, i32 0, i32 1
%13 = load %"struct.kc::impl_casestring__Str"*, %"struct.kc::impl_casestring__Str"** %iftmp.99, align 4
store %"struct.kc::impl_casestring__Str"* %13, %"struct.kc::impl_casestring__Str"** %12, align 4
%14 = load %"struct.kc::impl_fileline_FileLine"*, %"struct.kc::impl_fileline_FileLine"** %this_addr, align 4
%15 = getelementptr inbounds %"struct.kc::impl_fileline_FileLine", %"struct.kc::impl_fileline_FileLine"* %14, i32 0, i32 0
%16 = getelementptr inbounds %"struct.kc::impl_fileline", %"struct.kc::impl_fileline"* %15, i32 0, i32 2
%17 = load i32, i32* %_line_addr, align 4
store i32 %17, i32* %16, align 4
ret void
lpad: ; preds = %bb
%eh_ptr = landingpad { i8*, i32 }
cleanup
%exn = extractvalue { i8*, i32 } %eh_ptr, 0
store i8* %exn, i8** %eh_exception
%eh_ptr4 = load i8*, i8** %eh_exception
%eh_select5 = extractvalue { i8*, i32 } %eh_ptr, 1
store i32 %eh_select5, i32* %eh_selector
%eh_select = load i32, i32* %eh_selector
store i32 %eh_select, i32* %save_filt.148, align 4
%eh_value = load i8*, i8** %eh_exception
store i8* %eh_value, i8** %save_eptr.147, align 4
%18 = load %"struct.kc::impl_fileline_FileLine"*, %"struct.kc::impl_fileline_FileLine"** %this_addr, align 4
%19 = bitcast %"struct.kc::impl_fileline_FileLine"* %18 to %"struct.kc::impl_fileline"*
call void @_ZN2kc13impl_filelineD2Ev(%"struct.kc::impl_fileline"* %19) nounwind
%20 = load i8*, i8** %save_eptr.147, align 4
store i8* %20, i8** %eh_exception, align 4
%21 = load i32, i32* %save_filt.148, align 4
store i32 %21, i32* %eh_selector, align 4
%eh_ptr6 = load i8*, i8** %eh_exception
call void @_Unwind_Resume_or_Rethrow()
unreachable
}
declare i32 @__gxx_personality_v0(...)
declare void @_Unwind_Resume_or_Rethrow()
define void @_ZN2kc21printer_functor_classC2Ev(%"struct.kc::impl_abstract_phylum"* %this) nounwind align 2 {
entry:
unreachable
}
define %"struct.kc::impl_Ccode_option"* @_ZN2kc11phylum_castIPNS_17impl_withcaseinfoES1_EET_PT0_(%"struct.kc::impl_Ccode_option"* %t) nounwind {
entry:
ret %"struct.kc::impl_Ccode_option"* null
}
define %"struct.kc::impl_abstract_phylum"* @_ZNK2kc43impl_ac_direct_declarator_AcDirectDeclProto9subphylumEi(%"struct.kc::impl_ac_abstract_declarator_AcAbsdeclDirdecl"* %this, i32 %no) nounwind align 2 {
entry:
ret %"struct.kc::impl_abstract_phylum"* undef
}
define void @_ZN2kc30impl_withcaseinfo_WithcaseinfoD0Ev(%"struct.kc::impl_withcaseinfo_Withcaseinfo"* %this) nounwind align 2 {
entry:
unreachable
}
define void @_ZN2kc30impl_withcaseinfo_WithcaseinfoC1EPNS_26impl_patternrepresentationES2_PNS_10impl_CtextE(%"struct.kc::impl_withcaseinfo_Withcaseinfo"* %this, %"struct.kc::impl_outmostpatterns"* %_patternrepresentation_1, %"struct.kc::impl_outmostpatterns"* %_patternrepresentation_2, %"struct.kc::impl_Ctext"* %_Ctext_1) nounwind align 2 {
entry:
unreachable
}
define void @_ZN2kc21impl_rewriteviewsinfoC2EPNS_20impl_rewriteviewinfoEPS0_(%"struct.kc::impl_CexpressionDQ"* %this, %"struct.kc::impl_Ccode_option"* %p1, %"struct.kc::impl_CexpressionDQ"* %p2) nounwind align 2 {
entry:
unreachable
}
define %"struct.kc::impl_Ctext_elem"* @_ZN2kc11phylum_castIPNS_9impl_termENS_20impl_abstract_phylumEEET_PT0_(%"struct.kc::impl_abstract_phylum"* %t) nounwind {
entry:
unreachable
}
define void @_ZN2kc27impl_ac_parameter_type_listD2Ev(%"struct.kc::impl_Ccode_option"* %this) nounwind align 2 {
entry:
ret void
}
define void @_ZN2kc21impl_ac_operator_nameD2Ev(%"struct.kc::impl_Ctext_elem"* %this) nounwind align 2 {
entry:
ret void
}
declare %"struct.kc::impl_casestring__Str"* @_ZN2kc12mkcasestringEPKci()

View File

@ -1,36 +0,0 @@
; RUN: opt -mergefunc -disable-output < %s
; This used to trigger a ConstantExpr::getBitCast assertion.
define void @t1() unnamed_addr uwtable ssp align 2 {
entry:
switch i32 undef, label %sw.bb12 [
i32 127, label %sw.bb
i32 126, label %sw.bb4
]
sw.bb: ; preds = %entry
unreachable
sw.bb4: ; preds = %entry
unreachable
sw.bb12: ; preds = %entry
ret void
}
define void @t2() unnamed_addr uwtable ssp align 2 {
entry:
switch i32 undef, label %sw.bb8 [
i32 4, label %sw.bb
i32 3, label %sw.bb4
]
sw.bb: ; preds = %entry
unreachable
sw.bb4: ; preds = %entry
ret void
sw.bb8: ; preds = %entry
unreachable
}

View File

@ -1,35 +0,0 @@
; RUN: opt -S -mergefunc < %s | FileCheck %s
target datalayout = "p:32:32:32-p1:32:32:32-p2:16:16:16"
declare void @foo(i32) nounwind
; None of these functions should be merged
define i32 @store_as0(i32* %x) {
; CHECK-LABEL: @store_as0(
; CHECK: call void @foo(
%gep = getelementptr i32, i32* %x, i32 4
%y = load i32, i32* %gep
call void @foo(i32 %y) nounwind
ret i32 %y
}
define i32 @store_as1(i32 addrspace(1)* %x) {
; CHECK-LABEL: @store_as1(
; CHECK: call void @foo(
%gep = getelementptr i32, i32 addrspace(1)* %x, i32 4
%y = load i32, i32 addrspace(1)* %gep
call void @foo(i32 %y) nounwind
ret i32 %y
}
define i32 @store_as2(i32 addrspace(2)* %x) {
; CHECK-LABEL: @store_as2(
; CHECK: call void @foo(
%gep = getelementptr i32, i32 addrspace(2)* %x, i32 4
%y = load i32, i32 addrspace(2)* %gep
call void @foo(i32 %y) nounwind
ret i32 %y
}

View File

@ -1,61 +0,0 @@
; RUN: opt -mergefunc -S < %s | FileCheck %s
;; Make sure that two different allocas are not treated as equal.
target datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32"
%kv1 = type { i32, i32 }
%kv2 = type { i8 }
%kv3 = type { i64, i64 }
; Size difference.
; CHECK-LABEL: define void @size1
; CHECK-NOT: call void @
define void @size1(i8 *%f) {
%v = alloca %kv1, align 8
%f_2 = bitcast i8* %f to void (%kv1 *)*
call void %f_2(%kv1 * %v)
call void %f_2(%kv1 * %v)
call void %f_2(%kv1 * %v)
call void %f_2(%kv1 * %v)
ret void
}
; CHECK-LABEL: define void @size2
; CHECK-NOT: call void @
define void @size2(i8 *%f) {
%v = alloca %kv2, align 8
%f_2 = bitcast i8* %f to void (%kv2 *)*
call void %f_2(%kv2 * %v)
call void %f_2(%kv2 * %v)
call void %f_2(%kv2 * %v)
call void %f_2(%kv2 * %v)
ret void
}
; Alignment difference.
; CHECK-LABEL: define void @align1
; CHECK-NOT: call void @
define void @align1(i8 *%f) {
%v = alloca %kv3, align 8
%f_2 = bitcast i8* %f to void (%kv3 *)*
call void %f_2(%kv3 * %v)
call void %f_2(%kv3 * %v)
call void %f_2(%kv3 * %v)
call void %f_2(%kv3 * %v)
ret void
}
; CHECK-LABEL: define void @align2
; CHECK-NOT: call void @
define void @align2(i8 *%f) {
%v = alloca %kv3, align 16
%f_2 = bitcast i8* %f to void (%kv3 *)*
call void %f_2(%kv3 * %v)
call void %f_2(%kv3 * %v)
call void %f_2(%kv3 * %v)
call void %f_2(%kv3 * %v)
ret void
}

View File

@ -1,47 +0,0 @@
; RUN: opt -S -mergefunc < %s | FileCheck %s
%Opaque_type = type opaque
%S2i = type <{ i64, i64 }>
%D2i = type <{ i64, i64 }>
%Di = type <{ i32 }>
%Si = type <{ i32 }>
define void @B(%Opaque_type* sret %a, %S2i* %b, i32* %xp, i32* %yp) {
%x = load i32, i32* %xp
%y = load i32, i32* %yp
%sum = add i32 %x, %y
%sum2 = add i32 %sum, %y
%sum3 = add i32 %sum2, %y
ret void
}
define void @C(%Opaque_type* sret %a, %S2i* %b, i32* %xp, i32* %yp) {
%x = load i32, i32* %xp
%y = load i32, i32* %yp
%sum = add i32 %x, %y
%sum2 = add i32 %sum, %y
%sum3 = add i32 %sum2, %y
ret void
}
define void @A(%Opaque_type* sret %a, %D2i* %b, i32* %xp, i32* %yp) {
%x = load i32, i32* %xp
%y = load i32, i32* %yp
%sum = add i32 %x, %y
%sum2 = add i32 %sum, %y
%sum3 = add i32 %sum2, %y
ret void
}
; Make sure we transfer the parameter attributes to the call site.
; CHECK-LABEL: define void @C(%Opaque_type* sret
; CHECK: tail call void bitcast (void (%Opaque_type*, %D2i*, i32*, i32*)* @A to void (%Opaque_type*, %S2i*, i32*, i32*)*)(%Opaque_type* sret %0, %S2i* %1, i32* %2, i32* %3)
; CHECK: ret void
; Make sure we transfer the parameter attributes to the call site.
; CHECK-LABEL: define void @B(%Opaque_type* sret
; CHECK: %5 = bitcast
; CHECK: tail call void @A(%Opaque_type* sret %0, %D2i* %5, i32* %2, i32* %3)
; CHECK: ret void

View File

@ -1,93 +0,0 @@
; RUN: opt -mergefunc -S < %s | FileCheck %s
define i8 @call_with_range() {
bitcast i8 0 to i8 ; dummy to make the function large enough
%out = call i8 @dummy(), !range !0
ret i8 %out
}
define i8 @call_no_range() {
; CHECK-LABEL: @call_no_range
; CHECK-NEXT: bitcast i8 0 to i8
; CHECK-NEXT: %out = call i8 @dummy()
; CHECK-NEXT: ret i8 %out
bitcast i8 0 to i8
%out = call i8 @dummy()
ret i8 %out
}
define i8 @call_different_range() {
; CHECK-LABEL: @call_different_range
; CHECK-NEXT: bitcast i8 0 to i8
; CHECK-NEXT: %out = call i8 @dummy(), !range !1
; CHECK-NEXT: ret i8 %out
bitcast i8 0 to i8
%out = call i8 @dummy(), !range !1
ret i8 %out
}
define i8 @invoke_with_range() personality i8* undef {
%out = invoke i8 @dummy() to label %next unwind label %lpad, !range !0
next:
ret i8 %out
lpad:
%pad = landingpad { i8*, i32 } cleanup
resume { i8*, i32 } zeroinitializer
}
define i8 @invoke_no_range() personality i8* undef {
; CHECK-LABEL: @invoke_no_range()
; CHECK-NEXT: invoke i8 @dummy
%out = invoke i8 @dummy() to label %next unwind label %lpad
next:
ret i8 %out
lpad:
%pad = landingpad { i8*, i32 } cleanup
resume { i8*, i32 } zeroinitializer
}
define i8 @invoke_different_range() personality i8* undef {
; CHECK-LABEL: @invoke_different_range()
; CHECK-NEXT: invoke i8 @dummy
%out = invoke i8 @dummy() to label %next unwind label %lpad, !range !1
next:
ret i8 %out
lpad:
%pad = landingpad { i8*, i32 } cleanup
resume { i8*, i32 } zeroinitializer
}
define i8 @invoke_with_same_range() personality i8* undef {
; CHECK-LABEL: @invoke_with_same_range()
; CHECK: tail call i8 @invoke_with_range()
%out = invoke i8 @dummy() to label %next unwind label %lpad, !range !0
next:
ret i8 %out
lpad:
%pad = landingpad { i8*, i32 } cleanup
resume { i8*, i32 } zeroinitializer
}
define i8 @call_with_same_range() {
; CHECK-LABEL: @call_with_same_range
; CHECK: tail call i8 @call_with_range
bitcast i8 0 to i8
%out = call i8 @dummy(), !range !0
ret i8 %out
}
declare i8 @dummy();
declare i32 @__gxx_personality_v0(...)
!0 = !{i8 0, i8 2}
!1 = !{i8 5, i8 7}

View File

@ -1,42 +0,0 @@
; RUN: opt -S -mergefunc < %s | FileCheck %s
; RUN: opt -S -mergefunc < %s | FileCheck -check-prefix=NOPLUS %s
; This makes sure that zeros in constants don't cause problems with string based
; memory comparisons
define internal i32 @sum(i32 %x, i32 %y) {
; CHECK-LABEL: @sum
%sum = add i32 %x, %y
%1 = extractvalue [3 x i32] [ i32 3, i32 0, i32 2 ], 2
%sum2 = add i32 %sum, %1
%sum3 = add i32 %sum2, %y
ret i32 %sum3
}
define internal i32 @add(i32 %x, i32 %y) {
; CHECK-LABEL: @add
%sum = add i32 %x, %y
%1 = extractvalue [3 x i32] [ i32 3, i32 0, i32 1 ], 2
%sum2 = add i32 %sum, %1
%sum3 = add i32 %sum2, %y
ret i32 %sum3
}
define internal i32 @plus(i32 %x, i32 %y) {
; NOPLUS-NOT: @plus
%sum = add i32 %x, %y
%1 = extractvalue [3 x i32] [ i32 3, i32 0, i32 5 ], 2
%sum2 = add i32 %sum, %1
%sum3 = add i32 %sum2, %y
ret i32 %sum3
}
define internal i32 @next(i32 %x, i32 %y) {
; CHECK-LABEL: @next
%sum = add i32 %x, %y
%1 = extractvalue [3 x i32] [ i32 3, i32 0, i32 5 ], 2
%sum2 = add i32 %sum, %1
%sum3 = add i32 %sum2, %y
ret i32 %sum3
}

View File

@ -1,46 +0,0 @@
; RUN: opt -mergefunc -disable-output < %s
; PR15185
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128"
target triple = "i386-pc-linux-gnu"
%.qux.2496 = type { i32, %.qux.2497 }
%.qux.2497 = type { i8, i32 }
%.qux.2585 = type { i32, i32, i8* }
@g2 = external unnamed_addr constant [9 x i8], align 1
@g3 = internal unnamed_addr constant [1 x i8*] [i8* bitcast (i8* (%.qux.2585*)* @func35 to i8*)]
define internal i32 @func1(i32* %ptr, { i32, i32 }* nocapture %method) align 2 {
br label %1
; <label>:1
br label %2
; <label>:2
ret i32 undef
}
define internal i32 @func10(%.qux.2496* nocapture %this) align 2 {
%1 = getelementptr inbounds %.qux.2496, %.qux.2496* %this, i32 0, i32 1, i32 1
%2 = load i32, i32* %1, align 4
ret i32 %2
}
define internal i8* @func29(i32* nocapture %this) align 2 {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @g2, i32 0, i32 0)
}
define internal i32* @func33(%.qux.2585* nocapture %this) align 2 {
ret i32* undef
}
define internal i32* @func34(%.qux.2585* nocapture %this) align 2 {
%1 = getelementptr inbounds %.qux.2585, %.qux.2585* %this, i32 0
ret i32* undef
}
define internal i8* @func35(%.qux.2585* nocapture %this) align 2 {
%1 = getelementptr inbounds %.qux.2585, %.qux.2585* %this, i32 0, i32 2
%2 = load i8*, i8** %1, align 4
ret i8* %2
}

View File

@ -1,54 +0,0 @@
; RUN: opt %s -mergefunc -globalopt -S -o - | FileCheck %s
; Make sure we don't crash on this example. This test is supposed to test that
; MergeFunctions clears its GlobalNumbers value map. If this map still contains
; entries when running globalopt and the MergeFunctions instance is still alive
; the optimization of @G would cause an assert because globalopt would do an
; RAUW on @G which still exists as an entry in the GlobalNumbers ValueMap which
; causes an assert in the ValueHandle call back because we are RAUWing with a
; different type (AllocaInst) than its key type (GlobalValue).
@G = internal global i8** null
@G2 = internal global i8** null
define i32 @main(i32 %argc, i8** %argv) norecurse {
; CHECK: alloca
store i8** %argv, i8*** @G
ret i32 0
}
define internal i8** @dead1(i64 %p) {
call void @right(i64 %p)
call void @right(i64 %p)
call void @right(i64 %p)
call void @right(i64 %p)
%tmp = load i8**, i8*** @G
ret i8** %tmp
}
define internal i8** @dead2(i64 %p) {
call void @right(i64 %p)
call void @right(i64 %p)
call void @right(i64 %p)
call void @right(i64 %p)
%tmp = load i8**, i8*** @G2
ret i8** %tmp
}
define void @left(i64 %p) {
entry-block:
call void @right(i64 %p)
call void @right(i64 %p)
call void @right(i64 %p)
call void @right(i64 %p)
ret void
}
define void @right(i64 %p) {
entry-block:
call void @left(i64 %p)
call void @left(i64 %p)
call void @left(i64 %p)
call void @left(i64 %p)
ret void
}

View File

@ -1,47 +0,0 @@
; RUN: opt -S -mergefunc < %s | FileCheck %s
define weak i32 @sum(i32 %x, i32 %y) {
%sum = add i32 %x, %y
%sum2 = add i32 %sum, %y
%sum3 = add i32 %sum2, %y
ret i32 %sum3
}
define weak i32 @add(i32 %x, i32 %y) {
%sum = add i32 %x, %y
%sum2 = add i32 %sum, %y
%sum3 = add i32 %sum2, %y
ret i32 %sum3
}
; Don't replace a weak function use by another equivalent function. We don't
; know whether the symbol that will ulitmately be linked is equivalent - we
; don't know that the weak definition is the definitive definition or whether it
; will be overriden by a stronger definition).
; CHECK-LABEL: define private i32 @0
; CHECK: add i32
; CHECK: add i32
; CHECK: add i32
; CHECK: ret
; CHECK-LABEL: define i32 @use_weak
; CHECK: call i32 @add
; CHECK: call i32 @sum
; CHECK: ret
; CHECK-LABEL: define weak i32 @sum
; CHECK: tail call i32 @0
; CHECK: ret
; CHECK-LABEL: define weak i32 @add
; CHECK: tail call i32 @0
; CHECK: ret
define i32 @use_weak(i32 %a, i32 %b) {
%res = call i32 @add(i32 %a, i32 %b)
%res2 = call i32 @sum(i32 %a, i32 %b)
%res3 = add i32 %res, %res2
ret i32 %res3
}

View File

@ -1,27 +0,0 @@
; RUN: opt -S -mergefunc < %s | FileCheck %s
; Be sure we don't merge cross-referenced functions of same type.
; CHECK-LABEL: @left
; CHECK-LABEL: entry-block
; CHECK-LABEL: call void @right(i64 %p)
define void @left(i64 %p) {
entry-block:
call void @right(i64 %p)
call void @right(i64 %p)
call void @right(i64 %p)
call void @right(i64 %p)
ret void
}
; CHECK-LABEL: @right
; CHECK-LABEL: entry-block
; CHECK-LABEL: call void @left(i64 %p)
define void @right(i64 %p) {
entry-block:
call void @left(i64 %p)
call void @left(i64 %p)
call void @left(i64 %p)
call void @left(i64 %p)
ret void
}

View File

@ -1,46 +0,0 @@
; RUN: opt -mergefunc -S < %s | FileCheck %s
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
; These should not be merged, the type of the GEP pointer argument does not have
; the same stride.
%"struct1" = type <{ i8*, i32, [4 x i8] }>
%"struct2" = type { i8*, { i64, i64 } }
define internal %struct2* @Ffunc(%struct2* %P, i64 %i) {
; CHECK-LABEL: @Ffunc(
; CHECK-NEXT: getelementptr
; CHECK-NEXT: getelementptr
; CHECK-NEXT: getelementptr
; CHECK-NEXT: getelementptr
; CHECK-NEXT: getelementptr
; CHECK-NEXT: getelementptr
; CHECK-NEXT: ret
%1 = getelementptr inbounds %"struct2", %"struct2"* %P, i64 %i
%2 = getelementptr inbounds %"struct2", %"struct2"* %P, i64 %i
%3 = getelementptr inbounds %"struct2", %"struct2"* %P, i64 %i
%4 = getelementptr inbounds %"struct2", %"struct2"* %P, i64 %i
%5 = getelementptr inbounds %"struct2", %"struct2"* %P, i64 %i
%6 = getelementptr inbounds %"struct2", %"struct2"* %P, i64 %i
ret %struct2* %6
}
define internal %struct1* @Gfunc(%struct1* %P, i64 %i) {
; CHECK-LABEL: @Gfunc(
; CHECK-NEXT: getelementptr
; CHECK-NEXT: getelementptr
; CHECK-NEXT: getelementptr
; CHECK-NEXT: getelementptr
; CHECK-NEXT: getelementptr
; CHECK-NEXT: getelementptr
; CHECK-NEXT: ret
%1 = getelementptr inbounds %"struct1", %"struct1"* %P, i64 %i
%2 = getelementptr inbounds %"struct1", %"struct1"* %P, i64 %i
%3 = getelementptr inbounds %"struct1", %"struct1"* %P, i64 %i
%4 = getelementptr inbounds %"struct1", %"struct1"* %P, i64 %i
%5 = getelementptr inbounds %"struct1", %"struct1"* %P, i64 %i
%6 = getelementptr inbounds %"struct1", %"struct1"* %P, i64 %i
ret %struct1* %6
}

View File

@ -1,29 +0,0 @@
; RUN: opt -mergefunc -S < %s | FileCheck %s
target datalayout = "e-p:32:32:32-p1:16:16:16-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-n8:16:32-S128"
%.qux.2496 = type { i32, %.qux.2497 }
%.qux.2497 = type { i8, i32 }
%.qux.2585 = type { i32, i32, i8* }
@g2 = external addrspace(1) constant [9 x i8], align 1
@g3 = internal unnamed_addr constant [1 x i8*] [i8* bitcast (i8* (%.qux.2585 addrspace(1)*)* @func35 to i8*)]
define internal i32 @func10(%.qux.2496 addrspace(1)* nocapture %this) align 2 {
bb:
%tmp = getelementptr inbounds %.qux.2496, %.qux.2496 addrspace(1)* %this, i32 0, i32 1, i32 1
%tmp1 = load i32, i32 addrspace(1)* %tmp, align 4
ret i32 %tmp1
}
; Check for pointer bitwidth equal assertion failure
define internal i8* @func35(%.qux.2585 addrspace(1)* nocapture %this) align 2 {
bb:
; CHECK-LABEL: @func35(
; CHECK: %[[V2:.+]] = bitcast %.qux.2585 addrspace(1)* %{{.*}} to %.qux.2496 addrspace(1)*
; CHECK: %[[V3:.+]] = tail call i32 @func10(%.qux.2496 addrspace(1)* nocapture %[[V2]])
; CHECK: %{{.*}} = inttoptr i32 %[[V3]] to i8*
%tmp = getelementptr inbounds %.qux.2585, %.qux.2585 addrspace(1)* %this, i32 0, i32 2
%tmp1 = load i8*, i8* addrspace(1)* %tmp, align 4
ret i8* %tmp1
}

View File

@ -1,56 +0,0 @@
; RUN: opt -mergefunc -S < %s | FileCheck %s
; PR15185
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128"
target triple = "i386-pc-linux-gnu"
%.qux.2496 = type { i32, %.qux.2497 }
%.qux.2497 = type { i8, i32 }
%.qux.2585 = type { i32, i32, i8* }
@g2 = external unnamed_addr constant [9 x i8], align 1
@g3 = internal unnamed_addr constant [1 x i8*] [i8* bitcast (i8* (%.qux.2585*)* @func35 to i8*)]
define internal i32 @func1(i32* %ptr, { i32, i32 }* nocapture %method) align 2 {
bb:
br label %bb1
bb1: ; preds = %bb
br label %bb2
bb2: ; preds = %bb1
ret i32 undef
}
define internal i32 @func10(%.qux.2496* nocapture %this) align 2 {
bb:
%tmp = getelementptr inbounds %.qux.2496, %.qux.2496* %this, i32 0, i32 1, i32 1
%tmp1 = load i32, i32* %tmp, align 4
ret i32 %tmp1
}
define internal i8* @func29(i32* nocapture %this) align 2 {
bb:
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @g2, i32 0, i32 0)
}
define internal i32* @func33(%.qux.2585* nocapture %this) align 2 {
bb:
ret i32* undef
}
define internal i32* @func34(%.qux.2585* nocapture %this) align 2 {
bb:
%tmp = getelementptr inbounds %.qux.2585, %.qux.2585* %this, i32 0
ret i32* undef
}
define internal i8* @func35(%.qux.2585* nocapture %this) align 2 {
bb:
; CHECK-LABEL: @func35(
; CHECK: %[[V2:.+]] = bitcast %.qux.2585* %{{.*}} to %.qux.2496*
; CHECK: %[[V3:.+]] = tail call i32 @func10(%.qux.2496* nocapture %[[V2]])
; CHECK: %{{.*}} = inttoptr i32 %[[V3]] to i8*
%tmp = getelementptr inbounds %.qux.2585, %.qux.2585* %this, i32 0, i32 2
%tmp1 = load i8*, i8** %tmp, align 4
ret i8* %tmp1
}

View File

@ -1,30 +0,0 @@
; RUN: opt -S -mergefunc < %s | FileCheck %s
; Replacments should be totally ordered on the function name.
; If we don't do this we can end up with one module defining a thunk for @funA
; and another module defining a thunk for @funB.
;
; The problem with this is that the linker could then choose these two stubs
; each of the two modules and we end up with two stubs calling each other.
; CHECK-LABEL: define linkonce_odr i32 @funA
; CHECK-NEXT: add
; CHECK: ret
; CHECK-LABEL: define linkonce_odr i32 @funB
; CHECK-NEXT: tail call i32 @funA(i32 %0, i32 %1)
; CHECK-NEXT: ret
define linkonce_odr i32 @funB(i32 %x, i32 %y) {
%sum = add i32 %x, %y
%sum2 = add i32 %x, %sum
%sum3 = add i32 %x, %sum2
ret i32 %sum3
}
define linkonce_odr i32 @funA(i32 %x, i32 %y) {
%sum = add i32 %x, %y
%sum2 = add i32 %x, %sum
%sum3 = add i32 %x, %sum2
ret i32 %sum3
}

View File

@ -1,49 +0,0 @@
; RUN: opt -S -mergefunc < %s | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define i32 @_Z1fi(i32 %i) #0 {
entry:
%retval = alloca i32, align 4
%i.addr = alloca i32, align 4
store i32 %i, i32* %i.addr, align 4
%0 = load i32, i32* %i.addr, align 4
%cmp = icmp eq i32 %0, 1
br i1 %cmp, label %if.then, label %if.end
if.then:
store i32 3, i32* %retval
br label %return
if.end:
%1 = load i32, i32* %i.addr, align 4
%cmp1 = icmp eq i32 %1, 3
br i1 %cmp1, label %if.then.2, label %if.end.3
if.then.2:
store i32 56, i32* %retval
br label %return
if.end.3:
store i32 0, i32* %retval
br label %return
return:
%2 = load i32, i32* %retval
ret i32 %2
}
define internal i8* @Afunc(i32* %P) {
store i32 1, i32* %P
store i32 3, i32* %P
ret i8* blockaddress(@_Z1fi, %if.then.2)
}
define internal i8* @Bfunc(i32* %P) {
; CHECK-NOT: @Bfunc
store i32 1, i32* %P
store i32 3, i32* %P
ret i8* blockaddress(@_Z1fi, %if.then.2)
}

View File

@ -1,91 +0,0 @@
; RUN: opt -S -mergefunc < %s | FileCheck %s
; These two functions are identical. The basic block labels are the same, and
; induce the same CFG. We are testing that block addresses within different
; functions are compared by their value, and not based on order. Both functions
; come from the same C-code, but in the first the two val_0/val_1 basic blocks
; are in a different order (they were manually switched post-compilation).
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define i32 @_Z1fi(i32 %i) #0 {
entry:
%i.addr = alloca i32, align 4
%ret = alloca i32, align 4
%l = alloca i8*, align 8
store i32 %i, i32* %i.addr, align 4
store i32 0, i32* %ret, align 4
store i8* blockaddress(@_Z1fi, %val_0), i8** %l, align 8
%0 = load i32, i32* %i.addr, align 4
%and = and i32 %0, 256
%cmp = icmp eq i32 %and, 0
br i1 %cmp, label %if.then, label %if.end
if.then:
store i8* blockaddress(@_Z1fi, %val_1), i8** %l, align 8
br label %if.end
if.end:
%1 = load i8*, i8** %l, align 8
br label %indirectgoto
val_1:
store i32 42, i32* %ret, align 4
br label %end
val_0:
store i32 12, i32* %ret, align 4
br label %end
end:
%2 = load i32, i32* %ret, align 4
ret i32 %2
indirectgoto:
%indirect.goto.dest = phi i8* [ %1, %if.end ]
indirectbr i8* %indirect.goto.dest, [label %val_0, label %val_1]
}
define i32 @_Z1gi(i32 %i) #0 {
; CHECK-LABEL: define i32 @_Z1gi
; CHECK-NEXT: tail call i32 @_Z1fi
; CHECK-NEXT: ret
entry:
%i.addr = alloca i32, align 4
%ret = alloca i32, align 4
%l = alloca i8*, align 8
store i32 %i, i32* %i.addr, align 4
store i32 0, i32* %ret, align 4
store i8* blockaddress(@_Z1gi, %val_0), i8** %l, align 8
%0 = load i32, i32* %i.addr, align 4
%and = and i32 %0, 256
%cmp = icmp eq i32 %and, 0
br i1 %cmp, label %if.then, label %if.end
if.then:
store i8* blockaddress(@_Z1gi, %val_1), i8** %l, align 8
br label %if.end
if.end:
%1 = load i8*, i8** %l, align 8
br label %indirectgoto
val_0:
store i32 12, i32* %ret, align 4
br label %end
val_1:
store i32 42, i32* %ret, align 4
br label %end
end:
%2 = load i32, i32* %ret, align 4
ret i32 %2
indirectgoto:
%indirect.goto.dest = phi i8* [ %1, %if.end ]
indirectbr i8* %indirect.goto.dest, [label %val_0, label %val_1]
}

View File

@ -1,20 +0,0 @@
; RUN: opt -mergefunc -S < %s | FileCheck %s
; RUN: opt -mergefunc -S < %s | FileCheck -check-prefix=MERGE %s
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
; Afunc and Bfunc differ only in that one returns i64, the other a pointer.
; These should be merged.
define internal i64 @Afunc(i32* %P, i32* %Q) {
; CHECK-LABEL: define internal i64 @Afunc
store i32 4, i32* %P
store i32 6, i32* %Q
ret i64 0
}
define internal i64* @Bfunc(i32* %P, i32* %Q) {
; MERGE-NOT: @Bfunc
store i32 4, i32* %P
store i32 6, i32* %Q
ret i64* null
}

View File

@ -1,18 +0,0 @@
; RUN: opt -mergefunc -S < %s | FileCheck %s
; RUN: opt -mergefunc -S < %s | FileCheck -check-prefix=MERGE %s
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
; Merging should still work even if the values are wrapped in a vector.
define internal <2 x i64> @Mfunc(i32* %P, i32* %Q) {
; CHECK-LABEL: define internal <2 x i64> @Mfunc
store i32 1, i32* %P
store i32 1, i32* %Q
ret <2 x i64> <i64 0, i64 0>
}
define internal <2 x i64*> @Nfunc(i32* %P, i32* %Q) {
; MERGE-NOT: @Nfunc
store i32 1, i32* %P
store i32 1, i32* %Q
ret <2 x i64*> <i64* null, i64* null>
}

View File

@ -1,27 +0,0 @@
; RUN: opt -S -mergefunc < %s | FileCheck %s
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
declare void @stuff()
; CHECK-LABEL: @f0(
define void @f0(i64 %p0) {
entry:
call void @stuff()
call void @stuff()
call void @stuff()
ret void
}
; CHECK-LABEL: @f1(
; CHECK: ptrtoint i64*
; CHECK: tail call void @f0(i64
define void @f1(i64* %p0) {
entry:
call void @stuff()
call void @stuff()
call void @stuff()
ret void
}

Some files were not shown because too many files have changed in this diff Show More