[RegisterScavenging] Fix assert in scavengeRegisterBackwards
authorCraig Blackmore <craig.blackmore@embecosm.com>
Fri, 18 Dec 2020 16:57:01 +0000 (16:57 +0000)
committerSimon Cook <simon.cook@embecosm.com>
Fri, 18 Dec 2020 16:57:05 +0000 (16:57 +0000)
commit698ae90f306248aafbfb5c85cdd9bb81c387bb59
treec5d8aba84cab6488ef0a99a404d7e44db24fef0e
parent06d5b1c9ad52476e845f969cf82e00e383f9cf40
[RegisterScavenging] Fix assert in scavengeRegisterBackwards

According to the documentation, if a spill is required to make a
register available and AllowSpill is false, then NoRegister should be
returned, however, this scenario was actually triggering an assertion
failure.

This patch moves the assertion after the handling of AllowSpill.

Authored by: Lewis Revill

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D92104
llvm/lib/CodeGen/RegisterScavenging.cpp