Open lukel97 opened 5 days ago
@llvm/issue-subscribers-backend-risc-v
Author: Luke Lau (lukel97)
Please fix the title
The fundamental issue here seems to be that we scheduled a select that needs expansion between ADJCALLSTACKDOWN and ADJCALLSTACKUP
At one point we had (any_extend (select X, C1, C2)) which was replaced by (select X, aext(C1), aext(C2)). The any_extend was part of the call frame. This new select inherited the DebugLoc and IROrder from the any_extend.
The SelectionDAG scheduler uses the IROrder to prioritize nodes. Because the new select has the IROrder from the any_extend, this caused the select to get scheduled as part of the call lowering.
Compiling the below with
llc -verify-machineinstrs
fails during the machine verifier:The test case looks strange, but it was reduced from a crash when compiling OpenCV with
-rva22u64v -mllvm -verify-machineinstrs
.