From e756ecfb0cab55e4a39675eb78e8e9bc8d0f7311 Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Tue, 4 Nov 2014 17:47:13 +0000 Subject: [PATCH] InstSimplify: Fold a hasNoSignedWrap() call into a match() expression No functionality change intended, it's just a little more concise. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221281 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/InstructionSimplify.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/Analysis/InstructionSimplify.cpp b/lib/Analysis/InstructionSimplify.cpp index 2e591ccc8a0..831ff2f09b1 100644 --- a/lib/Analysis/InstructionSimplify.cpp +++ b/lib/Analysis/InstructionSimplify.cpp @@ -1408,8 +1408,7 @@ static Value *SimplifyAShrInst(Value *Op0, Value *Op1, bool isExact, // (X << A) >> A -> X Value *X; - if (match(Op0, m_Shl(m_Value(X), m_Specific(Op1))) && - cast(Op0)->hasNoSignedWrap()) + if (match(Op0, m_NSWShl(m_Value(X), m_Specific(Op1)))) return X; // Arithmetic shifting an all-sign-bit value is a no-op. -- 2.34.1