Seems that physical register uses of registers that are MRI->isConstantPhysReg() incorrectly inhibited transformation (the comment in the code is talking about "zombie" define and NOT uses).
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Seems straightforward enough to me, the code block in question clearly only cares about preg defs for the purposes of sinking. LGTM, with one inline nit.
llvm/test/CodeGen/RISCV/MachineSink-implicit-x0.mir | ||
---|---|---|
6 | Remove double "is a". |
llvm/test/CodeGen/RISCV/MachineSink-implicit-x0.mir | ||
---|---|---|
2 | Also just to add, does this need "-x mir"? I see some of the other llc tests on MIR files use it, but I don't know if it's actually required. |
Found one issue with the test (noted inline), but otherwise no issues.
llvm/test/CodeGen/RISCV/MachineSink-implicit-x0.mir | ||
---|---|---|
36 | I've just run the test, and it seems that this last line causes a parse error for llc; otherwise the test seems to work as written. |
llvm/test/CodeGen/RISCV/MachineSink-implicit-x0.mir | ||
---|---|---|
2 | The majority of MIR tests depend on having llc detecting the input language from the filename extension and not using -x mir AFAICT. | |
36 | Hmm, what exactly are you running then? ./bin/llvm-lit ../llvm/test/CodeGen/RISCV/MachineSink-implicit-x0.mir it passes without issues. |
llvm/test/CodeGen/RISCV/MachineSink-implicit-x0.mir | ||
---|---|---|
36 | The command: python .\build\Release\bin\llvm-lit.py llvm\test\CodeGen\RISCV\MachineSink-implicit-x0.mir fails with: $ ":" "RUN: at line 1" $ "d:\upstream-llvm\build\release\bin\llc.exe" "-mtriple=riscv32" "D:\upstream-llvm\llvm\test\CodeGen\RISCV\MachineSink-implicit-x0.mir" "-run-pass=machine-sink" "-o" "-" # command stderr: error: YAML:35:1: not a mapping --- ^~~ Deleting the dashes causes it to pass. This is with python 3.9.7 and an up-to-date build of LLVM from trunk (82b74363a9). |
llvm/test/CodeGen/RISCV/MachineSink-implicit-x0.mir | ||
---|---|---|
36 | Also, this is a windows build - and I've just confirmed that when running the tests on linux, the final line does not affect the test, so this is presumably platform-dependent. |
llvm/test/CodeGen/RISCV/MachineSink-implicit-x0.mir | ||
---|---|---|
36 | Alright, I've figured it out - when I applied the patch, the test file didn't contain the final newline, which was messing with YAML parsing. This should be fine as-is, apologies for the wasted time! |
llvm/test/CodeGen/RISCV/MachineSink-implicit-x0.mir | ||
---|---|---|
36 | Ah, right. I was not able to reproduce on linux but I will change it anyways since I see now that it is not present in other .mir tests. Not sure where I picked it up from. No worries. Thanks for reviewing :) |
Also just to add, does this need "-x mir"? I see some of the other llc tests on MIR files use it, but I don't know if it's actually required.