[PATCH] D147982: Account for PATCHABLE instrs in Branch Relaxation
    Jessica Paquette via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Tue Apr 11 10:50:33 PDT 2023
    
    
  
paquette added inline comments.
================
Comment at: llvm/lib/CodeGen/TargetInstrInfo.cpp:1653
   // expands to special code sequences which must be present.
   auto First = MBB.getFirstNonDebugInstr();
+  if (First == MBB.end())
----------------
I think this could be a `llvm::find_if`?
```
return find_if(MBB.getFirstNonDebugInstr(), MBB.getLastNonDebugInstr(), [](const MachineInstr &MI) {
   unsigned Opc = MI.getOpcode();
   switch(Opc) {
      default:
          return false;
      case TargetOpcode::FENTRY_CALL:
      ...
         return true;
   }
}) != MBB.end();
```
That'd make it easy to add new opcodes/remove opcodes.
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147982/new/
https://reviews.llvm.org/D147982
    
    
More information about the llvm-commits
mailing list