[all-commits] [llvm/llvm-project] 9c86c5: [DAG] Legalize abs(x) -> umin(x, sub(0, x)) iff umin...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Wed Nov 25 10:11:12 PST 2020


  Branch: refs/heads/temp-test-main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9c86c5e8add23a29fb19f7c0ac366a2063a5073a
      https://github.com/llvm/llvm-project/commit/9c86c5e8add23a29fb19f7c0ac366a2063a5073a
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2020-11-25 (Wed, 25 Nov 2020)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
    M llvm/test/CodeGen/X86/abs.ll
    M llvm/test/CodeGen/X86/combine-abs.ll
    M llvm/test/CodeGen/X86/viabs.ll

  Log Message:
  -----------
  [DAG] Legalize abs(x) -> umin(x,sub(0,x)) iff umin/sub are legal

If umin() is legal, this is likely to result in smaller codegen expansion for abs(x) than the xor(add,ashr) method.

Followup to D92095

Alive2: https://alive2.llvm.org/ce/z/8nuX6s  https://alive2.llvm.org/ce/z/q2hB9w




More information about the All-commits mailing list