asavonic added a comment.

In D100591#2692599 <https://reviews.llvm.org/D100591#2692599>, @rjmccall wrote:

> I think the right thing to do here is to recognize generally that we're 
> emitting a mandatory tail call, and so suppress *all* the normal 
> transformations on the return value.

I assume it can be tricky to detect such call. The final decision (tail call vs 
normal call) is made before instruction selection, after all LLVM IR 
optimization passes. So we can miss tail calls that are not obvious on 
non-optimized code, or get false-positive results for calls that a backend 
decides to emit as normal calls.

In any case, this patch can be useful not only for tail calls: `trunc + zext` 
sequence generated to round a return value can be problematic for other cases 
as well.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100591/new/

https://reviews.llvm.org/D100591

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to