[PATCH] D101736: [WebAssembly] Allow DBG_VALUE after terminator in MachineVerifier

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 3 20:11:50 PDT 2021


aheejin added inline comments.


================
Comment at: llvm/lib/CodeGen/MachineVerifier.cpp:803
+  // DBG_VALUE $noreg, $noreg, !"variable", ...
+  if (TM->getTargetTriple().isWasm() && FirstTerminator && MI->isDebugValue() &&
+      MI->getOperand(0).isReg() && MI->getOperand(1).isReg() &&
----------------
dschuff wrote:
> I guess the inclusion of `FirstTerminator` means that if there is a `br_if` followed by a `br` or whatever, then we only allow DBG_VALUE after the `br_if` which makes sense.
> Would this miss the case where there is only one terminator (i.e. just a `br`, in which case it would also be the first terminator), or is `FirstTerminator` not set in that case?
> 
`FirstTerminator` is set whenever we've seen a terminator within a BB. There can be multiple terminators; in our case `br_if` followed by `br`, and there will be more in other targets. LLVM's verification rule is after any terminator occurs within a BB, only other terminator instructions can come after that. Does this answer your question? I'm not sure if I understood your question well.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101736



More information about the llvm-commits mailing list