[nfc] Refactor SlotIndex::getInstrDistance to better reflect actual functionality
authorAiden Grossman <agrossman154@yahoo.com>
Mon, 12 Sep 2022 23:21:29 +0000 (23:21 +0000)
committerAiden Grossman <agrossman154@yahoo.com>
Mon, 12 Sep 2022 23:33:35 +0000 (23:33 +0000)
commiteec183c171c271578ebd7ee35eafb5ef0ae29298
tree573732ec36476fd42b7064df2ec51c22f03ed120
parent4e08f5f0c46d75dc571dc7fa73bcc4b49f01500a
[nfc] Refactor SlotIndex::getInstrDistance to better reflect actual functionality

This patch refactors SlotIndex::getInstrDistance to
SlotIndex::getApproxInstrDistance to better describe the actual
functionality of this function. This patch also adds in some additional
comments better documenting the assumptions that this function makes to
increase clarity.

Based on discussion on the LLVM Discourse:
https://discourse.llvm.org/t/odd-behavior-in-slotindex-getinstrdistance/64934/5

Reviewed By: mtrofin, foad

Differential Revision: https://reviews.llvm.org/D133386
llvm/include/llvm/CodeGen/SlotIndexes.h
llvm/lib/CodeGen/RegAllocGreedy.cpp