mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 15:17:25 +00:00
[PlaceSafepoints] Stop special casing some intrinsics
We were special casing a handful of intrinsics as not needing a safepoint before them. After running into another valid case - memset - I took a closer look and realized that almost no intrinsics need to have a safepoint poll before them. Restructure the code to make that apparent so that we stop hitting these bugs. The only intrinsics which need a safepoint poll before them are ones which can run arbitrary code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237744 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
20
test/Transforms/PlaceSafepoints/memset.ll
Normal file
20
test/Transforms/PlaceSafepoints/memset.ll
Normal file
@@ -0,0 +1,20 @@
|
||||
; RUN: opt -S -place-safepoints %s | FileCheck %s
|
||||
|
||||
define void @test(i32, i8 addrspace(1)* %ptr) gc "statepoint-example" {
|
||||
; CHECK-LABEL: @test
|
||||
; CHECK-NEXT: llvm.memset
|
||||
; CHECK: do_safepoint
|
||||
; CHECK: @foo
|
||||
call void @llvm.memset.p1i8.i64(i8 addrspace(1)* %ptr, i8 0, i64 24, i32 8, i1 false)
|
||||
call void @foo()
|
||||
ret void
|
||||
}
|
||||
|
||||
declare void @foo()
|
||||
declare void @llvm.memset.p1i8.i64(i8 addrspace(1)*, i8, i64, i32, i1)
|
||||
|
||||
declare void @do_safepoint()
|
||||
define void @gc.safepoint_poll() {
|
||||
call void @do_safepoint()
|
||||
ret void
|
||||
}
|
||||
Reference in New Issue
Block a user