[all-commits] [llvm/llvm-project] d3f6dd: [InstCombine] Pick bfloat over half when shrinking...

Benjamin Kramer via All-commits all-commits at lists.llvm.org
Thu Feb 22 06:25:30 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d3f6dd6585f4866a38a794b80db55a62c1050c77
      https://github.com/llvm/llvm-project/commit/d3f6dd6585f4866a38a794b80db55a62c1050c77
  Author: Benjamin Kramer <benny.kra at googlemail.com>
  Date:   2024-02-22 (Thu, 22 Feb 2024)

  Changed paths:
    M llvm/lib/IR/Instructions.cpp
    M llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
    M llvm/test/Transforms/InstCombine/fpextend.ll

  Log Message:
  -----------
  [InstCombine] Pick bfloat over half when shrinking ops that started with an fpext from bfloat (#82493)

This fixes the case where we would shrink an frem to half and then
bitcast to bfloat, producing invalid results. The transformation was
written under the assumption that there is only one type with a given
bit width.

Also add a strategic assert to CastInst::CreateFPCast to turn this
miscompilation into a crash.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list