This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Fix IC trying to create a xor of pointer types
ClosedPublic

Authored by aemerson on Aug 15 2018, 6:38 AM.

Details

Summary

[InstCombine] Fix IC trying to create a xor of pointer types.

We were previously crashing here because icmp operands can be pointers as well as integers, and the code didn't check before building a xor. I've fixed this by doing a ptrtoint convert on the assumption that ptrtoints are free.

rdar://42473741

Diff Detail

Repository
rL LLVM

Event Timeline

aemerson created this revision.Aug 15 2018, 6:38 AM

I've fixed this by doing a ptrtoint convert on the assumption that ptrtoints are free.

I don't think we can make that assumption as a target-independent transform. Restrict this fold to integer types instead?

aemerson updated this revision to Diff 160845.Aug 15 2018, 10:36 AM

Sure, done.

spatel accepted this revision.Aug 15 2018, 10:42 AM

LGTM

This revision is now accepted and ready to land.Aug 15 2018, 10:42 AM
This revision was automatically updated to reflect the committed changes.