This is an archive of the discontinued LLVM Phabricator instance.

InstCombine: Gracefully handle more allocas in the wrong address space
ClosedPublic

Authored by arsenm on Dec 16 2021, 12:22 PM.

Details

Summary

Officially this is currently required to always use the datalayout's
alloca address space. This may change in the future, and it's cleaner
to propagate the existing alloca's addrspace anyway.

This is a triple fix. Initially the change in simplifyAllocaArraySize
would drop the address space, but produce output. Fixing this hit an
assertion in the cast combine.

This patch also makes the changes to handle this situation from
a33e12801279a947c74fdee2655b24480941fb39 dead, so eliminate
it. InstCombine should not take it upon itself to introduce
addrspacecasts, and preserve the original address space instead.

Diff Detail

Event Timeline

arsenm created this revision.Dec 16 2021, 12:22 PM
arsenm requested review of this revision.Dec 16 2021, 12:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 16 2021, 12:22 PM
Herald added a subscriber: wdng. · View Herald Transcript
jdoerfert accepted this revision.Dec 23 2021, 9:11 AM

IC keeping the AS as it is, I like it.

This revision is now accepted and ready to land.Dec 23 2021, 9:11 AM