[all-commits] [llvm/llvm-project] 7d626e: [X86] Move RDFLAGS/WRFLAGS expansion until after RA

Bill Wendling via All-commits all-commits at lists.llvm.org
Mon Jan 30 15:32:32 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7d626e7cbb3ac9b3f43a10df8d8edfab1300b156
      https://github.com/llvm/llvm-project/commit/7d626e7cbb3ac9b3f43a10df8d8edfab1300b156
  Author: Bill Wendling <morbo at google.com>
  Date:   2023-01-30 (Mon, 30 Jan 2023)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/lib/Target/X86/X86InstrInfo.cpp
    M llvm/lib/Target/X86/X86InstrInfo.td
    M llvm/test/CodeGen/X86/x86-64-flags-intrinsics.ll

  Log Message:
  -----------
  [X86] Move RDFLAGS/WRFLAGS expansion until after RA

The register allocator may introduce reloads in the middle of reading
and writing the EFLAGS register, due to the RDFLAGS & WRFLAGS pseudos
being expanded before RA. This may cause an issue where the stack
pointer was adjusted but the stack offset for the reload wasn't
accounted for (see [1]).

To avoid this, expand these pseudos after register allocation.

[1] https://github.com/llvm/llvm-project/issues/59102

Reviewed By: craig.topper, nickdesaulniers, pengfei

Differential Revision: https://reviews.llvm.org/D140045




More information about the All-commits mailing list