HomePhabricator

Use the basic cost if a GEP is not used as addressing mode

Authored by junbuml on Sep 29 2017, 7:50 AM.

Description

Use the basic cost if a GEP is not used as addressing mode

Summary:
Currently, getGEPCost() returns TCC_FREE whenever a GEP is a legal addressing mode in the target.
However, since it doesn't check its actual users, it will return FREE even in cases
where the GEP cannot be folded away as a part of actual addressing mode.
For example, if an user of the GEP is a call instruction taking the GEP as a parameter,
then the GEP may not be folded in isel.

Reviewers: hfinkel, efriedma, mcrosier, jingyue, haicheng

Reviewed By: hfinkel

Subscribers: javed.absar, llvm-commits

Differential Revision: https://reviews.llvm.org/D38085

llvm-svn: 314517

Details

Committed
junbumlSep 29 2017, 7:50 AM
Reviewer
hfinkel
Differential Revision
D38085: Use the basic cost if a GEP is not used as addressing mode
Parents
rGc9e363ac69f0: [SystemZ] implement shouldCoalesce()
Branches
Unknown
Tags
Unknown