This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel]: While IRTranslating intrinsic calls, for ConstantInt arguments, create a VREG
ClosedPublic

Authored by aditya_nandakumar on Mar 21 2017, 2:51 PM.

Details

Summary

This patch changes the behavior of IRTranslating intrinsics where we now create VREG + G_CONSTANT for ConstantInt values. We already do this for FloatingPoint values.
The reasoning behind this is, when we have several instrinsic calls all having the same i32 constant, and when the backend is selecting the instructions, for certain instructions will not be able to use the immediate directly and will instead need to create a G_CONSTANT and use that VREG. If we have multiple calls that use the same constants, then the backend will have to de-duplicate the creation of G_CONSTANTS + selections. It'll be a lot easier for this to be done in the IRTranslator.

Diff Detail

Repository
rL LLVM

Event Timeline

ab accepted this revision.Mar 21 2017, 5:04 PM

LGTM.

This revision is now accepted and ready to land.Mar 21 2017, 5:04 PM