[PATCH] D49958: [MISC]Fix wrong usage of std::equal()
Hiroshi Inoue via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Jul 28 22:59:09 PDT 2018
inouehrs 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];
----------------
ikulagin wrote:
> 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
Comparing from both side may return true for sequences like 1, 2, 1 or 1, 2, 2, 1, although they are not all the same.
https://reviews.llvm.org/D49958
More information about the llvm-commits
mailing list