Skip to content

Commit 9ddff0b

Browse files
committed
[X86] FindSingleBitChange - reduce scope of dyn_cast checks. NFC.
1 parent 4d2009c commit 9ddff0b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30529,8 +30529,7 @@ enum BitTestKind : unsigned {
3052930529
static std::pair<Value *, BitTestKind> FindSingleBitChange(Value *V) {
3053030530
using namespace llvm::PatternMatch;
3053130531
BitTestKind BTK = UndefBit;
30532-
auto *C = dyn_cast<ConstantInt>(V);
30533-
if (C) {
30532+
if (auto *C = dyn_cast<ConstantInt>(V)) {
3053430533
// Check if V is a power of 2 or NOT power of 2.
3053530534
if (isPowerOf2_64(C->getZExtValue()))
3053630535
BTK = ConstantBit;
@@ -30540,8 +30539,7 @@ static std::pair<Value *, BitTestKind> FindSingleBitChange(Value *V) {
3054030539
}
3054130540

3054230541
// Check if V is some power of 2 pattern known to be non-zero
30543-
auto *I = dyn_cast<Instruction>(V);
30544-
if (I) {
30542+
if (auto *I = dyn_cast<Instruction>(V)) {
3054530543
bool Not = false;
3054630544
// Check if we have a NOT
3054730545
Value *PeekI;

0 commit comments

Comments
 (0)