This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] fix crash due to ignored addrspacecast
ClosedPublic

Authored by JeffBezanson on May 10 2018, 1:19 PM.

Details

Summary

Part of the InstCombine code for simplifying GEPs looks through
addrspacecasts. However, this was done by updating a variable
also used by the next transformation, for marking GEPs as
inbounds. This led to replacing a GEP with a similar instruction
in a different addrspace, which caused an assertion failure in RAUW.

This caused julia issue https://github.com/JuliaLang/julia/issues/27055

Diff Detail

Repository
rL LLVM

Event Timeline

JeffBezanson created this revision.May 10 2018, 1:19 PM
arsenm added inline comments.May 11 2018, 1:44 AM
test/Transforms/InstCombine/gep-addrspace.ll
45 ↗(On Diff #146210)

Seems like more should be checked, like the GEP from the broken transform (as well as the source/dest address spaces)

Add more checks

JeffBezanson marked an inline comment as done.May 11 2018, 11:49 AM
arsenm accepted this revision.May 14 2018, 12:07 AM

LGTM

This revision is now accepted and ready to land.May 14 2018, 12:07 AM
This revision was automatically updated to reflect the committed changes.