[NFC][AIE1] fix second Spill reload #738
Open
+1
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current state of AIE1 Stack reload has two undefs when we reload a mC Register (Reusing the same StackSlot here is also wrong but this is not my beer to fix)
3852B dead undef %1661.sub_32_lo:mc = LDA_SPIL_GPR %stack.14, implicit $sp :: (load (s64) from %stack.14)3860B undef %1661.sub_32_hi:mc = LDA_SPIL_GPR %stack.14, implicit $sp :: (load (s64) from %stack.14)This causes us to have multiple Defs for a single VReg if we recalculate the LiveIntervals. Also the first Def should not be dead!
Besides being wrong this also causes the MachineVerifier to crash.
*** Bad machine code: Multiple connected components in live interval ***- function: conv2d- interval: %1661 [3852r,3852d:1)[3860r,3868r:0) 0@3860r 1@3852r weight:INF0: valnos 01: valnos 1This problem is solved by removing the undef flag for the second Spill-Load Instruction.
Note: This creeped up when looking at the interesting unit-test
llvm/test/CodeGen/AIE/vect/generic_vector_loop.llfor #713 . The Subreg spiller runs out of registers because an optimization is missing and I at least wanted to fix the obvious machine verify crashes.Note 2:
llvm/test/CodeGen/AIE/vect/generic_vector_loop.llcrashes the Machine Verifier for the regular InlineSpiller XDNote 3: It was previously hidden because we never actually properly recalculated the LiveIntervals for spill store/reload in InlineSpiller.