From ee2789001b8558656a13502f0de2c81dcb419430 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 4 Jan 2023 17:05:13 +0100 Subject: [PATCH] [MergeFunc] Convert tests to opaque pointers (NFC) --- .../Transforms/MergeFunc/2011-02-08-RemoveEqual.ll | 278 ++++++++++----------- llvm/test/Transforms/MergeFunc/address-spaces.ll | 18 +- llvm/test/Transforms/MergeFunc/alias.ll | 60 ++--- llvm/test/Transforms/MergeFunc/alloca.ll | 44 ++-- .../MergeFunc/apply_function_attributes.ll | 27 +- .../MergeFunc/byval-attr-congruent-type.ll | 8 +- llvm/test/Transforms/MergeFunc/byval-attr-type.ll | 10 +- .../MergeFunc/call-and-invoke-with-ranges.ll | 24 +- llvm/test/Transforms/MergeFunc/comdat.ll | 2 +- llvm/test/Transforms/MergeFunc/crash.ll | 33 ++- llvm/test/Transforms/MergeFunc/crash2.ll | 20 +- .../MergeFunc/dso_local_equivalent_merged.ll | 4 +- .../MergeFunc/dso_local_equivalent_unmerged.ll | 8 +- llvm/test/Transforms/MergeFunc/gep-base-type.ll | 36 +-- llvm/test/Transforms/MergeFunc/inline-asm.ll | 23 +- .../Transforms/MergeFunc/inttoptr-address-space.ll | 23 +- llvm/test/Transforms/MergeFunc/inttoptr.ll | 38 ++- llvm/test/Transforms/MergeFunc/linkonce_odr.ll | 2 +- .../merge-block-address-other-function.ll | 30 +-- .../Transforms/MergeFunc/merge-block-address.ll | 48 ++-- .../MergeFunc/merge-const-ptr-and-int.ll | 14 +- .../MergeFunc/merge-different-vector-types.ll | 14 +- .../test/Transforms/MergeFunc/merge-ptr-and-int.ll | 4 +- .../MergeFunc/merge-small-unnamed-addr.ll | 4 +- .../MergeFunc/merge-unnamed-addr-bitcast.ll | 10 +- .../Transforms/MergeFunc/merge-unnamed-addr.ll | 4 +- llvm/test/Transforms/MergeFunc/merge-used.ll | 4 +- .../MergeFunc/mergefunc-preserve-debug-info.ll | 64 ++--- .../MergeFunc/mergefunc-struct-return.ll | 23 +- .../Transforms/MergeFunc/mismatching-attr-crash.ll | 14 +- .../no-merge-block-address-different-labels.ll | 48 ++-- .../no-merge-block-address-other-function.ll | 30 +-- .../MergeFunc/no-merge-ptr-different-sizes.ll | 16 +- .../MergeFunc/no-merge-ptr-int-different-values.ll | 16 +- .../Transforms/MergeFunc/nonzero-address-spaces.ll | 4 +- .../Transforms/MergeFunc/ptr-int-transitivity-1.ll | 2 +- .../Transforms/MergeFunc/ptr-int-transitivity-2.ll | 4 +- .../Transforms/MergeFunc/ptr-int-transitivity-3.ll | 4 +- llvm/test/Transforms/MergeFunc/ranges-multiple.ll | 32 +-- llvm/test/Transforms/MergeFunc/ranges.ll | 32 +-- .../MergeFunc/self-referential-global.ll | 10 +- .../Transforms/MergeFunc/undef-different-types.ll | 14 +- llvm/test/Transforms/MergeFunc/va_arg.ll | 102 ++++---- llvm/test/Transforms/MergeFunc/vector-GEP-crash.ll | 8 +- llvm/test/Transforms/MergeFunc/vector.ll | 42 ++-- llvm/test/Transforms/MergeFunc/weak-small.ll | 8 +- 46 files changed, 608 insertions(+), 655 deletions(-) diff --git a/llvm/test/Transforms/MergeFunc/2011-02-08-RemoveEqual.ll b/llvm/test/Transforms/MergeFunc/2011-02-08-RemoveEqual.ll index 3d29583..526efe9 100644 --- a/llvm/test/Transforms/MergeFunc/2011-02-08-RemoveEqual.ll +++ b/llvm/test/Transforms/MergeFunc/2011-02-08-RemoveEqual.ll @@ -5,117 +5,107 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 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_CexpressionDQ" = type { %"struct.kc::impl_Ccode_option", ptr, ptr } +%"struct.kc::impl_Ctext" = type { %"struct.kc::impl_Ccode_option", i32, ptr, ptr, ptr } +%"struct.kc::impl_Ctext_elem" = type { %"struct.kc::impl_abstract_phylum", i32, ptr } +%"struct.kc::impl_ID" = type { %"struct.kc::impl_abstract_phylum", ptr, ptr, i32, ptr } +%"struct.kc::impl_abstract_phylum" = type { ptr } +%"struct.kc::impl_ac_abstract_declarator_AcAbsdeclDirdecl" = type { %"struct.kc::impl_Ccode_option", ptr, ptr } +%"struct.kc::impl_casestring__Str" = type { %"struct.kc::impl_abstract_phylum", ptr } +%"struct.kc::impl_elem_patternrepresentation" = type { %"struct.kc::impl_abstract_phylum", i32, ptr, ptr } +%"struct.kc::impl_fileline" = type { %"struct.kc::impl_abstract_phylum", ptr, 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"* } +%"struct.kc::impl_outmostpatterns" = type { %"struct.kc::impl_Ccode_option", ptr, ptr } +%"struct.kc::impl_withcaseinfo_Withcaseinfo" = type { %"struct.kc::impl_Ccode_option", ptr, ptr, ptr } -@_ZTVN2kc13impl_filelineE = external constant [13 x i32 (...)*], align 32 +@_ZTVN2kc13impl_filelineE = external constant [13 x ptr], align 32 @.str = external constant [1 x i8], align 1 -@_ZTVN2kc22impl_fileline_FileLineE = external constant [13 x i32 (...)*], align 32 +@_ZTVN2kc22impl_fileline_FileLineE = external constant [13 x ptr], 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*) { +define void @_ZN2kc22impl_fileline_FileLineC2EPNS_20impl_casestring__StrEi(ptr %this, ptr %_file, i32 %_line) align 2 personality ptr @__gxx_personality_v0 { entry: - %this_addr = alloca %"struct.kc::impl_fileline_FileLine"*, align 4 - %_file_addr = alloca %"struct.kc::impl_casestring__Str"*, align 4 + %this_addr = alloca ptr, align 4 + %_file_addr = alloca ptr, 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* + %save_eptr.149 = alloca ptr + %iftmp.99 = alloca ptr + %eh_exception = alloca ptr %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 + store ptr %this, ptr %this_addr + store ptr %_file, ptr %_file_addr + store i32 %_line, ptr %_line_addr + %0 = load ptr, ptr %this_addr, align 4 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 + %1 = load ptr, ptr %this_addr, align 4 + store ptr getelementptr inbounds ([13 x ptr], ptr @_ZTVN2kc22impl_fileline_FileLineE, i32 0, i32 2), ptr %1, align 4 + %2 = load ptr, ptr %_file_addr, align 4 + %3 = icmp eq ptr %2, null + br i1 %3, label %bb, label %bb1 bb: ; preds = %entry - %8 = invoke %"struct.kc::impl_casestring__Str"* @_ZN2kc12mkcasestringEPKci() + %4 = invoke ptr @_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 + store ptr %4, ptr %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 + %5 = load ptr, ptr %_file_addr, align 4 + store ptr %5, ptr %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 + %6 = load ptr, ptr %this_addr, align 4 + %7 = getelementptr inbounds %"struct.kc::impl_fileline", ptr %6, i32 0, i32 1 + %8 = load ptr, ptr %iftmp.99, align 4 + store ptr %8, ptr %7, align 4 + %9 = load ptr, ptr %this_addr, align 4 + %10 = getelementptr inbounds %"struct.kc::impl_fileline", ptr %9, i32 0, i32 2 + %11 = load i32, ptr %_line_addr, align 4 + store i32 %11, ptr %10, align 4 ret void lpad: ; preds = %bb - %eh_ptr = landingpad { i8*, i32 } + %eh_ptr = landingpad { ptr, 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 + %exn = extractvalue { ptr, i32 } %eh_ptr, 0 + store ptr %exn, ptr %eh_exception + %eh_ptr4 = load ptr, ptr %eh_exception + %eh_select5 = extractvalue { ptr, i32 } %eh_ptr, 1 + store i32 %eh_select5, ptr %eh_selector + %eh_select = load i32, ptr %eh_selector + store i32 %eh_select, ptr %save_filt.150, align 4 + %eh_value = load ptr, ptr %eh_exception + store ptr %eh_value, ptr %save_eptr.149, align 4 + %12 = load ptr, ptr %this_addr, align 4 + call void @_ZN2kc13impl_filelineD2Ev(ptr %12) nounwind + %13 = load ptr, ptr %save_eptr.149, align 4 + store ptr %13, ptr %eh_exception, align 4 + %14 = load i32, ptr %save_filt.150, align 4 + store i32 %14, ptr %eh_selector, align 4 + %eh_ptr6 = load ptr, ptr %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 { +define void @_ZN2kc13impl_filelineD1Ev(ptr %this) nounwind align 2 { entry: - %this_addr = alloca %"struct.kc::impl_fileline"*, align 4 + %this_addr = alloca ptr, 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 + store ptr %this, ptr %this_addr + %0 = load ptr, ptr %this_addr, align 4 + store ptr getelementptr inbounds ([13 x ptr], ptr @_ZTVN2kc13impl_filelineE, i32 0, i32 2), ptr %0, align 4 + %1 = trunc i32 0 to i8 + %toBool = icmp ne i8 %1, 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* + %2 = load ptr, ptr %this_addr, align 4 call void @_ZdlPv() nounwind br label %return @@ -125,22 +115,19 @@ return: ; preds = %bb1, %entry declare void @_ZdlPv() nounwind -define void @_ZN2kc13impl_filelineD2Ev(%"struct.kc::impl_fileline"* %this) nounwind align 2 { +define void @_ZN2kc13impl_filelineD2Ev(ptr %this) nounwind align 2 { entry: - %this_addr = alloca %"struct.kc::impl_fileline"*, align 4 + %this_addr = alloca ptr, 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 + store ptr %this, ptr %this_addr + %0 = load ptr, ptr %this_addr, align 4 + store ptr getelementptr inbounds ([13 x ptr], ptr @_ZTVN2kc13impl_filelineE, i32 0, i32 2), ptr %0, align 4 + %1 = trunc i32 0 to i8 + %toBool = icmp ne i8 %1, 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* + %2 = load ptr, ptr %this_addr, align 4 call void @_ZdlPv() nounwind br label %return @@ -148,78 +135,71 @@ 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*) { +define void @_ZN2kc22impl_fileline_FileLineC1EPNS_20impl_casestring__StrEi(ptr %this, ptr %_file, i32 %_line) align 2 personality ptr @__gxx_personality_v0 { entry: - %this_addr = alloca %"struct.kc::impl_fileline_FileLine"*, align 4 - %_file_addr = alloca %"struct.kc::impl_casestring__Str"*, align 4 + %this_addr = alloca ptr, align 4 + %_file_addr = alloca ptr, 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* + %save_eptr.147 = alloca ptr + %iftmp.99 = alloca ptr + %eh_exception = alloca ptr %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 + store ptr %this, ptr %this_addr + store ptr %_file, ptr %_file_addr + store i32 %_line, ptr %_line_addr + %0 = load ptr, ptr %this_addr, align 4 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 + %1 = load ptr, ptr %this_addr, align 4 + store ptr getelementptr inbounds ([13 x ptr], ptr @_ZTVN2kc22impl_fileline_FileLineE, i32 0, i32 2), ptr %1, align 4 + %2 = load ptr, ptr %_file_addr, align 4 + %3 = icmp eq ptr %2, null + br i1 %3, label %bb, label %bb1 bb: ; preds = %entry - %8 = invoke %"struct.kc::impl_casestring__Str"* @_ZN2kc12mkcasestringEPKci() + %4 = invoke ptr @_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 + store ptr %4, ptr %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 + %5 = load ptr, ptr %_file_addr, align 4 + store ptr %5, ptr %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 + %6 = load ptr, ptr %this_addr, align 4 + %7 = getelementptr inbounds %"struct.kc::impl_fileline", ptr %6, i32 0, i32 1 + %8 = load ptr, ptr %iftmp.99, align 4 + store ptr %8, ptr %7, align 4 + %9 = load ptr, ptr %this_addr, align 4 + %10 = getelementptr inbounds %"struct.kc::impl_fileline", ptr %9, i32 0, i32 2 + %11 = load i32, ptr %_line_addr, align 4 + store i32 %11, ptr %10, align 4 ret void lpad: ; preds = %bb - %eh_ptr = landingpad { i8*, i32 } + %eh_ptr = landingpad { ptr, 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 + %exn = extractvalue { ptr, i32 } %eh_ptr, 0 + store ptr %exn, ptr %eh_exception + %eh_ptr4 = load ptr, ptr %eh_exception + %eh_select5 = extractvalue { ptr, i32 } %eh_ptr, 1 + store i32 %eh_select5, ptr %eh_selector + %eh_select = load i32, ptr %eh_selector + store i32 %eh_select, ptr %save_filt.148, align 4 + %eh_value = load ptr, ptr %eh_exception + store ptr %eh_value, ptr %save_eptr.147, align 4 + %12 = load ptr, ptr %this_addr, align 4 + call void @_ZN2kc13impl_filelineD2Ev(ptr %12) nounwind + %13 = load ptr, ptr %save_eptr.147, align 4 + store ptr %13, ptr %eh_exception, align 4 + %14 = load i32, ptr %save_filt.148, align 4 + store i32 %14, ptr %eh_selector, align 4 + %eh_ptr6 = load ptr, ptr %eh_exception call void @_Unwind_Resume_or_Rethrow() unreachable } @@ -228,49 +208,49 @@ 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 { +define void @_ZN2kc21printer_functor_classC2Ev(ptr %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 { +define ptr @_ZN2kc11phylum_castIPNS_17impl_withcaseinfoES1_EET_PT0_(ptr %t) nounwind { entry: - ret %"struct.kc::impl_Ccode_option"* null + ret ptr 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 { +define ptr @_ZNK2kc43impl_ac_direct_declarator_AcDirectDeclProto9subphylumEi(ptr %this, i32 %no) nounwind align 2 { entry: - ret %"struct.kc::impl_abstract_phylum"* undef + ret ptr undef } -define void @_ZN2kc30impl_withcaseinfo_WithcaseinfoD0Ev(%"struct.kc::impl_withcaseinfo_Withcaseinfo"* %this) nounwind align 2 { +define void @_ZN2kc30impl_withcaseinfo_WithcaseinfoD0Ev(ptr %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 { +define void @_ZN2kc30impl_withcaseinfo_WithcaseinfoC1EPNS_26impl_patternrepresentationES2_PNS_10impl_CtextE(ptr %this, ptr %_patternrepresentation_1, ptr %_patternrepresentation_2, ptr %_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 { +define void @_ZN2kc21impl_rewriteviewsinfoC2EPNS_20impl_rewriteviewinfoEPS0_(ptr %this, ptr %p1, ptr %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 { +define ptr @_ZN2kc11phylum_castIPNS_9impl_termENS_20impl_abstract_phylumEEET_PT0_(ptr %t) nounwind { entry: unreachable } -define void @_ZN2kc27impl_ac_parameter_type_listD2Ev(%"struct.kc::impl_Ccode_option"* %this) nounwind align 2 { +define void @_ZN2kc27impl_ac_parameter_type_listD2Ev(ptr %this) nounwind align 2 { entry: ret void } -define void @_ZN2kc21impl_ac_operator_nameD2Ev(%"struct.kc::impl_Ctext_elem"* %this) nounwind align 2 { +define void @_ZN2kc21impl_ac_operator_nameD2Ev(ptr %this) nounwind align 2 { entry: ret void } -declare %"struct.kc::impl_casestring__Str"* @_ZN2kc12mkcasestringEPKci() +declare ptr @_ZN2kc12mkcasestringEPKci() diff --git a/llvm/test/Transforms/MergeFunc/address-spaces.ll b/llvm/test/Transforms/MergeFunc/address-spaces.ll index fa2dfd6..49cae20 100644 --- a/llvm/test/Transforms/MergeFunc/address-spaces.ll +++ b/llvm/test/Transforms/MergeFunc/address-spaces.ll @@ -6,29 +6,29 @@ declare void @foo(i32) nounwind ; None of these functions should be merged -define i32 @store_as0(i32* %x) { +define i32 @store_as0(ptr %x) { ; CHECK-LABEL: @store_as0( ; CHECK: call void @foo( - %gep = getelementptr i32, i32* %x, i32 4 - %y = load i32, i32* %gep + %gep = getelementptr i32, ptr %x, i32 4 + %y = load i32, ptr %gep call void @foo(i32 %y) nounwind ret i32 %y } -define i32 @store_as1(i32 addrspace(1)* %x) { +define i32 @store_as1(ptr 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 + %gep = getelementptr i32, ptr addrspace(1) %x, i32 4 + %y = load i32, ptr addrspace(1) %gep call void @foo(i32 %y) nounwind ret i32 %y } -define i32 @store_as2(i32 addrspace(2)* %x) { +define i32 @store_as2(ptr 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 + %gep = getelementptr i32, ptr addrspace(2) %x, i32 4 + %y = load i32, ptr addrspace(2) %gep call void @foo(i32 %y) nounwind ret i32 %y } diff --git a/llvm/test/Transforms/MergeFunc/alias.ll b/llvm/test/Transforms/MergeFunc/alias.ll index e58ab34..e4fe1b8 100644 --- a/llvm/test/Transforms/MergeFunc/alias.ll +++ b/llvm/test/Transforms/MergeFunc/alias.ll @@ -3,25 +3,25 @@ ; Aliases should always be created for the weak functions, and ; for external functions if there is no local function -; CHECK: @external_external_2 = unnamed_addr alias void (float*), bitcast (void (i32*)* @external_external_1 to void (float*)*) -; CHECK: @weak_weak_2 = weak unnamed_addr alias void (float*), bitcast (void (i32*)* @0 to void (float*)*) -; CHECK: @weak_weak_1 = weak unnamed_addr alias void (i32*), void (i32*)* @0 -; CHECK: @weak_external_1 = weak unnamed_addr alias void (i32*), bitcast (void (float*)* @weak_external_2 to void (i32*)*) -; CHECK: @external_weak_2 = weak unnamed_addr alias void (float*), bitcast (void (i32*)* @external_weak_1 to void (float*)*) -; CHECK: @weak_internal_1 = weak unnamed_addr alias void (i32*), bitcast (void (float*)* @weak_internal_2 to void (i32*)*) -; CHECK: @internal_weak_2 = weak unnamed_addr alias void (float*), bitcast (void (i32*)* @internal_weak_1 to void (float*)*) +; CHECK: @external_external_2 = unnamed_addr alias void (ptr), ptr @external_external_1 +; CHECK: @weak_weak_2 = weak unnamed_addr alias void (ptr), ptr @0 +; CHECK: @weak_weak_1 = weak unnamed_addr alias void (ptr), ptr @0 +; CHECK: @weak_external_1 = weak unnamed_addr alias void (ptr), ptr @weak_external_2 +; CHECK: @external_weak_2 = weak unnamed_addr alias void (ptr), ptr @external_weak_1 +; CHECK: @weak_internal_1 = weak unnamed_addr alias void (ptr), ptr @weak_internal_2 +; CHECK: @internal_weak_2 = weak unnamed_addr alias void (ptr), ptr @internal_weak_1 ; A strong backing function had to be created for the weak-weak pair -; CHECK: define private void @0(i32* %a) unnamed_addr +; CHECK: define private void @0(ptr %a) unnamed_addr ; CHECK-NEXT: call void @dummy4() ; These internal functions are dropped in favor of the external ones -; CHECK-NOT: define internal void @external_internal_2(float *%a) unnamed_addr -; CHECK-NOT: define internal void @internal_external_1(i32 *%a) unnamed_addr -; CHECK-NOT: define internal void @internal_external_1(i32 *%a) unnamed_addr -; CHECK-NOT: define internal void @internal_external_2(float *%a) unnamed_addr +; CHECK-NOT: define internal void @external_internal_2(ptr %a) unnamed_addr +; CHECK-NOT: define internal void @internal_external_1(ptr %a) unnamed_addr +; CHECK-NOT: define internal void @internal_external_1(ptr %a) unnamed_addr +; CHECK-NOT: define internal void @internal_external_2(ptr %a) unnamed_addr ; Only used to mark which functions should be merged. declare void @dummy1() @@ -34,83 +34,83 @@ declare void @dummy7() declare void @dummy8() declare void @dummy9() -define void @external_external_1(i32 *%a) unnamed_addr { +define void @external_external_1(ptr %a) unnamed_addr { call void @dummy1() ret void } -define void @external_external_2(float *%a) unnamed_addr { +define void @external_external_2(ptr %a) unnamed_addr { call void @dummy1() ret void } -define void @external_internal_1(i32 *%a) unnamed_addr { +define void @external_internal_1(ptr %a) unnamed_addr { call void @dummy2() ret void } -define internal void @external_internal_2(float *%a) unnamed_addr { +define internal void @external_internal_2(ptr %a) unnamed_addr { call void @dummy2() ret void } -define internal void @internal_external_1(i32 *%a) unnamed_addr { +define internal void @internal_external_1(ptr %a) unnamed_addr { call void @dummy3() ret void } -define void @internal_external_2(float *%a) unnamed_addr { +define void @internal_external_2(ptr %a) unnamed_addr { call void @dummy3() ret void } -define weak void @weak_weak_1(i32 *%a) unnamed_addr { +define weak void @weak_weak_1(ptr %a) unnamed_addr { call void @dummy4() ret void } -define weak void @weak_weak_2(float *%a) unnamed_addr { +define weak void @weak_weak_2(ptr %a) unnamed_addr { call void @dummy4() ret void } -define weak void @weak_external_1(i32 *%a) unnamed_addr { +define weak void @weak_external_1(ptr %a) unnamed_addr { call void @dummy5() ret void } -define external void @weak_external_2(float *%a) unnamed_addr { +define external void @weak_external_2(ptr %a) unnamed_addr { call void @dummy5() ret void } -define external void @external_weak_1(i32 *%a) unnamed_addr { +define external void @external_weak_1(ptr %a) unnamed_addr { call void @dummy6() ret void } -define weak void @external_weak_2(float *%a) unnamed_addr { +define weak void @external_weak_2(ptr %a) unnamed_addr { call void @dummy6() ret void } -define weak void @weak_internal_1(i32 *%a) unnamed_addr { +define weak void @weak_internal_1(ptr %a) unnamed_addr { call void @dummy7() ret void } -define internal void @weak_internal_2(float *%a) unnamed_addr { +define internal void @weak_internal_2(ptr %a) unnamed_addr { call void @dummy7() ret void } -define internal void @internal_weak_1(i32 *%a) unnamed_addr { +define internal void @internal_weak_1(ptr %a) unnamed_addr { call void @dummy8() ret void } -define weak void @internal_weak_2(float *%a) unnamed_addr { +define weak void @internal_weak_2(ptr %a) unnamed_addr { call void @dummy8() ret void } -define internal void @internal_internal_1(i32 *%a) unnamed_addr { +define internal void @internal_internal_1(ptr %a) unnamed_addr { call void @dummy9() ret void } -define internal void @internal_internal_2(float *%a) unnamed_addr { +define internal void @internal_internal_2(ptr %a) unnamed_addr { call void @dummy9() ret void } diff --git a/llvm/test/Transforms/MergeFunc/alloca.ll b/llvm/test/Transforms/MergeFunc/alloca.ll index 6a36bb7..2662243 100644 --- a/llvm/test/Transforms/MergeFunc/alloca.ll +++ b/llvm/test/Transforms/MergeFunc/alloca.ll @@ -12,25 +12,23 @@ target datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32" ; CHECK-LABEL: define void @size1 ; CHECK-NOT: call void @ -define void @size1(i8 *%f) { +define void @size1(ptr %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) + call void %f(ptr %v) + call void %f(ptr %v) + call void %f(ptr %v) + call void %f(ptr %v) ret void } ; CHECK-LABEL: define void @size2 ; CHECK-NOT: call void @ -define void @size2(i8 *%f) { +define void @size2(ptr %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) + call void %f(ptr %v) + call void %f(ptr %v) + call void %f(ptr %v) + call void %f(ptr %v) ret void } @@ -38,24 +36,22 @@ define void @size2(i8 *%f) { ; CHECK-LABEL: define void @align1 ; CHECK-NOT: call void @ -define void @align1(i8 *%f) { +define void @align1(ptr %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) + call void %f(ptr %v) + call void %f(ptr %v) + call void %f(ptr %v) + call void %f(ptr %v) ret void } ; CHECK-LABEL: define void @align2 ; CHECK-NOT: call void @ -define void @align2(i8 *%f) { +define void @align2(ptr %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) + call void %f(ptr %v) + call void %f(ptr %v) + call void %f(ptr %v) + call void %f(ptr %v) ret void } diff --git a/llvm/test/Transforms/MergeFunc/apply_function_attributes.ll b/llvm/test/Transforms/MergeFunc/apply_function_attributes.ll index 7578899..a0fc346 100644 --- a/llvm/test/Transforms/MergeFunc/apply_function_attributes.ll +++ b/llvm/test/Transforms/MergeFunc/apply_function_attributes.ll @@ -6,27 +6,27 @@ %Di = type <{ i32 }> %Si = type <{ i32 }> -define void @B(%Opaque_type* sret(%Opaque_type) %a, %S2i* %b, i32* %xp, i32* %yp) { - %x = load i32, i32* %xp - %y = load i32, i32* %yp +define void @B(ptr sret(%Opaque_type) %a, ptr %b, ptr %xp, ptr %yp) { + %x = load i32, ptr %xp + %y = load i32, ptr %yp %sum = add i32 %x, %y %sum2 = add i32 %sum, %y %sum3 = add i32 %sum2, %y ret void } -define void @C(%Opaque_type* sret(%Opaque_type) %a, %S2i* %b, i32* %xp, i32* %yp) { - %x = load i32, i32* %xp - %y = load i32, i32* %yp +define void @C(ptr sret(%Opaque_type) %a, ptr %b, ptr %xp, ptr %yp) { + %x = load i32, ptr %xp + %y = load i32, ptr %yp %sum = add i32 %x, %y %sum2 = add i32 %sum, %y %sum3 = add i32 %sum2, %y ret void } -define void @A(%Opaque_type* sret(%Opaque_type) %a, %D2i* %b, i32* %xp, i32* %yp) { - %x = load i32, i32* %xp - %y = load i32, i32* %yp +define void @A(ptr sret(%Opaque_type) %a, ptr %b, ptr %xp, ptr %yp) { + %x = load i32, ptr %xp + %y = load i32, ptr %yp %sum = add i32 %x, %y %sum2 = add i32 %sum, %y %sum3 = add i32 %sum2, %y @@ -34,14 +34,13 @@ define void @A(%Opaque_type* sret(%Opaque_type) %a, %D2i* %b, i32* %xp, i32* %yp } ; 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(%Opaque_type) %0, %S2i* %1, i32* %2, i32* %3) +; CHECK-LABEL: define void @C(ptr sret +; CHECK: tail call void @A(ptr sret(%Opaque_type) %0, ptr %1, ptr %2, ptr %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(%Opaque_type) %0, %D2i* %5, i32* %2, i32* %3) +; CHECK-LABEL: define void @B(ptr sret +; CHECK: tail call void @A(ptr sret(%Opaque_type) %0, ptr %1, ptr %2, ptr %3) ; CHECK: ret void diff --git a/llvm/test/Transforms/MergeFunc/byval-attr-congruent-type.ll b/llvm/test/Transforms/MergeFunc/byval-attr-congruent-type.ll index b060d17..ce521fa 100644 --- a/llvm/test/Transforms/MergeFunc/byval-attr-congruent-type.ll +++ b/llvm/test/Transforms/MergeFunc/byval-attr-congruent-type.ll @@ -6,14 +6,14 @@ @d = external dso_local global %struct.c -define void @e(%struct.a* byval(%struct.a) %f) { +define void @e(ptr byval(%struct.a) %f) { ; CHECK-LABEL: @e( ; CHECK-NEXT: ret void ; ret void } -define void @g(%struct.c* byval(%struct.c) %f) { +define void @g(ptr byval(%struct.c) %f) { ; CHECK-LABEL: @g( ; CHECK-NEXT: ret void ; @@ -22,9 +22,9 @@ define void @g(%struct.c* byval(%struct.c) %f) { define void @h() { ; CHECK-LABEL: @h( -; CHECK-NEXT: call void bitcast (void (%struct.a*)* @e to void (%struct.c*)*)(%struct.c* byval(%struct.c) @d) +; CHECK-NEXT: call void @e(ptr byval(%struct.c) @d) ; CHECK-NEXT: ret void ; - call void @g(%struct.c* byval(%struct.c) @d) + call void @g(ptr byval(%struct.c) @d) ret void } diff --git a/llvm/test/Transforms/MergeFunc/byval-attr-type.ll b/llvm/test/Transforms/MergeFunc/byval-attr-type.ll index 0925f52..8041249 100644 --- a/llvm/test/Transforms/MergeFunc/byval-attr-type.ll +++ b/llvm/test/Transforms/MergeFunc/byval-attr-type.ll @@ -5,19 +5,19 @@ define internal void @foo() { ; CHECK: define internal void @foo() - call void @callee_i32(i32* byval(i32) @i) + call void @callee_i32(ptr byval(i32) @i) ret void } define internal void @bar() { ; CHECK: define internal void @bar() - call void @callee_float(float* byval(float) @f) + call void @callee_float(ptr byval(float) @f) ret void } define internal void @baz() { ; CHECK-NOT: define{{.*}}@bar - call void @callee_float(float* byval(float) @f) + call void @callee_float(ptr byval(float) @f) ret void } @@ -33,5 +33,5 @@ define void @user() { ret void } -declare void @callee_i32(i32* byval(i32)) -declare void @callee_float(float* byval(float)) +declare void @callee_i32(ptr byval(i32)) +declare void @callee_float(ptr byval(float)) diff --git a/llvm/test/Transforms/MergeFunc/call-and-invoke-with-ranges.ll b/llvm/test/Transforms/MergeFunc/call-and-invoke-with-ranges.ll index 9a2dfa0..e7718ca 100644 --- a/llvm/test/Transforms/MergeFunc/call-and-invoke-with-ranges.ll +++ b/llvm/test/Transforms/MergeFunc/call-and-invoke-with-ranges.ll @@ -26,18 +26,18 @@ define i8 @call_different_range() { ret i8 %out } -define i8 @invoke_with_range() personality i8* undef { +define i8 @invoke_with_range() personality ptr 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 + %pad = landingpad { ptr, i32 } cleanup + resume { ptr, i32 } zeroinitializer } -define i8 @invoke_no_range() personality i8* undef { +define i8 @invoke_no_range() personality ptr undef { ; CHECK-LABEL: @invoke_no_range() ; CHECK-NEXT: invoke i8 @dummy %out = invoke i8 @dummy() to label %next unwind label %lpad @@ -46,11 +46,11 @@ next: ret i8 %out lpad: - %pad = landingpad { i8*, i32 } cleanup - resume { i8*, i32 } zeroinitializer + %pad = landingpad { ptr, i32 } cleanup + resume { ptr, i32 } zeroinitializer } -define i8 @invoke_different_range() personality i8* undef { +define i8 @invoke_different_range() personality ptr undef { ; CHECK-LABEL: @invoke_different_range() ; CHECK-NEXT: invoke i8 @dummy %out = invoke i8 @dummy() to label %next unwind label %lpad, !range !1 @@ -59,11 +59,11 @@ next: ret i8 %out lpad: - %pad = landingpad { i8*, i32 } cleanup - resume { i8*, i32 } zeroinitializer + %pad = landingpad { ptr, i32 } cleanup + resume { ptr, i32 } zeroinitializer } -define i8 @invoke_with_same_range() personality i8* undef { +define i8 @invoke_with_same_range() personality ptr 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 @@ -72,8 +72,8 @@ next: ret i8 %out lpad: - %pad = landingpad { i8*, i32 } cleanup - resume { i8*, i32 } zeroinitializer + %pad = landingpad { ptr, i32 } cleanup + resume { ptr, i32 } zeroinitializer } define i8 @call_with_same_range() { diff --git a/llvm/test/Transforms/MergeFunc/comdat.ll b/llvm/test/Transforms/MergeFunc/comdat.ll index afad910..f6e1046 100644 --- a/llvm/test/Transforms/MergeFunc/comdat.ll +++ b/llvm/test/Transforms/MergeFunc/comdat.ll @@ -1,6 +1,6 @@ ; RUN: opt -S -passes=mergefunc %s | FileCheck %s -@symbols = linkonce_odr global <{ i8*, i8* }> <{ i8* bitcast (i32 (i32, i32)* @f to i8*), i8* bitcast (i32 (i32, i32)* @g to i8*) }> +@symbols = linkonce_odr global <{ ptr, ptr }> <{ ptr @f, ptr @g }> $f = comdat any $g = comdat any diff --git a/llvm/test/Transforms/MergeFunc/crash.ll b/llvm/test/Transforms/MergeFunc/crash.ll index 1436c91..abfdf40 100644 --- a/llvm/test/Transforms/MergeFunc/crash.ll +++ b/llvm/test/Transforms/MergeFunc/crash.ll @@ -5,12 +5,12 @@ target triple = "i386-pc-linux-gnu" %.qux.2496 = type { i32, %.qux.2497 } %.qux.2497 = type { i8, i32 } -%.qux.2585 = type { i32, i32, i8* } +%.qux.2585 = type { i32, i32, ptr } @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*)] +@g3 = internal unnamed_addr constant [1 x ptr] [ptr @func35] -define internal i32 @func1(i32* %ptr, { i32, i32 }* nocapture %method) align 2 { +define internal i32 @func1(ptr %ptr, ptr nocapture %method) align 2 { br label %1 ;