[PATCH] D91343: [InstCombine] Optimize away the unnecessary multi-use sign-extend

Jeroen Dobbelaere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 2 02:40:17 PDT 2021


jeroen.dobbelaere added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp:921
+              m_AShr(m_Shl(m_Value(X), m_APInt(ShiftLC)), m_APInt(ShiftRC))) &&
+        ShiftLC == ShiftRC &&
+        DemandedMask.isSubsetOf(APInt::getLowBitsSet(
----------------
RKSimon wrote:
> Its possible that the shift amount is out of bounds - add a check for ShiftLC->ult(BitWidth) ?
Yes, that seems to be the case. I am looking for a fix.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91343



More information about the llvm-commits mailing list