[PATCH] D113230: [WebAssembly] Fix fixBrTableIndex removing instruction without checking uses

Wouter van Oortmerssen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 8 12:30:53 PST 2021


aardappel added inline comments.


================
Comment at: llvm/lib/Target/WebAssembly/WebAssemblyFixBrTableDefaults.cpp:68-71
+    for (MachineInstr &UseMI : MF.getRegInfo().use_instructions(ExtDefReg)) {
+      if (&UseMI != &MI)
+        goto user_found;
+    }
----------------
tlively wrote:
> Looks like we probably want to use `MachineRegisterInfo::hasOneNonDBGUser(Register RegNo)` here. Hopefully that lets us get rid of the `goto` ;)
Thanks! Not sure how I managed to miss those functions. In this case `use_nodbg_empty` is the one we actually want, since the use by `br_table` has already been removed.


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

https://reviews.llvm.org/D113230



More information about the llvm-commits mailing list