[InstCombine] Use getFreedOperand() (NFC)

Use getFreedOperand() instead of isFreeCall() to remove the
implicit assumption that any pointer operand to a free function
is the operand being freed. This won't actually matter until we
handle allockind(free).
This commit is contained in:
Nikita Popov 2022-07-21 14:33:55 +02:00
parent 3ac8587a2b
commit 5e856a8578
1 changed files with 2 additions and 1 deletions

View File

@ -2801,7 +2801,8 @@ static bool isAllocSiteRemovable(Instruction *AI,
continue;
}
if (isFreeCall(I, &TLI) && getAllocationFamily(I, &TLI) == Family) {
if (getFreedOperand(cast<CallBase>(I), &TLI) == PI &&
getAllocationFamily(I, &TLI) == Family) {
assert(Family);
Users.emplace_back(I);
continue;