Skip debug instructions before calling functions not expecting them.
In particular, LIS.getInstructionIndex(*mi) would fail if mi was a debg instr.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Test generated from the following C code:
#include <stdint.h> void test(int16_t* a, int16_t* b, int16_t* c, uint32_t n) { for (int32_t i = 0; i < n; i++) { *c++ = *a++ + *b++; } }
llvm/lib/CodeGen/CalcSpillWeights.cpp | ||
---|---|---|
218 | Don't think that counting uses in debug instrs was originally intended for this heuristic. |
Looks generally good, except for the test.
llvm/test/CodeGen/Generic/csw-debug-assert.ll | ||
---|---|---|
3 | Please add a comment explaining what is being tested here Please add something that explicitly CHECKs the results? Otherwise this test will succeed even if someone symlinks /bin/true to llc :-) | |
55 | Please delete all nonnecessary attributes, it makes the tests hard to maintain |
llvm/test/CodeGen/Generic/csw-debug-assert.ll | ||
---|---|---|
110 | I've simplified the test. Do you think manual dbg hacking is still necessary? |
llvm/test/CodeGen/Generic/csw-debug-assert.ll | ||
---|---|---|
76 | Do you need the TBAAA info? | |
110 | Getting the tests as minimal as possible helps in the long term with maintenance. All tests need to updated occasionally for various IR changes and then it really helps to know what is relevant to the test and what isn't. So, I would do it, since it's not a lot of work and helps focus on what's important. |
llvm/test/CodeGen/Generic/csw-debug-assert.ll | ||
---|---|---|
110 | My concern here that by manually editing .ll metadata I might accidentally break some underlying assumption which might lead to problems later down the line. Anyway, I'll try to clean DILocations up. |
Don't think that counting uses in debug instrs was originally intended for this heuristic.