[llvm] 2d7bb60 - [InstCombine] improve description of not+shift transform; NFC

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 26 05:58:57 PST 2023


Author: Sanjay Patel
Date: 2023-01-26T08:58:45-05:00
New Revision: 2d7bb6066722d894591360464608698e9125bdff

URL: https://github.com/llvm/llvm-project/commit/2d7bb6066722d894591360464608698e9125bdff
DIFF: https://github.com/llvm/llvm-project/commit/2d7bb6066722d894591360464608698e9125bdff.diff

LOG: [InstCombine] improve description of not+shift transform; NFC

This was added recently with:
e44a305690add9f75

Added: 
    

Modified: 
    llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
index 97a001b2ed320..9f1de3c5dec65 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
@@ -3896,8 +3896,8 @@ Instruction *InstCombinerImpl::foldNot(BinaryOperator &I) {
     if (match(NotVal, m_AShr(m_Not(m_Value(X)), m_Value(Y))))
       return BinaryOperator::CreateAShr(X, Y);
 
-    // Bit-hack form of a signbit test:
-    // iN ~X >>s (N-1) --> sext i1 (X > -1) to iN
+    // Bit-hack form of a signbit test for iN type:
+    // ~(X >>s (N - 1)) --> sext i1 (X > -1) to iN
     unsigned FullShift = Ty->getScalarSizeInBits() - 1;
     if (match(NotVal, m_OneUse(m_AShr(m_Value(X), m_SpecificInt(FullShift))))) {
       Value *IsNotNeg = Builder.CreateIsNotNeg(X, "isnotneg");


        


More information about the llvm-commits mailing list