[Assignment Tracking] Fix faulty assertion inside std::sort predicate
authorOCHyams <orlando.hyams@sony.com>
Wed, 26 Apr 2023 09:53:57 +0000 (10:53 +0100)
committerOCHyams <orlando.hyams@sony.com>
Wed, 26 Apr 2023 10:14:51 +0000 (11:14 +0100)
commitb59d672ed489ddb3373db62be168bb0926c4f5f3
tree1f8a2967a99235975cbdb8d7aa8ce2622b8e4e79
parentbaafc74ab0bf95b650a8cd9b987ce50087b72121
[Assignment Tracking] Fix faulty assertion inside std::sort predicate

The vectors being sorted here shouldn't contain duplicate entries. Prior to
this patch this was checked with an assert within the `std::sort`
predicate. However, `std::sort` may compare an element against itself which
causes the assert to fire (false positive). Move the assert outside of the sort
predicate to avoid such issues.

Reviewed By: StephenTozer

Differential Revision: https://reviews.llvm.org/D149045
llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp