[PATCH] D34974: [InstCombine] Add single use checks to SimplifyBSwap to ensure we are really saving instructions

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 6 06:16:56 PDT 2017


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

LGTM. See inline for an NFC pre- or post-commit cleanup.



================
Comment at: lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:78-81
 /// \brief Transform BITWISE_OP(BSWAP(A),BSWAP(B)) to BSWAP(BITWISE_OP(A, B))
 /// \param I Binary operator to transform.
 /// \return Pointer to node that must replace the original binary operator, or
 ///         null pointer if no transformation was made.
----------------
It's independent of this patch, but this comment is too specific for this function because it doesn't mention the pattern with a constant operand. I'd make the comment more general and/or remove it. The function name could also mention 'bitwise op' since that is a requirement for any transform in this function.


https://reviews.llvm.org/D34974





More information about the llvm-commits mailing list