[PATCH] D101833: [AArch64][SVE] Fix missed immediate selection due to mishandling of signedness

Bradley Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 5 03:45:08 PDT 2021


bsmith added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp:3128
+                  ((int32_t)ImmVal >= -32768) &&
+                  ((int32_t)ImmVal <= 32512)) {
+        Shift = CurDAG->getTargetConstant(8, DL, MVT::i32);
----------------
efriedma wrote:
> Does checking `((int32_t)ImmVal >= -32768) && ((int32_t)ImmVal <= 32512))` actually do anything?  All 16-bit immediates should be in that range.
It possibly doesn't, however the thing that makes me nervous here is that the incoming `CNode` value is an i32 so could in theory (if something has gone wrong?) have a value outside of that range. It might be best to do it like this if nothing else to prevent an issue further up the pipeline propagating into a codegen fault here?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101833



More information about the llvm-commits mailing list