[PATCH] D110890: [GlobalISel] Port the udiv -> mul by constant combine.

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 1 11:39:33 PDT 2021


paquette added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:4612
+    auto *CI = dyn_cast_or_null<ConstantInt>(C);
+    if (!CI || CI->isZero())
+      return false;
----------------
can probably save a line of code here

```
if (auto *CI = dyn_cast_or_null...)
   return !CI->isZero();
return false;
```


================
Comment at: llvm/lib/CodeGen/GlobalISel/Utils.cpp:1030
+        getIConstantVRegValWithLookThrough(BV->getSourceReg(SrcIdx), MRI);
+    if (MaybeCst.hasValue())
+      continue;
----------------
can this just be

```
if (getIConstantVRegValWithLookThrough... || getOpcodeDef<GImplicitDef>...)
  continue;
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110890/new/

https://reviews.llvm.org/D110890



More information about the llvm-commits mailing list