This is an archive of the discontinued LLVM Phabricator instance.

[InlineCost, NFC] Extract code dealing with inbounds GEPs from CallAnalyzer::visitGetElementPtr into separate function
ClosedPublic

Authored by eastig on Sep 25 2017, 5:33 AM.

Details

Summary

This patch is refactoring the CallAnalyzer::visitGetElementPtr code in order to simplify fixing the bug https://bugs.llvm.org/show_bug.cgi?id=33642 "[InlineCost] CallAnalyzer::visitGetElementPtr can return true for GEPs which are not cost-free".

The code responsible for analysis of inbounds GEPs is extracted into a separate function: CallAnalyzer::canFoldInboundsGEP. With the patch SROA enabling/disabling code is localized at one place instead of spreading across the code of CallAnalyzer::visitGetElementPtr.

Diff Detail

Repository
rL LLVM

Event Timeline

eastig created this revision.Sep 25 2017, 5:33 AM
efriedma accepted this revision.Oct 2 2017, 2:02 PM

LGTM

This revision is now accepted and ready to land.Oct 2 2017, 2:02 PM
eastig added a comment.Oct 3 2017, 2:28 AM

Thank you, Eli.

This revision was automatically updated to reflect the committed changes.