[llvm] [BOLT] Skip functions with unsupported Linux kernel features (PR #86345)

Maksim Panchenko via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 22 15:17:31 PDT 2024


================
@@ -1126,6 +1134,27 @@ Error LinuxKernelRewriter::readParaInstructions() {
   return Error::success();
 }
 
+Error LinuxKernelRewriter::rewriteParaInstructions() {
+  // Disable output of functions with paravirtual instructions before the
+  // rewrite support is complete.
+  for (BinaryFunction &BF : llvm::make_second_range(BC.getBinaryFunctions())) {
+    if (!BC.shouldEmit(BF))
+      continue;
+    for (const BinaryBasicBlock &BB : BF) {
+      if (!BC.shouldEmit(BF))
+        break;
----------------
maksfb wrote:

It's breaking, just not to the outer loop. I've refactored using `llvm::any_of()` as you suggested and it looks much cleaner now.

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


More information about the llvm-commits mailing list