mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 12:12:47 +01:00
1374d1a4d3
There are only two used in the IR optimization pipeline. Port these and add them to the default pipeline. Similar to https://reviews.llvm.org/D93863. I added -mtriple to some tests since under the new PM, the passes are only available when the TargetMachine is specified. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D93930
15 lines
559 B
LLVM
15 lines
559 B
LLVM
; RUN: opt < %s -S -mtriple=nvptx-nvidia-cuda -nvvm-reflect | FileCheck %s
|
|
; RUN: opt < %s -S -mtriple=nvptx-nvidia-cuda -passes=nvvm-reflect | FileCheck %s
|
|
|
|
declare i32 @__nvvm_reflect(i8*)
|
|
@str = private unnamed_addr addrspace(1) constant [11 x i8] c"__CUDA_FTZ\00"
|
|
|
|
define i32 @foo() {
|
|
%call = call i32 @__nvvm_reflect(i8* addrspacecast (i8 addrspace(1)* getelementptr inbounds ([11 x i8], [11 x i8] addrspace(1)* @str, i32 0, i32 0) to i8*))
|
|
; CHECK: ret i32 42
|
|
ret i32 %call
|
|
}
|
|
|
|
!llvm.module.flags = !{!0}
|
|
!0 = !{i32 4, !"nvvm-reflect-ftz", i32 42}
|