This is a simple addition to emitConditionalComparison, to match CCMP with immediates using getIConstantVRegValWithLookThrough, letting it select the CCMPri variants of the instructions.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Just a heads-up, we are seeing miscompiles that look to be caused by this patch. I'll try to share in isolated reproducer.
OK - feel free to revert. (I have no decent testing for GlobalISel yet).
Is it worth setting up a bot to police it?
It turns out the mis-compile can also be reproduced by just bootstrapping LLVM with -O3 -fglobal-isel on AArch64 hardware. I reverted the change for now.
Is it worth setting up a bot to police it?
Yes definitely. It doesn't look like we have any buildbots covering GlobalISel on AArch64. I'll see if we can at least add a bootstrapping bot.
llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp | ||
---|---|---|
4850 | This condition is different from the one above? The C->Value.ult(32) differs. |
It turns out the mis-compile can also be reproduced by just bootstrapping LLVM with -O3 -fglobal-isel on AArch64 hardware. I reverted the change for now.
I've tested a bootstrap and it worked with the new code. Please let me know if anything else seems broken.
llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp | ||
---|---|---|
4850 | Yeah, that was pretty daft. It was intended to clear the C if it wasn't set to anything useful. I've changed it to a opcode check instead. |
Considering there was a miscompile with this last time, I think there's probably a missing testcase. Could you add a test which covers the part that was broken last time?
llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp | ||
---|---|---|
4850 | It'd be nice to have a comment here |
The recommit in https://reviews.llvm.org/rG3c6edc0b2f812503a802bdd9c5842a0a9396b8c1 has a new test case and checks on the opcode, not the const.
This condition is different from the one above? The C->Value.ult(32) differs.