This is an archive of the discontinued LLVM Phabricator instance.

Fix bitcast to address space cast for coerced load/stores
ClosedPublic

Authored by david-salinas on Oct 26 2018, 3:08 PM.

Details

Diff Detail

Repository
rC Clang

Event Timeline

david-salinas created this revision.Oct 26 2018, 3:08 PM

remove attribute((cpu)) attribute((hc)) from test

rjmccall added inline comments.Oct 28 2018, 10:55 PM
lib/CodeGen/CGCall.cpp
1260

The main reason why llvm.memcpy is an overloaded intrinsic is so that you can copy things in arbitrary address spaces. Please just cast to the appropriate i8 pointer type in the corresponding address spaces.

As per rjmccall's comments, changed the call to CreatePointerBitCastOrAddrSpaceCast back to a call to CreateBitCast, but now we're casting to the int8* with the address space of the target.

rjmccall added inline comments.Nov 3 2018, 12:00 PM
lib/CodeGen/CGCall.cpp
1257

CGBuilder provides a convenient CreateElementBitCast function for this.

using CreateElementBitCast instead

fix missing ;

rjmccall accepted this revision.Nov 5 2018, 3:56 PM

Thanks! LGTM.

This revision is now accepted and ready to land.Nov 5 2018, 3:56 PM
This revision was automatically updated to reflect the committed changes.