[PATCH] D39556: [ConstantFold] Support vector index when factoring out GEP index into preceding dimensions

Matthew Simpson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 1 12:23:29 PST 2017


mssimpso added a comment.

One minor comment. Otherwise, this looks fine to me.



================
Comment at: lib/IR/ConstantFold.cpp:2251
+    }
+    if (ConstantDataVector *CV = dyn_cast<ConstantDataVector>(Idxs[i])) {
+      bool InRange = true;
----------------
Shouldn't this be an `else` with an unchecked cast?

```
else {
  auto *CV = cast<ConstantDataVector>(Idxs[i]);
  ...
}
```


Repository:
  rL LLVM

https://reviews.llvm.org/D39556





More information about the llvm-commits mailing list