Lines Matching defs:rhs
75 auto rhs = dyn_cast_if_present<IntegerAttr>(operands[1]);
76 if (!lhs || !rhs)
79 std::optional<APInt> result = calculate(lhs.getValue(), rhs.getValue());
83 calculate(lhs.getValue().trunc(32), rhs.getValue().trunc(32)));
101 auto rhs = dyn_cast_if_present<IntegerAttr>(operands[1]);
103 if (!lhs || !rhs)
107 std::optional<APInt> result64 = calculate(lhs.getValue(), rhs.getValue());
111 calculate(lhs.getValue().trunc(32), rhs.getValue().trunc(32));
154 [](const APInt &lhs, const APInt &rhs) { return lhs + rhs; }))
157 if (auto rhs = dyn_cast_or_null<IntegerAttr>(adaptor.getRhs())) {
159 if (rhs.getValue().isZero())
177 [](const APInt &lhs, const APInt &rhs) { return lhs - rhs; }))
180 if (auto rhs = dyn_cast_or_null<IntegerAttr>(adaptor.getRhs())) {
182 if (rhs.getValue().isZero())
196 [](const APInt &lhs, const APInt &rhs) { return lhs * rhs; }))
199 if (auto rhs = dyn_cast_or_null<IntegerAttr>(adaptor.getRhs())) {
201 if (rhs.getValue().isOne())
204 if (rhs.getValue().isZero())
205 return rhs;
222 [](const APInt &lhs, const APInt &rhs) -> std::optional<APInt> {
224 if (rhs.isZero())
226 return lhs.sdiv(rhs);
237 [](const APInt &lhs, const APInt &rhs) -> std::optional<APInt> {
239 if (rhs.isZero())
241 return lhs.udiv(rhs);
333 [](const APInt &lhs, const APInt &rhs) -> std::optional<APInt> {
335 if (rhs.isZero())
337 return lhs.srem(rhs);
348 [](const APInt &lhs, const APInt &rhs) -> std::optional<APInt> {
350 if (rhs.isZero())
352 return lhs.urem(rhs);
362 [](const APInt &lhs, const APInt &rhs) {
363 return lhs.sgt(rhs) ? lhs : rhs;
377 [](const APInt &lhs, const APInt &rhs) {
378 return lhs.ugt(rhs) ? lhs : rhs;
392 [](const APInt &lhs, const APInt &rhs) {
393 return lhs.slt(rhs) ? lhs : rhs;
407 [](const APInt &lhs, const APInt &rhs) {
408 return lhs.ult(rhs) ? lhs : rhs;
423 [](const APInt &lhs, const APInt &rhs) -> std::optional<APInt> {
427 if (rhs.uge(32))
429 return lhs << rhs;
440 [](const APInt &lhs, const APInt &rhs) -> std::optional<APInt> {
442 if (rhs.uge(32))
444 return lhs.ashr(rhs);
455 [](const APInt &lhs, const APInt &rhs) -> std::optional<APInt> {
457 if (rhs.uge(32))
459 return lhs.lshr(rhs);
470 [](const APInt &lhs, const APInt &rhs) { return lhs & rhs; });
484 [](const APInt &lhs, const APInt &rhs) { return lhs | rhs; });
498 [](const APInt &lhs, const APInt &rhs) { return lhs ^ rhs; });
587 bool compareIndices(const APInt &lhs, const APInt &rhs,
591 return lhs.eq(rhs);
593 return lhs.ne(rhs);
595 return lhs.sge(rhs);
597 return lhs.sgt(rhs);
599 return lhs.sle(rhs);
601 return lhs.slt(rhs);
603 return lhs.uge(rhs);
605 return lhs.ugt(rhs);
607 return lhs.ule(rhs);
609 return lhs.ult(rhs);
665 auto rhs = dyn_cast_if_present<IntegerAttr>(adaptor.getRhs());
666 if (lhs && rhs) {
668 bool result64 = compareIndices(lhs.getValue(), rhs.getValue(), getPred());
670 rhs.getValue().trunc(32), getPred());
679 matchPattern(lhsOp->getOperand(1), m_Constant(&cstA)) && rhs) {
681 lhsOp, cstA.getValue(), rhs.getValue(), 64, getPred());
684 rhs.getValue().trunc(32), 32, getPred());