[PATCH] D24544: SpeculativeExecution: Stop using whitelist for costs

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 10 05:22:42 PDT 2017


chandlerc added a comment.

In https://reviews.llvm.org/D24544#546434, @reames wrote:

> I'd suggest looking over the isSafeToSpeculate code carefully.  If we had any bugs there, this whitelist might have been helping to cover over them in practice.  In particular, the default: return true; case in that function looks suspicious.  You might want to convert that into a fully covered switch and cross reference the two lists to make sure this change isn't accidentally semantic.


Perhaps unsurprisingly, this review comment proved prophetic.

This patch causes us to "miscompile" some CUDA kernels.

That said, LLVM may not be at fault as PTXAS has known bugs that miscompile valid PTX programs, so I'm going to try to somehow produce a test case that shows what is going on here.

In the meantime, it sure would be nice to do as Philip suggested and make that switch covering so that we don't just have the default be safe. Or at least make the default be unsafe, which seems ... far better.


https://reviews.llvm.org/D24544





More information about the llvm-commits mailing list