[all-commits] [llvm/llvm-project] 768a1c: [SelectionDAG] Fold abs(undef) to 0 instead of undef.

Craig Topper via All-commits all-commits at lists.llvm.org
Sun May 22 12:56:32 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 768a1ca5eccb678947f4155e38a5f5744dcefb56
      https://github.com/llvm/llvm-project/commit/768a1ca5eccb678947f4155e38a5f5744dcefb56
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2022-05-22 (Sun, 22 May 2022)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
    A llvm/test/CodeGen/X86/pr55271.ll

  Log Message:
  -----------
  [SelectionDAG] Fold abs(undef) to 0 instead of undef.

abs should only produce a positive value or the signed minimum
value. This means we can't fold abs(undef) to undef as that would
allow more values. Fold to 0 instead to match InstSimplify.

Fixes test mentioned in comment on pr55271.

Reviewed By: nikic

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




More information about the All-commits mailing list