[PATCH] D137108: Implement support for AArch64ISD::MOVI in computeKnownBits

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 1 08:06:45 PDT 2022


dmgreen added a comment.

It may be worth implementing them in separate patches to keep the changes small. If you can add the test cases for different sizes, this LGTM.



================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:1979
+    Known =
+        KnownBits::makeConstant(APInt(Known.getBitWidth(), CN->getZExtValue()));
+    break;
----------------
adriantong1024 wrote:
> dmgreen wrote:
> > Does CN->getAPIntValue() work, or does it need to change the width of the APInt?
> I think its needs to be the same width as Known. Otherwise Known bitwidth will be changed and cause trouble later.
Makes sense. The constant should always be an i32, even though the typesize is i8.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137108/new/

https://reviews.llvm.org/D137108



More information about the llvm-commits mailing list