[all-commits] [llvm/llvm-project] 841a0e: ConstantFolding: Constant fold some canonicalizes

Matt Arsenault via All-commits all-commits at lists.llvm.org
Fri Nov 18 10:35:33 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 841a0edd030d4cce2e6b764996d3372773d0089b
      https://github.com/llvm/llvm-project/commit/841a0edd030d4cce2e6b764996d3372773d0089b
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2022-11-18 (Fri, 18 Nov 2022)

  Changed paths:
    M llvm/include/llvm/IR/Type.h
    M llvm/lib/Analysis/ConstantFolding.cpp
    M llvm/test/CodeGen/AMDGPU/fcanonicalize.f16.ll
    M llvm/test/CodeGen/AMDGPU/fcanonicalize.ll
    M llvm/test/Transforms/InstSimplify/canonicalize.ll

  Log Message:
  -----------
  ConstantFolding: Constant fold some canonicalizes

+/-0 is obviously foldable. Other non-special, non-subnormal
values are also probably OK. For denormal values, check
the calling function's denormal mode. For now, don't fold
denormals to the input for IEEE mode because as far as I know
the langref is still pretending LLVM's float isn't IEEE.

Also folds undef to 0, although NaN may make more sense. Skips
folding nans and infinities, although it should be OK to fold those
in a future change.




More information about the All-commits mailing list