[PATCH] D89232: [GlobalISel][KnownBits] Early return on out of bound shift amounts

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 12 07:51:12 PDT 2020


arsenm added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp:401
+    // Guard against oversized shift amounts
+    if (Shift > MRI.getType(MI.getOperand(1).getReg()).getSizeInBits())
+      break;
----------------
getScalarSizeInBits. This should also be >=


================
Comment at: llvm/unittests/CodeGen/GlobalISel/KnownBitsTest.cpp:735
+   %final_copy:_(s32) = COPY %shift
+)";
+  setUp(MIRString);
----------------
Also add and equal sized case


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89232



More information about the llvm-commits mailing list