The immediate range check for CSImm12MulBy8 included some values
covered by CSImm12MulBy4. I assume CSImm12MulBy4 had priority due
to pattern order in the td file, but this makes the priority
explicit in the predicate.
if (!N->hasOneUse())
return false;
int64_t C = N->getSExtValue();
- // Skip if C is simm12 or can be optimized by the PatLeaf AddiPair.
- return !isInt<13>(C) && isInt<15>(C) && (C & 7) == 0;
+ // Skip if C is simm12 or can be optimized by the PatLeaf AddiPair or
+ // CSImm12MulBy4.
+ return !isInt<14>(C) && isInt<15>(C) && (C & 7) == 0;
}]>;
def SimmShiftRightBy2XForm : SDNodeXForm<imm, [{