1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00
llvm-mirror/test/LTO/X86/remangle_intrinsics.ll
Matt Arsenault 01d726ce5c IR: Add immarg attribute
This indicates an intrinsic parameter is required to be a constant,
and should not be replaced with a non-constant value.

Add the attribute to all AMDGPU and generic intrinsics that comments
indicate it should apply to. I scanned other target intrinsics, but I
don't see any obvious comments indicating which arguments are intended
to be only immediates.

This breaks one questionable testcase for the autoupgrade. I'm unclear
on whether the autoupgrade is supposed to really handle declarations
which were never valid. The verifier fails because the attributes now
refer to a parameter past the end of the argument list.

llvm-svn: 355981
2019-03-12 21:02:54 +00:00

22 lines
810 B
LLVM

; RUN: llvm-as < %s > %t1
; RUN: llvm-as < %p/Inputs/remangle_intrinsics.ll > %t2
; RUN: llvm-lto %t1 %t2 | FileCheck %s
; REQUIRES: default_triple
; 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* align 4 %a, i8 %b, i32 %c, i1 true)
ret void
}
declare void @llvm.memset.p0struct.rtx_def.i32(%struct.rtx_def*, i8, i32, i1)