[PATCH] D141258: [AArch64] Fix crash for expandMOVImm

Allen zhong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 11 17:09:26 PST 2023


Allen added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64ExpandImm.cpp:343
 
-  assert(BitSize == 64 && "All 32-bit immediates can be expanded with a"
+  assert(BitSize > 32 && "All 32-bit immediates can be expanded with a"
                           "MOVZ/MOVK pair");
----------------
Allen wrote:
> efriedma wrote:
> > This algorithm doesn't work correctly if BitSize isn't 32 or 64.  Probably the code that's creating such an immediate should be fixed.
> Oh, Thanks for your confirm
hi @efriedma
    For all immediate numbers whose bit size is smaller than or equal to 64, at least four registers can be used for concatenation, ie, the processing of AArch64_IMM::expandMOVImm. Therefore, the current i53 immediate number can be also processed here (may not be the most efficient). Would you please show more detail about where is the algorithm error? thanks.


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

https://reviews.llvm.org/D141258



More information about the llvm-commits mailing list