[all-commits] [llvm/llvm-project] 8851ea: [ConstantHoist] Fix APInt ctor assertion

Nikita Popov via All-commits all-commits at lists.llvm.org
Mon Nov 4 02:17:52 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8851ea64a5d01fbf406383f13fcba347e730bc2d
      https://github.com/llvm/llvm-project/commit/8851ea64a5d01fbf406383f13fcba347e730bc2d
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2024-11-04 (Mon, 04 Nov 2024)

  Changed paths:
    M llvm/lib/Transforms/Scalar/ConstantHoisting.cpp
    A llvm/test/Transforms/ConstantHoisting/ARM/apint-assert.ll

  Log Message:
  -----------
  [ConstantHoist] Fix APInt ctor assertion

The result here may require truncation. Fix this by removing the
calculateOffsetDiff() helper entirely. As far as I can tell, this
code does not actually have to deal with different bitwidths.

findBaseConstants() will produce ranges of constants with equal
types, which is what maximizeConstantsInRange() will then work
on.

Fixes assertion reported at:
https://github.com/llvm/llvm-project/pull/114539#issuecomment-2453008679



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