[all-commits] [llvm/llvm-project] 294ae8: [PowerPC] Drop invalid range metadata when lowerin...

Amy Kwan via All-commits all-commits at lists.llvm.org
Mon Jun 1 00:15:43 PDT 2026


  Branch: refs/heads/release/22.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 294ae8d1e62a3bd238c411d22a109e0b38ddc363
      https://github.com/llvm/llvm-project/commit/294ae8d1e62a3bd238c411d22a109e0b38ddc363
  Author: Amy Kwan <amy.kwan1 at ibm.com>
  Date:   2026-06-01 (Mon, 01 Jun 2026)

  Changed paths:
    M llvm/lib/Target/PowerPC/PPCISelLowering.cpp
    A llvm/test/CodeGen/PowerPC/ppc-i64-to-fp.ll

  Log Message:
  -----------
  [PowerPC] Drop invalid range metadata when lowering i64 load to fp in INT_TO_FP (#198705)

When lowering an i64 load in LowerINT_TO_FP, we were forwarding the
original !range metadata to a new f64 load. This is invalid because the
metadata no longer matches the value type/semantics, and can trigger
assertions when lowering i64 to fp (double or float) conversions.

This patch fixes this by passing a nullptr for the Ranges operand when
calling getLoad() and adds extra test cases to cover signed/unsigned i64
to f32/f64 conversions and to ensure they do not assert when the !range
metadata is present.

The assertion this patch attempts to fix is:
```
Assertion failed: (!MMO->getRanges() || (mdconst::extract<ConstantInt>(MMO->getRanges()->getOperand(0)) ->getBitWidth() == MemVT.getScalarSizeInBits() && MemVT.isInteger())) && "Range metadata and load type must match!"
```
This assert was originally seen when building Rust on AIX.

(cherry picked from commit 78f5f7717a2e058c4d685feb3edb7d991efacbc2)



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