Assertion failed: SrcReg and DstReg cannot be the same #229
Comments
Cleaned up and added a test case in tree in 948b820. |
It looks like we are selecting
|
As shown in the datasheet, this instruction is undefined
|
This relates to #28 |
I don't think LLVM has any way currently to handle this. |
Easiest and shittiest fix is to create a register class with only the X and Z instructions, and restrict the |
I think this will require a lot of effort to fix correctly. I imagine that the best way to implement this would be to add a new hook that returns the set of available registers to select on given a machine instruction. This is similar to the We could add a new virtual function the the |
It looks like the 'virtual register rewriter' pass is inserting the registers. |
It looks like the root of this is in our implementation of |
I think I hit this same issue when compiling a C program of mine that uses 64-bit arithmetics and recursion: http://www.iki.fi/~msmakela/software/pentomino/pentomino.c (I thought it would make a nice test case). The poisonous combination is |
@dylanmckay any ideas on how we can work on this? |
I did a small spike to check how long it would take to properly fix this in the register allocator a while back, it looks quite difficult because at the register allocator layer, there isn't really any visibility of the machine instructions that are being selected. There will be a way, but it's not an idiom I could see being used. |
I'm looking into this again. I've raised a bug on the LLVM bug tracker here, feel free to watchlist! |
I've just fixed this in LLVM master! |
It appears to me that the fix has not yet been merged to avr-llvm. |
Unless there's a compelling reason to merge upstream back into this branch, I don't think it's worth it. Now that all of the code from here is merged into LLVM master, and development occurs there, you should be using that instead of this fork. |
Thanks for the clarification! That is even better. Not being aware of the merge to the LLVM master, I was wondering why there are AVR-specific changes in the upstream repository. |
It looks like README.md should point to http://clang.llvm.org/get_started.html instead of https://github.com/avr-llvm/llvm/wiki/Getting%20Started (which should also point to the upstream page). |
I've added a big note to the wiki page you linked saying to use upstream LLVM instead. I wouldn't link to the |
testcase:
The text was updated successfully, but these errors were encountered: