This is an archive of the discontinued LLVM Phabricator instance.

Fix evaluator for non-zero alloca addr space
ClosedPublic

Authored by yaxunl on May 18 2018, 11:22 AM.

Details

Summary

The evaluator goes through BB and creates global vars as temporary values to evaluate
results of LLVM instructions. It creates undef for alloca, however it assumes alloca
in addr space 0. If the next instruction is addrspace cast to 0, then we get an invalid
cast instruction.

This patch let the temp global var have an address space matching alloca addr space,
so that the valuation can be done.

Diff Detail

Repository
rL LLVM

Event Timeline

yaxunl created this revision.May 18 2018, 11:22 AM
arsenm requested changes to this revision.May 18 2018, 12:09 PM
arsenm added inline comments.
test/Transforms/GlobalOpt/amdgcn-ctor-alloca.ll
7–8 ↗(On Diff #147559)

Needs positive checks

This revision now requires changes to proceed.May 18 2018, 12:09 PM
yaxunl updated this revision to Diff 147584.May 18 2018, 2:20 PM
yaxunl marked an inline comment as done.

Add positive check.

arsenm accepted this revision.May 18 2018, 2:52 PM

LGTM

This revision is now accepted and ready to land.May 18 2018, 2:52 PM
This revision was automatically updated to reflect the committed changes.