This is an archive of the discontinued LLVM Phabricator instance.

[GISel] Add combiners for G_INTTOPTR and G_PTRTOINT
ClosedPublic

Authored by mkitzan on Jul 29 2020, 8:52 PM.

Details

Summary

Patch adds two new GICombinerRules, one for G_INTTOPTR and one for G_PTRTOINT. The G_INTTOPTR elides ptr2int(int2ptr(x)) to a copy of x, if the cast is within the same address space. The G_PTRTOINT elides int2ptr(ptr2int(x)) to a copy of x. Patch additionally adds new combiner tests for the AArch64 target to test these new combiner rules.

Diff Detail

Event Timeline

mkitzan created this revision.Jul 29 2020, 8:52 PM
mkitzan requested review of this revision.Jul 29 2020, 8:52 PM
paquette added inline comments.Jul 30 2020, 11:55 AM
llvm/include/llvm/Target/GlobalISel/Combine.td
293

Maybe put these under identity_combines?

mkitzan updated this revision to Diff 282078.Jul 30 2020, 4:25 PM

Moved the two new combiner rules to identity_combines.

This revision is now accepted and ready to land.Jul 30 2020, 4:26 PM

Great, thanks for the review! I don't have commit access. Would be great if someone could commit on my behalf.

I can commit it for you.

Thanks, Aditya!

mkitzan closed this revision.Jul 31 2020, 10:33 AM