[all-commits] [llvm/llvm-project] a7176f: [ConstantFold] Remove handling for icmp of bitcast

Nikita Popov via All-commits all-commits at lists.llvm.org
Fri Nov 3 04:32:52 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a7176f8a25fc6930ee7fd0cfcde4d9a96010a5a8
      https://github.com/llvm/llvm-project/commit/a7176f8a25fc6930ee7fd0cfcde4d9a96010a5a8
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2023-11-03 (Fri, 03 Nov 2023)

  Changed paths:
    M llvm/lib/IR/ConstantFold.cpp

  Log Message:
  -----------
  [ConstantFold] Remove handling for icmp of bitcast

This only handles the case where the bitcast result is an integer
or pointer, and the input is not FP. This means that the input
can only be a vector. However, converting a comparison of the
whole vector into an element-wise comparison is generally not
correct.

I assume that this code was originally intended to handle the case
where a pointer bitcast is compared to a null pointer, which is
no longer relevant with opaque pointers.

Given the complete lack of test coverage, and the risk of
miscompiles if this code actually did something, I'm opting to
remove it entirely.




More information about the All-commits mailing list