diff options
| author | Artur Pilipenko <apilipenko@azulsystems.com> | 2016-06-23 15:25:09 +0000 |
|---|---|---|
| committer | Artur Pilipenko <apilipenko@azulsystems.com> | 2016-06-23 15:25:09 +0000 |
| commit | f0c9f813796cd0cf210ba21833c5cfbaa7d65399 (patch) | |
| tree | 53582157dfa1bdee5e81241e84dc0fe3bcb7735a /llvm/test | |
| parent | b1a2b5a708ec9993ec6c7a5eb2068864b109a43c (diff) | |
| download | bcm5719-llvm-f0c9f813796cd0cf210ba21833c5cfbaa7d65399.tar.gz bcm5719-llvm-f0c9f813796cd0cf210ba21833c5cfbaa7d65399.zip | |
Remangle intrinsics names when types are renamed
This is a fix for the problem mentioned in "LTO and intrinsics mangling" llvm-dev mail thread:
http://lists.llvm.org/pipermail/llvm-dev/2016-April/098387.html
Reviewers: mehdi_amini, reames
Differential Revision: http://reviews.llvm.org/D19373
llvm-svn: 273568
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/LTO/X86/Inputs/remangle_intrinsics.ll | 8 | ||||
| -rw-r--r-- | llvm/test/LTO/X86/remangle_intrinsics.ll | 20 |
2 files changed, 28 insertions, 0 deletions
diff --git a/llvm/test/LTO/X86/Inputs/remangle_intrinsics.ll b/llvm/test/LTO/X86/Inputs/remangle_intrinsics.ll new file mode 100644 index 00000000000..75f6fd19c0d --- /dev/null +++ b/llvm/test/LTO/X86/Inputs/remangle_intrinsics.ll @@ -0,0 +1,8 @@ +%struct.rtx_def = type { i16, i16 } + +define void @bar(%struct.rtx_def* %a, i8 %b, i32 %c) { + call void @llvm.memset.p0struct.rtx_def.i32(%struct.rtx_def* %a, i8 %b, i32 %c, i32 4, i1 true) + ret void +} + +declare void @llvm.memset.p0struct.rtx_def.i32(%struct.rtx_def*, i8, i32, i32, i1) diff --git a/llvm/test/LTO/X86/remangle_intrinsics.ll b/llvm/test/LTO/X86/remangle_intrinsics.ll new file mode 100644 index 00000000000..e7ccaf7c937 --- /dev/null +++ b/llvm/test/LTO/X86/remangle_intrinsics.ll @@ -0,0 +1,20 @@ +; RUN: llvm-as < %s > %t1 +; RUN: llvm-as < %p/Inputs/remangle_intrinsics.ll > %t2 +; RUN: llvm-lto %t1 %t2 | FileCheck %s + +; We have "struct.rtx_def" type in both modules being LTOed. Both modules use +; an overloaded intrinsic which has this type in its signature/name. When +; modules are loaded one of the types is renamed to "struct.rtx_def.0". +; The intrinsic which uses this type should be remangled/renamed as well. +; If we didn't do that verifier would complain. + +; CHECK: Wrote native object file + +%struct.rtx_def = type { i16 } + +define void @foo(%struct.rtx_def* %a, i8 %b, i32 %c) { + call void @llvm.memset.p0struct.rtx_def.i32(%struct.rtx_def* %a, i8 %b, i32 %c, i32 4, i1 true) + ret void +} + +declare void @llvm.memset.p0struct.rtx_def.i32(%struct.rtx_def*, i8, i32, i32, i1) |

