This is an archive of the discontinued LLVM Phabricator instance.

[CGP] Fix common type handling in optimizeMemoryInst
ClosedPublic

Authored by skatkov on Nov 27 2017, 1:49 AM.

Details

Summary

If common type is different we should bail out due to we will not be
able to create a select or Phi of these values.

Basically it is done in ExtAddrMode::compare however it does not work
if we handle the null first and then two values of different types.
so add a check in initializeMap as well. The check in ExtAddrMode::compare
is used as earlier bail out.

Diff Detail

Repository
rL LLVM

Event Timeline

skatkov created this revision.Nov 27 2017, 1:49 AM

John, could you please review this change? We need it to try the next attempt to switch on optimization.

This revision is now accepted and ready to land.Nov 28 2017, 6:26 AM
This revision was automatically updated to reflect the committed changes.