[PATCH] D54666: [InstCombine] Simplify funnel shifts based on demanded bits

Simonas Kazlauskas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 17 08:18:24 PST 2018


nagisa added inline comments.


================
Comment at: lib/Transforms/InstCombine/InstCombineCalls.cpp:2006
+
+        // fshl(X, undef, C) -> shl X, C
+        if (match(Op1, m_Undef()))
----------------
This probably could use a in-code comment about the reason why this replacing the funnel shifts with one undef operand to just a shift, so that somebody else wouldn’t replace it with a straight `fshl(X, undef, C) -> undef` (which would make a lot of sense in isolation) down the road.

Ditto for similar replacement just below.


================
Comment at: test/Transforms/InstCombine/fsh.ll:276
+
+; This case fails to simplify due to multiple uses.
+
----------------
This seems like it would be more appropriate for a bug report than a test?


Repository:
  rL LLVM

https://reviews.llvm.org/D54666





More information about the llvm-commits mailing list