This is an archive of the discontinued LLVM Phabricator instance.

Do not assume the value passed to memset is an i32.
ClosedPublic

Authored by jobnoorman on Aug 28 2014, 2:28 AM.

Details

Summary

The code in SelectionDAG::getMemset for some reason assumes the value passed to memset is an i32. This breaks the generated code for targets that only have registers smaller than 32 bits because the value might get split into multiple registers by the calling convention. See the test for the MSP430 target included in the patch for an example.

This patch ensures that nothing is assumed about the type of the value. Instead, the type is taken from the selected overload of the llvm.memset intrinsic.

Diff Detail

Event Timeline

jobnoorman updated this revision to Diff 13024.Aug 28 2014, 2:28 AM
jobnoorman retitled this revision from to Do not assume the value passed to memset is an i32..
jobnoorman updated this object.
jobnoorman edited the test plan for this revision. (Show Details)
jobnoorman added reviewers: resistor, asl.
resistor edited edge metadata.Aug 28 2014, 9:57 AM

LGTM.

—Owen

jobnoorman accepted this revision.Aug 29 2014, 1:34 AM
jobnoorman added a reviewer: jobnoorman.

Thanks for the reviews! r216716

This revision is now accepted and ready to land.Aug 29 2014, 1:34 AM
jobnoorman closed this revision.Sep 9 2014, 6:48 AM