Open Quuxplusone opened 5 years ago
Attached miscompile.txt
(3466 bytes, text/plain): Miscompilation analysis
There's a strong possibility that the patch itself is fine, and you're finding some unrelated miscompile. You could try dumping the "-mllvm -debug-only=sroa" log before/after the patch, to check if there's some difference that's obviously wrong, I guess.
It should be possible to extract a small reproduction... although we don't have great tooling to do that with ThinLTO at the moment. You can use lld -save-temps to get the bitcode and object files for each ThinLTO unit, find the relevant file, do whatever transform on it, and link against the other ELF files dumped by -save-temps. (It's not obvious if the bad transform here is happening at ThinLTO time, or during bitcode generation, though.)
https://llvm.org/docs/OptBisect.html is generally useful for debugging configurations which are hard to break into separate steps. But there isn't any way to make it properly bisect a ThinLTO pipeline at the moment. (Someone should probably look into implementing that.)
I've attempted to gather the various bits of information that have been requested, but it's turning out to be too much of a pain. As I've mentioned this is an especially frustrating build configuration, and the builds don't even run on my machine, I have to send them off to a remote server.
I had been hoping that a problem might be obvious from inspection of the codegen (sometimes this works, so it's worth trying) but if we need to dig deeper then there isn't much hope. Maybe we or someone else will hit this again on a more easily debuggable build configuration.
miscompile.txt
(3466 bytes, text/plain)