[PATCH] D49958: [MISC]Fix wrong usage of std::equal()

Ivan Kulagin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 28 21:38:35 PDT 2018


ikulagin added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:2919
   // Min/max matching is only viable if all output VTs are the same.
-  if (std::equal(ValueVTs.begin(), ValueVTs.end(), ValueVTs.begin())) {
     EVT VT = ValueVTs[0];
----------------
lebedev.ri wrote:
> This seems to originate from @jmolloy from rL237423.
maybe it was supposed like this:

```
if (std::equal(ValueVTs.begin(), ValueVTs.end(), ValueVTs.rbegin())) { 
```
iterate from both ends


https://reviews.llvm.org/D49958





More information about the llvm-commits mailing list