[PATCH] D45173: [InstCombine] Recognize idioms for ctpop and ctlz

Krzysztof Parzyszek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 3 06:34:55 PDT 2018


kparzysz marked 3 inline comments as done.
kparzysz added inline comments.


================
Comment at: lib/Transforms/AggressiveInstCombine/BitCountCombine.cpp:61
+      const APInt *P = &M;
+      auto Mask = m_APInt(P);
+      auto Shift = m_SpecificInt(S);
----------------
craig.topper wrote:
> m_APInt doesn't match a specific APInt. It just matches any ConstantInt or splat and returns a pointer to the APInt it found. The pointer passed in would normally be unitialized in the caller.
Wow, this was bad.  Thanks for catching this.


Repository:
  rL LLVM

https://reviews.llvm.org/D45173





More information about the llvm-commits mailing list