This is an archive of the discontinued LLVM Phabricator instance.

[SimplifyCFG] Don't lower complex ConstantExprs to lookup tables
ClosedPublic

Authored by olista01 on Oct 13 2016, 3:19 AM.

Details

Summary

Not all ConstantExprs can be represented by a global variable, for example most pointer arithmetic other than addition of a constant, so we can't convert these values from switch statements to lookup tables.

Diff Detail

Repository
rL LLVM

Event Timeline

olista01 updated this revision to Diff 74487.Oct 13 2016, 3:19 AM
olista01 retitled this revision from to [SimplifyCFG] Don't lower complex ConstantExprs to lookup tables.
olista01 updated this object.
olista01 added a reviewer: eli.friedman.
olista01 set the repository for this revision to rL LLVM.
olista01 added a subscriber: llvm-commits.
efriedma requested changes to this revision.Oct 13 2016, 1:49 PM
efriedma added a reviewer: efriedma.
efriedma added a subscriber: efriedma.

I don't think this testcase is quite right... it passes even without your patch. Maybe you need to tweak the GEP a bit so it doesn't fail the isGEPWithNoNotionalOverIndexing check?

This revision now requires changes to proceed.Oct 13 2016, 1:49 PM
olista01 updated this revision to Diff 74627.Oct 14 2016, 1:42 AM
olista01 edited edge metadata.

Add a triple to the test, and move it to the ARM directory. Previously, the transformation was never done because a TTI check for legal types fails with the default implementation.

efriedma accepted this revision.Oct 14 2016, 10:19 AM
efriedma edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Oct 14 2016, 10:19 AM
This revision was automatically updated to reflect the committed changes.