File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
llvm/lib/CodeGen/GlobalISel Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -5197,12 +5197,8 @@ bool CombinerHelper::matchUDivByConst(MachineInstr &MI) {
5197
5197
return false ;
5198
5198
}
5199
5199
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 (); });
5206
5202
}
5207
5203
5208
5204
void CombinerHelper::applyUDivByConst (MachineInstr &MI) {
@@ -5232,7 +5228,7 @@ bool CombinerHelper::matchSDivByConst(MachineInstr &MI) {
5232
5228
// If the sdiv has an 'exact' flag we can use a simpler lowering.
5233
5229
if (MI.getFlag (MachineInstr::MIFlag::IsExact)) {
5234
5230
return matchUnaryPredicate (
5235
- MRI, RHS, [](const Constant *C) { return C && !C->isZeroValue (); });
5231
+ MRI, RHS, [](const Constant *C) { return C && !C->isNullValue (); });
5236
5232
}
5237
5233
5238
5234
// Don't support the general case for now.
You can’t perform that action at this time.
0 commit comments