[all-commits] [llvm/llvm-project] 5b3eb1: [ARM][X86][NFC] Use lambda to avoid duplicate swit...

Alex Bradbury via All-commits all-commits at lists.llvm.org
Wed Nov 15 04:35:49 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5b3eb1bc22d462a7c985614e4503bcf2c295341c
      https://github.com/llvm/llvm-project/commit/5b3eb1bc22d462a7c985614e4503bcf2c295341c
  Author: Alex Bradbury <asb at igalia.com>
  Date:   2023-11-15 (Wed, 15 Nov 2023)

  Changed paths:
    M llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
    M llvm/lib/Target/X86/X86InstrInfo.cpp

  Log Message:
  -----------
  [ARM][X86][NFC] Use lambda to avoid duplicate switches in areLoadsFromSameBasePtr (#72376)

Both the Arm and X86 implementations of areLoadsFromSameBasePtr use a
switch over the machine opcode, and repeat the same logic for both
SDNode operands. We can avoid the duplicated logic (especially lengthy
in the X86 case) by just using a lambda. This could obviously be a
candidate for moving out to a separate helper function if there were
other users, but I've made the minimal change in this patch.




More information about the All-commits mailing list