[all-commits] [llvm/llvm-project] c2f0af: [GISelValueTracking] Add test case for G_PTRTOINT

Alexander Richardson via All-commits all-commits at lists.llvm.org
Wed Jun 11 10:47:38 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c2f0af514beb7618660cf8d145fa9e49fb78869c
      https://github.com/llvm/llvm-project/commit/c2f0af514beb7618660cf8d145fa9e49fb78869c
  Author: Alexander Richardson <alexrichardson at google.com>
  Date:   2025-06-11 (Wed, 11 Jun 2025)

  Changed paths:
    A llvm/test/CodeGen/AMDGPU/GlobalISel/knownbits-ptrtoint.mir

  Log Message:
  -----------
  [GISelValueTracking] Add test case for G_PTRTOINT

While we can only reason about the index/address, the G_PTRTOINT
operations returns all representation bits, so we can't assume the
remaining ones are all zeroes. This behaviour was clarified as part of
the discussion in https://discourse.llvm.org/t/clarifiying-the-semantics-of-ptrtoint/83987/54.
The LangRef semantics of ptrtoint being a full representation bitcast
were documented in https://github.com/llvm/llvm-project/pull/139349.

Prior to 77c8d214131e951e3d3a07b45a7436f54988d6f3 we were incorrectly
assuming known zeroes beyond the index size even if the input was
completely unknown. This commit adds a test case for G_PTRTOINT which
was omitted from that change.

See https://github.com/llvm/llvm-project/issues/139598

Reviewed By: arsenm

Pull Request: https://github.com/llvm/llvm-project/pull/139608



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