[all-commits] [llvm/llvm-project] 85eeba: [ConstantHoisting] Add back ptr->ptr bitcast to av...

Björn Pettersson via All-commits all-commits at lists.llvm.org
Mon Aug 14 02:13:43 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 85eeba48a0fefcdf6d12cf422d2060592f689823
      https://github.com/llvm/llvm-project/commit/85eeba48a0fefcdf6d12cf422d2060592f689823
  Author: Bjorn Pettersson <bjorn.a.pettersson at ericsson.com>
  Date:   2023-08-14 (Mon, 14 Aug 2023)

  Changed paths:
    M llvm/lib/Transforms/Scalar/ConstantHoisting.cpp
    M llvm/test/Transforms/ConstantHoisting/AArch64/const-hoist-gep.ll
    M llvm/test/Transforms/ConstantHoisting/ARM/const-hoist-gep-overindexing.ll
    M llvm/test/Transforms/ConstantHoisting/ARM/const-hoist-gep.ll
    A llvm/test/Transforms/ConstantHoisting/X86/pr52689-not-all-uses-rebased.ll

  Log Message:
  -----------
  [ConstantHoisting] Add back ptr->ptr bitcast to avoid assertion failure

In commit a7ee80fab213fe7a a ptr->ptr bitcast was removed. But that
seem to cause "Expected an cast instruction!" assertions later in
that pass. This patch will add back the bitcast again.

This was a bit unexpected since there is no bitcast added after
creating the Add instruction in the else clause, but I guess there
is something special with the GetElementPtr scenario which makes this
bitcast needed to avoid such asserts.

This patch is also adding a reproducer for
  https://github.com/llvm/llvm-project/issues/52689
that started to fail due to hitting the above mentioned assert. Now
it should end up hitting the assertion failure from #52689 again.




More information about the All-commits mailing list