[PATCH] D88292: [InstCombine] collectBitParts - add fshl/fshr handling

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 25 11:45:53 PDT 2020


nikic accepted this revision.
nikic added a comment.
This revision is now accepted and ready to land.

This LGTM now, thanks!



================
Comment at: llvm/lib/Transforms/Utils/Local.cpp:2947
+      if (auto *F = dyn_cast<Function>(Callee)) {
+        Intrinsic::ID IntrinsicID = F->getIntrinsicID();
+
----------------
I would `if (auto *II = dyn_cast<IntrinsicInst>(I))` and then `II->getInrinsicID()` here. Doesn't seem necessary to explicitly go through the Function.


================
Comment at: llvm/lib/Transforms/Utils/Local.cpp:2950
+        // Funnel 'double' shifts take 3 operands, 2 inputs and the shift
+        // amount (modulo).
+        // fshl(X,Y,Z): (X << (Z % BW)) | (Y >> (BW - (Z % BW)))
----------------
modulo -> modulo the bitwidth?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88292



More information about the llvm-commits mailing list