[PATCH] D135411: Add generic KCFI operand bundle lowering

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 7 13:57:45 PDT 2022


nickdesaulniers accepted this revision.
nickdesaulniers added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/lib/Transforms/Instrumentation/KCFI.cpp:48-49
+  SmallVector<CallInst *, 8> KCFICalls;
+  for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I) {
+    if (auto *CI = dyn_cast<CallInst>(&*I))
+      if (CI->getOperandBundle(LLVMContext::OB_kcfi))
----------------
prefer a range-for here
```
for (Instruction &I : F)
  if (auto &CI = dyn_cast<CallInst>(I);
```


================
Comment at: llvm/lib/Transforms/Instrumentation/KCFI.cpp:77
+    // Drop the KCFI operand bundle.
+    auto *Call = CallBase::removeOperandBundle(CI, LLVMContext::OB_kcfi, CI);
+    assert(Call != CI);
----------------
`CallBase *Call = ...`


================
Comment at: llvm/test/Transforms/KCFI/kcfi-supported.ll:4
+
+; COM: If the back-end supports KCFI operand bundle lowering, KCFIPass should be a no-op.
+
----------------
COM?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135411/new/

https://reviews.llvm.org/D135411



More information about the cfe-commits mailing list