mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-23 19:59:57 +00:00
e2c35f6c8b
Summary: Calls sometimes need to be convergent. This is already handled at the LLVM IR level, but it also needs to be handled at the MI level. Ideally we'd propagate convergence from instructions, down through the selection DAG, and into MIs. But this is Hard, and would affect optimizations in the SDNs -- right now only SDNs with two operands have any flags at all. Instead, here's a much simpler hack: Add new opcodes for NVPTX for convergent calls, and generate these when lowering convergent LLVM calls. Reviewers: jholewinski Subscribers: jholewinski, chandlerc, joker.eph, jhen, tra, llvm-commits Differential Revision: http://reviews.llvm.org/D17423 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262373 91177308-0d34-0410-b5e6-96231b3b80d8
28 lines
620 B
LLVM
28 lines
620 B
LLVM
; RUN: llc -mtriple nvptx64-nvidia-cuda -stop-after machine-cp -o - < %s 2>&1 | FileCheck %s
|
|
|
|
; Check that convergent calls are emitted using convergent MIR instructions,
|
|
; while non-convergent calls are not.
|
|
|
|
target triple = "nvptx64-nvidia-cuda"
|
|
|
|
declare void @conv() convergent
|
|
declare void @not_conv()
|
|
|
|
define void @test(void ()* %f) {
|
|
; CHECK: ConvergentCallUniPrintCall
|
|
; CHECK-NEXT: @conv
|
|
call void @conv()
|
|
|
|
; CHECK: CallUniPrintCall
|
|
; CHECK-NEXT: @not_conv
|
|
call void @not_conv()
|
|
|
|
; CHECK: ConvergentCallPrintCall
|
|
call void %f() convergent
|
|
|
|
; CHECK: CallPrintCall
|
|
call void %f()
|
|
|
|
ret void
|
|
}
|