[PATCH] D51794: AMDGPU: Don't error on calls to null or undef

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 9 18:43:10 PDT 2018


arsenm added a comment.

In https://reviews.llvm.org/D51794#1228246, @rampitec wrote:

> In https://reviews.llvm.org/D51794#1228202, @arsenm wrote:
>
> > HCC had a bug recently that was producing calls to under. I assume a call to null would appear for a pure virtual call. They are undefined to execute, but they could appear in dead code that is never reached so it’s not an error to have them exist
>
>
> A standard reaction to pure virtual call is a runtime error message and abort. We cannot produce an error message from kernel but we can abort. I would suggest to lower it to s_trap.


I don't think this is how that's implemented. Other targets generate a literal call to null in this case. This is an edge case since typically undef/null calls are turned into unreachable in simplifycfg, which there is a flag to generate a trap on separately.


https://reviews.llvm.org/D51794





More information about the llvm-commits mailing list