[PATCH] D64699: [X86] Return UNDEF from LowerScalarImmediateShift when the shift amount is out of range.

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 15 10:57:36 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL366096: [X86] Return UNDEF from LowerScalarImmediateShift when the shift amount is out… (authored by ctopper, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D64699?vs=209757&id=209914#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D64699

Files:
  llvm/trunk/lib/Target/X86/X86ISelLowering.cpp


Index: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
===================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
@@ -25033,8 +25033,11 @@
   APInt APIntShiftAmt;
   if (!isConstantSplat(Amt, APIntShiftAmt))
     return SDValue();
-  assert(APIntShiftAmt.ult(VT.getScalarSizeInBits()) &&
-         "Out of range shift amount");
+
+  // If the shift amount is out of range, return undef.
+  if (APIntShiftAmt.uge(VT.getScalarSizeInBits()))
+    return DAG.getUNDEF(VT);
+
   uint64_t ShiftAmt = APIntShiftAmt.getZExtValue();
 
   if (SupportedVectorShiftWithImm(VT, Subtarget, Op.getOpcode()))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64699.209914.patch
Type: text/x-patch
Size: 700 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190715/f3092aab/attachment.bin>


More information about the llvm-commits mailing list