[all-commits] [llvm/llvm-project] b25b51: [InlineSpiller] Check rematerialization before fol...

weiguozhi via All-commits all-commits at lists.llvm.org
Mon Apr 28 09:52:26 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b25b51eb639da2e726c95bef00409e0d3913435d
      https://github.com/llvm/llvm-project/commit/b25b51eb639da2e726c95bef00409e0d3913435d
  Author: weiguozhi <57237827+weiguozhi at users.noreply.github.com>
  Date:   2025-04-28 (Mon, 28 Apr 2025)

  Changed paths:
    M llvm/include/llvm/CodeGen/Spiller.h
    M llvm/lib/CodeGen/InlineSpiller.cpp
    M llvm/lib/CodeGen/RegAllocGreedy.cpp
    M llvm/test/CodeGen/X86/avx-cmp.ll
    M llvm/test/CodeGen/X86/eq-or-eq-range-of-2.ll
    M llvm/test/CodeGen/X86/fold-int-pow2-with-fmul-or-fdiv.ll
    M llvm/test/CodeGen/X86/fptosi-sat-vector-128.ll
    M llvm/test/CodeGen/X86/fptoui-sat-vector-128.ll
    M llvm/test/CodeGen/X86/mmx-fold-zero.ll
    M llvm/test/CodeGen/X86/vector-interleaved-load-i8-stride-7.ll

  Log Message:
  -----------
  [InlineSpiller] Check rematerialization before folding operand (#134015)

Current implementation tries to fold the operand before
rematerialization because it can reduce one register usage. But if there
is a physical register available we can still rematerialize it without
causing high register pressure.

This patch do this check to find the better choice. Then we can produce

    xorps %xmm1, %xmm1
    ucomiss %xmm1, %xmm0

instead of 

    ucomiss LCPI0_1(%rip), %xmm0



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