[all-commits] [llvm/llvm-project] d08e3a: [InstCombine] Support vectors in simplifyIntToPtrR...

Craig Topper via All-commits all-commits at lists.llvm.org
Tue Dec 13 12:06:42 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d08e3ae271a9748af6c99be7e455730fb110b0a5
      https://github.com/llvm/llvm-project/commit/d08e3ae271a9748af6c99be7e455730fb110b0a5
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2022-12-13 (Tue, 13 Dec 2022)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
    M llvm/test/Transforms/InstCombine/ptr-int-ptr-icmp.ll

  Log Message:
  -----------
  [InstCombine] Support vectors in simplifyIntToPtrRoundTripCast.

This code compares getPointerTypeSizeInBits and getTypeSizeInBits.
getPointerTypeSizeInBits contains a call to getScalarType while
getTypeSizeInBits does not. This makes the code incorrect for vectors.

For scalable vectors this caused a warning about a scalable TypeSize
being converted to unsigned.

Switch to DL.getTypeSizeInBits for the pointers too. This should
work since inttoptr/ptrtoint can't change the number of elements.
This was suggested by @nikic in D139911.

Fixes PR59480.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D139962




More information about the All-commits mailing list