Skip to content

Commit 3490111

Browse files
author
git apple-llvm automerger
committed
Merge commit '5fef5e68dcb0' from llvm.org/main into next
2 parents 98b92d1 + 5fef5e6 commit 3490111

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5197,12 +5197,8 @@ bool CombinerHelper::matchUDivByConst(MachineInstr &MI) {
51975197
return false;
51985198
}
51995199

5200-
auto CheckEltValue = [&](const Constant *C) {
5201-
if (auto *CI = dyn_cast_or_null<ConstantInt>(C))
5202-
return !CI->isZero();
5203-
return false;
5204-
};
5205-
return matchUnaryPredicate(MRI, RHS, CheckEltValue);
5200+
return matchUnaryPredicate(
5201+
MRI, RHS, [](const Constant *C) { return C && !C->isNullValue(); });
52065202
}
52075203

52085204
void CombinerHelper::applyUDivByConst(MachineInstr &MI) {
@@ -5232,7 +5228,7 @@ bool CombinerHelper::matchSDivByConst(MachineInstr &MI) {
52325228
// If the sdiv has an 'exact' flag we can use a simpler lowering.
52335229
if (MI.getFlag(MachineInstr::MIFlag::IsExact)) {
52345230
return matchUnaryPredicate(
5235-
MRI, RHS, [](const Constant *C) { return C && !C->isZeroValue(); });
5231+
MRI, RHS, [](const Constant *C) { return C && !C->isNullValue(); });
52365232
}
52375233

52385234
// Don't support the general case for now.

0 commit comments

Comments
 (0)