[llvm] [CFI] Fix Direct Call Issues in CFI Dispatch Table (PR #69663)

Oskar Wirga via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 10 07:52:12 PST 2023


================
@@ -1471,6 +1471,11 @@ void LowerTypeTestsModule::createJumpTable(
   SmallVector<Value *, 16> AsmArgs;
   AsmArgs.reserve(Functions.size() * 2);
 
+  // Check if the first entry has the NoUnwind attribute.
----------------
oskarwirga wrote:

I wonder if its even worth bothering with this special case and just unequivocally removing NoUnwind for the `cfi.jumptable` function. We would lose out on the optimization of removing unwind information only when:

1. A function marked NoUnwind is used as an indirect function
2. It is the only indirect function with that type signature in the link time unit
3. The link time unit is built without `-fsanitize-cfi-cross-dso`
4. The `cfi.jumptable` function gets directly replaced for that indirect call

I don't think the added code complexity is worth this rare optimization. 

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


More information about the llvm-commits mailing list