[llvm] [CFI][annotation] Leave alone function pointers in function annotations (PR #80173)

via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 8 10:37:18 PST 2024


================
@@ -0,0 +1,46 @@
+; RUN: opt -passes=lowertypetests %s -o %t.o
----------------
yozhu wrote:

The issue turns out to be that I dropped attribute and type specifications:

- With the following the problem will reproduce:

` define i32 @bar(i32 noundef %0) #0 !type !8 !type !9 {`

- And with the following the problem doesn't reproduce:

` define i32 @bar(i32 noundef %0) {`

`#0`, `!8` and `!9` are defined as:

```
attributes #0 = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+neon,+v8a,-fmv" }
 60 !8 = !{i64 0, !"_ZTSFiiE"}
 61 !9 = !{i64 0, !"_ZTSFiiE.generalized"}
```

Also it appears that the test code can't be made too simple because otherwise indirect call target will be easy to figure out by optimizations and then CFI has nowhere to apply.

https://github.com/llvm/llvm-project/pull/80173


More information about the llvm-commits mailing list