[all-commits] [llvm/llvm-project] 8aae19: [BPF] Remove 'may_goto 0' instructions (#123482)

yonghong-song via All-commits all-commits at lists.llvm.org
Tue Jan 28 15:19:30 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8aae191cb6ad1f2dfc468975e4f5e564fea3cbfd
      https://github.com/llvm/llvm-project/commit/8aae191cb6ad1f2dfc468975e4f5e564fea3cbfd
  Author: yonghong-song <yhs at fb.com>
  Date:   2025-01-28 (Tue, 28 Jan 2025)

  Changed paths:
    M llvm/lib/Target/BPF/BPFMIPeephole.cpp
    A llvm/test/CodeGen/BPF/may_goto_1.ll
    A llvm/test/CodeGen/BPF/may_goto_2.ll

  Log Message:
  -----------
  [BPF] Remove 'may_goto 0' instructions (#123482)

Emil Tsalapatis from Meta reported such a case where 'may_goto 0' insn
is generated by clang compiler. But 'may_goto 0' insn is actually a
no-op so it makes sense to remove that in llvm. The patch is also able
to handle the following code pattern
```
   ...
   may_goto 2
   may_goto 1
   may_goto 0
   ...
```
where three may_goto insns can all be removed.

---------

Co-authored-by: Yonghong Song <yonghong.song at linux.dev>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list