[all-commits] [llvm/llvm-project] d30926: [llvm][InstCombine] bitcast bfloat half castpair b...

Nashe Mncube via All-commits all-commits at lists.llvm.org
Wed Jan 31 03:42:22 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d309261d05cf173e6a18b20be986877fd87fe4f3
      https://github.com/llvm/llvm-project/commit/d309261d05cf173e6a18b20be986877fd87fe4f3
  Author: Nashe Mncube <nashe.mncube at arm.com>
  Date:   2024-01-31 (Wed, 31 Jan 2024)

  Changed paths:
    M llvm/lib/IR/Instructions.cpp
    A llvm/test/Transforms/InstCombine/bitcast-bfloat-half-mixing.ll

  Log Message:
  -----------
  [llvm][InstCombine] bitcast bfloat half castpair bug (#79832)

Miscompilation arises due to instruction combining of cast pairs of the
type `bitcast bfloat to half` + `<FPOp> bfloat to half` or `bitcast half
to bfloat` + `<FPOp half to bfloat`. For example `bitcast bfloat to
half`+`fpext half to double` or `bitcast bfloat to half`+`fpext bfloat
to double` respectively reduce to `fpext bfloat to double` and `fpext
half to double`. This is an incorrect conversion as it assumes the
representation of `bfloat` and `half` are equivalent due to having the
same width. As a consequence miscompilation arises.

Fixes #61984




More information about the All-commits mailing list