Enable hoisting and merging m0 defs that are initialized with the
same immediate value. Fixes bug where removed instructions are
not consider to interfere with other inits, and make sure to not
host inits before block prologs.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
- Build Status
Buildable 35043 Build 35042: arc lint + arc unit
Event Timeline
llvm/lib/Target/AMDGPU/SIFixSGPRCopies.cpp | ||
---|---|---|
458–459 | Why does this need to care about the prolog instructions? (FYI I'm planning on eliminating the rarely followed concept) |
llvm/lib/Target/AMDGPU/SIFixSGPRCopies.cpp | ||
---|---|---|
458–459 | You actually cannot, it was created to prevent RA from insrting spills into endif/else block before we updated exec mask. |
llvm/lib/Target/AMDGPU/SIFixSGPRCopies.cpp | ||
---|---|---|
458–459 | Yes, I'm working on splitting the blocks to avoid this |
llvm/lib/Target/AMDGPU/SIFixSGPRCopies.cpp | ||
---|---|---|
458–459 | I never found a way to properly split a block for that. Assume you split it and endif sequence is in the 1st block. What would prevent RA from inserting spill/restore there? You will need to mark a whole block as not suitable for spills and in addition prohibit RA from inserting any COPY instructions there. Besides until there is another way m0 init must follow prologue anyway. If it is inserted before endif sequence that will break a contiguous sequence of prologue instructions and we will have bogus spilling again. |
llvm/lib/Target/AMDGPU/SIFixSGPRCopies.cpp | ||
---|---|---|
458–459 | The details of the split aren't important here. Why does this scalar value initialization care? |
llvm/lib/Target/AMDGPU/SIFixSGPRCopies.cpp | ||
---|---|---|
458–459 | It does not care itself. But if inserted it will break prologue, allowing to insert a spill right before it. |
Why does this need to care about the prolog instructions? (FYI I'm planning on eliminating the rarely followed concept)