[all-commits] [llvm/llvm-project] 1d1893: [SystemZ] Don't use FP Load and Test as comparison...

Jonas Paulsson via All-commits all-commits at lists.llvm.org
Mon Jan 15 10:36:53 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1d1893097a6319a6402331a54a588b1a5d961808
      https://github.com/llvm/llvm-project/commit/1d1893097a6319a6402331a54a588b1a5d961808
  Author: Jonas Paulsson <paulson1 at linux.ibm.com>
  Date:   2024-01-15 (Mon, 15 Jan 2024)

  Changed paths:
    M llvm/lib/Target/SystemZ/SystemZElimCompare.cpp
    M llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
    M llvm/lib/Target/SystemZ/SystemZInstrFP.td
    M llvm/lib/Target/SystemZ/SystemZInstrFormats.td
    M llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp
    M llvm/lib/Target/SystemZ/SystemZPatterns.td
    M llvm/lib/Target/SystemZ/SystemZScheduleZ13.td
    M llvm/lib/Target/SystemZ/SystemZScheduleZ14.td
    M llvm/lib/Target/SystemZ/SystemZScheduleZ15.td
    M llvm/lib/Target/SystemZ/SystemZScheduleZ16.td
    M llvm/lib/Target/SystemZ/SystemZScheduleZ196.td
    M llvm/lib/Target/SystemZ/SystemZScheduleZEC12.td
    M llvm/test/CodeGen/SystemZ/fp-cmp-04.ll
    R llvm/test/CodeGen/SystemZ/fp-cmp-07.mir
    A llvm/test/CodeGen/SystemZ/fp-cmp-zero.ll
    M llvm/test/CodeGen/SystemZ/fp-strict-cmp-04.ll
    M llvm/test/CodeGen/SystemZ/tdc-06.ll
    M llvm/test/CodeGen/SystemZ/vec-max-05.ll
    M llvm/test/CodeGen/SystemZ/vec-min-05.ll

  Log Message:
  -----------
  [SystemZ] Don't use FP Load and Test as comparisons to same reg (#78074)

The usage of FP Load and Test instructions as a comparison against zero
with the assumption that the dest reg will always reflect the source reg is
actually incorrect: Unfortunately, a SNaN will be converted to a QNaN, so the
instruction may actually change the value as opposed to being a pure register
move with a test.

This patch
- changes instruction selection to always emit FP LT with a scratch def
  reg, which will typically be allocated to the same reg if dead.
- Removes the conversions into FP LT in SystemZElimcompare.




More information about the All-commits mailing list