This is an archive of the discontinued LLVM Phabricator instance.

[SelectionDAG][FIX] Allow "returned" arguments to be bit-casted
ClosedPublic

Authored by jdoerfert on Mar 27 2019, 11:42 PM.

Details

Summary

An argument that is return by a function but bit-casted before can still
be annotated as "returned". Make sure we do not crash for this case.

Event Timeline

jdoerfert created this revision.Mar 27 2019, 11:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 27 2019, 11:42 PM
arsenm added inline comments.Apr 17 2019, 6:11 AM
llvm/test/CodeGen/Generic/arg_returned_bitcast.ll
1–2

test/CodeGen/Generic should not be used. This should be moved to some specific target, and test something in the output

arsenm added inline comments.Apr 17 2019, 6:12 AM
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
8948–8949

Maybe this should also assert that the address spaces match? I don't know if the verifier checks this or not, but it should

jdoerfert updated this revision to Diff 202989.Jun 4 2019, 11:18 AM
jdoerfert marked an inline comment as done.

Update according to comments

arsenm accepted this revision.Jun 4 2019, 11:21 AM

LGTM

This revision is now accepted and ready to land.Jun 4 2019, 11:21 AM
This revision was automatically updated to reflect the committed changes.
jdoerfert marked an inline comment as done.