aco/ra: fix intersects()
authorDaniel Schürmann <daniel@schuermann.dev>
Mon, 21 Jun 2021 14:36:28 +0000 (16:36 +0200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 30 Sep 2021 09:10:07 +0000 (09:10 +0000)
The previous implementation failed when a contained b.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12836>

src/amd/compiler/aco_register_allocation.cpp

index 9766dfc..b96ea9c 100644 (file)
@@ -153,7 +153,7 @@ struct PhysRegInterval {
 bool
 intersects(const PhysRegInterval& a, const PhysRegInterval& b)
 {
-   return ((a.lo() >= b.lo() && a.lo() < b.hi()) || (a.hi() > b.lo() && a.hi() <= b.hi()));
+   return a.hi() > b.lo() && b.hi() > a.lo();
 }
 
 /* Gets the stride for full (non-subdword) registers */