[all-commits] [llvm/llvm-project] ad9524: [PowerPC] Fix i128 vcmpequb optimization for loads...

Amy Kwan via All-commits all-commits at lists.llvm.org
Sun May 31 23:57:57 PDT 2026


  Branch: refs/heads/release/22.x
  Home:   https://github.com/llvm/llvm-project
  Commit: ad9524f3865770ed410bbc7d91fa50dc2d223027
      https://github.com/llvm/llvm-project/commit/ad9524f3865770ed410bbc7d91fa50dc2d223027
  Author: Amy Kwan <amy.kwan1 at ibm.com>
  Date:   2026-06-01 (Mon, 01 Jun 2026)

  Changed paths:
    M llvm/lib/Target/PowerPC/PPCISelLowering.cpp
    A llvm/test/CodeGen/PowerPC/ppc-i128-cmp.ll

  Log Message:
  -----------
  [PowerPC] Fix i128 vcmpequb optimization for loads with range metadata and small constants (#196801)

The combine introduced in 55aff64d2c6ef50d2ed725d7dd1fb34080486237
lowers scalar i128 compares into vector compares by reissuing the
original loads as v16i8 loads. However, the combine was reusing the
original MachineMemOperand without modification.

If the original i128 load carries !range metadata, the MMO encodes that
range using i128 values. Reusing this MMO for a v16i8 load is incorrect
as range metadata is only valid for integer scalar types and its
bitwidth must match the memory VT.

This patch fixes this by creating a new MachineMemOperand for the vector
vector load. Additionally, we restrict the combine for constant operands
to avoid cases that are better handled by scalar lowering. Small
constants (fit within 16 bits) are excluded to prevent generating
suboptimal vector compares.

(cherry picked from commit 1907b586384b51be2f6b44490c46941f08ff6974)



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