brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 2edb7d7 Raw
50 lines · plain
1; RUN: opt -S -passes=adce < %s | FileCheck %s2 3; While it is normally okay to DCE out calls to @readonly_function and4; @readnone_function, we cannot do that if they're carrying operand5; bundles since the presence of unknown operand bundles implies6; arbitrary memory effects.7 8declare void @readonly_function() readonly nounwind willreturn9declare void @readnone_function() readnone nounwind willreturn10 11define void @test0() {12; CHECK-LABEL: @test0(13 entry:14  call void @readonly_function() [ "tag"() ]15; CHECK: call void @readonly_function16  ret void17}18 19define void @test1() {20; CHECK-LABEL: @test1(21 entry:22  call void @readnone_function() [ "tag"() ]23; CHECK: call void @readnone_function24  ret void25}26 27define void @test2() {28; CHECK-LABEL: @test2(29 entry:30; CHECK-NOT: @readonly_function(31  call void @readonly_function() readonly [ "tag"() ]32  ret void33}34 35define void @test3() {36; CHECK-LABEL: @test3(37 entry:38; CHECK-NOT: @readnone_function(39  call void @readnone_function() readnone [ "tag"() ]40  ret void41}42 43define void @test4() {44; CHECK-LABEL: @test4(45 entry:46; CHECK-NOT: @readonly_function()47  call void @readonly_function() [ "deopt"() ]48  ret void49}50