This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] allow any pair of bitcasts to be combined
ClosedPublic

Authored by spatel on Dec 11 2015, 2:19 PM.

Details

Summary

This change is discussed in D15392.
It should be safe to convert any pair of bitcasts into a single bitcast.

It was mentioned here:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20110829/127089.html
that we're not allowed to bitcast from an x86_mmx to some other types, but I'm not seeing any failures from that.
I can add mmx-specific regression tests to confirm if that is still a concern.

Diff Detail

Repository
rL LLVM

Event Timeline

spatel updated this revision to Diff 42570.Dec 11 2015, 2:19 PM
spatel retitled this revision from to [InstCombine] allow any pair of bitcasts to be combined.
spatel updated this object.
spatel added reviewers: hfinkel, nadav.
spatel added a subscriber: llvm-commits.
hfinkel accepted this revision.Dec 11 2015, 4:14 PM
hfinkel edited edge metadata.

LGTM.

I can add mmx-specific regression tests to confirm if that is still a concern.

It looks like we already have these (test/CodeGen/X86/bitcast-mmx.ll and test/CodeGen/X86/mmx-bitcast.ll)

This revision is now accepted and ready to land.Dec 11 2015, 4:14 PM

LGTM.

I can add mmx-specific regression tests to confirm if that is still a concern.

It looks like we already have these (test/CodeGen/X86/bitcast-mmx.ll and test/CodeGen/X86/mmx-bitcast.ll)

Ah, right - I was only looking in the InstCombine test folder. Thanks!

This revision was automatically updated to reflect the committed changes.