Index: lib/Transforms/Utils/FunctionComparator.cpp =================================================================== --- lib/Transforms/Utils/FunctionComparator.cpp +++ lib/Transforms/Utils/FunctionComparator.cpp @@ -710,7 +710,7 @@ return Res; if (int Res = cmpNumbers(L->getDialect(), R->getDialect())) return Res; - llvm_unreachable("InlineAsm blocks were not uniqued."); + assert(L->getFunctionType() != R->getFunctionType()); return 0; } Index: test/Transforms/MergeFunc/inline-asm.ll =================================================================== --- /dev/null +++ test/Transforms/MergeFunc/inline-asm.ll @@ -0,0 +1,35 @@ +; RUN: opt -mergefunc -S < %s | FileCheck %s +define internal void @float_ptr_arg() { + call void asm "nop", "r"(float* null) + ret void +} + +define internal void @int_ptr_arg() { +; CHECK-NOT: @int_ptr_arg() + call void asm "nop", "r"(i32* null) + ret void +} + +define internal void @float_ptr_ret() { + call float* asm "nop", "=r"() + ret void +} + +define internal void @int_ptr_ret() { +; CHECK-NOT: @int_ptr_ret() + call i32* asm "nop", "=r"() + ret void +} + +define void @do_calls() { +; CHECK-LABEL: @do_calls +; CHECK-NEXT call void @float_ptr_arg() +; CHECK-NEXT call void @float_ptr_arg() +; CHECK-NEXT call void @float_ptr_ret() +; CHECK-NEXT call void @float_ptr_ret() + call void @float_ptr_arg() + call void @int_ptr_arg() + call void @float_ptr_ret() + call void @int_ptr_ret() + ret void +}