1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00
llvm-mirror/test/Feature/OperandBundles/adce.ll
Sanjoy Das 99ca015392 [OperandBundles] Treat "deopt" operand bundles specially
Teach LLVM optimize to more precisely in the presence of "deopt" operand
bundles.  "deopt" operand bundles imply that the call they're attached
to is at least `readonly` (i.e. they don't imply clobber semantics), and
they don't capture their bundle operands.

llvm-svn: 254118
2015-11-26 01:16:05 +00:00

50 lines
1.1 KiB
LLVM

; RUN: opt -S -adce < %s | FileCheck %s
; While it is normally okay to DCE out calls to @readonly_function and
; @readnone_function, we cannot do that if they're carrying operand
; bundles since the presence of unknown operand bundles implies
; arbitrary memory effects.
declare void @readonly_function() readonly nounwind
declare void @readnone_function() readnone nounwind
define void @test0() {
; CHECK-LABEL: @test0(
entry:
call void @readonly_function() [ "tag"() ]
; CHECK: call void @readonly_function
ret void
}
define void @test1() {
; CHECK-LABEL: @test1(
entry:
call void @readnone_function() [ "tag"() ]
; CHECK: call void @readnone_function
ret void
}
define void @test2() {
; CHECK-LABEL: @test2(
entry:
; CHECK-NOT: @readonly_function(
call void @readonly_function() readonly [ "tag"() ]
ret void
}
define void @test3() {
; CHECK-LABEL: @test3(
entry:
; CHECK-NOT: @readnone_function(
call void @readnone_function() readnone [ "tag"() ]
ret void
}
define void @test4() {
; CHECK-LABEL: @test4(
entry:
; CHECK-NOT: @readonly_function()
call void @readonly_function() [ "deopt"() ]
ret void
}