[PATCH] D103788: [InstCombine] Eliminate casts to optimize ctlz operation

Datta Nagraj via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 12 01:25:32 PDT 2021


datta.nagraj added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp:957
+    unsigned AWidth = A->getType()->getScalarSizeInBits();
+    APInt ZextWidth(32, SrcWidth);
+    if (AWidth == DestWidth && AWidth > ZextWidth.logBase2()) {
----------------
I am not sure if the 32 should be hardcoded here, or there is some other way for creating the APInt out of SrcWidth. 
Please guide here sir. @spatel 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103788



More information about the llvm-commits mailing list