[PATCH] D130290: [MachineVerifier] add checks for INLINEASM_BR
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 21 10:32:34 PDT 2022
arsenm added inline comments.
================
Comment at: llvm/lib/CodeGen/MachineVerifier.cpp:882
+
+ const BasicBlock *IndirectTarget = MO.getBlockAddress()->getBasicBlock();
+
----------------
Why is this based on the IR block?
================
Comment at: llvm/lib/CodeGen/MachineVerifier.cpp:899-902
+ if (llvm::none_of(MBB->successors(),
+ [IndirectTargetMBB](const MachineBasicBlock *Succ) {
+ return Succ == IndirectTargetMBB;
+ }))
----------------
arsenm wrote:
> I'd expect CFG checks to go with the others in visitMachineBasicBlockBefore
This is !MBB->isSuccessor
================
Comment at: llvm/lib/CodeGen/MachineVerifier.cpp:899-904
+ if (llvm::none_of(MBB->successors(),
+ [IndirectTargetMBB](const MachineBasicBlock *Succ) {
+ return Succ == IndirectTargetMBB;
+ }))
+ report("INLINEASM_BR indirect target missing from successor list", &MO,
+ i);
----------------
I'd expect CFG checks to go with the others in visitMachineBasicBlockBefore
================
Comment at: llvm/lib/CodeGen/MachineVerifier.cpp:906-908
+ if (llvm::none_of(
+ IndirectTargetMBB->predecessors(),
+ [MBB](const MachineBasicBlock *Pred) { return Pred == MBB; }))
----------------
this is !MBB->isPredecessor
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D130290/new/
https://reviews.llvm.org/D130290
More information about the llvm-commits
mailing list