HomePhabricator

[IRTranslator] Don't hardcode GEP index type

Authored by rovka on May 14 2019, 2:25 AM.

Description

[IRTranslator] Don't hardcode GEP index type

When breaking up loads and stores of aggregates, the IRTranslator uses
LLT::scalar(64) for the index type of the G_GEP instructions that
compute the addresses. This is unnecessarily large for 32-bit targets.
Use the int ptr type provided by the DataLayout instead.

Note that we're already doing the right thing when translating
getelementptr instructions from the IR. This is just an oversight when
generating new ones while translating loads/stores.

Both x86 and AArch64 already have tests confirming that the old
behaviour is preserved for 64-bit targets.

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

llvm-svn: 360656

Details

Committed
rovkaMay 14 2019, 2:25 AM
Differential Revision
D61852: [IRTranslator] Don't hardcode GEP index type
Parents
rGb1f213cfdc86: TestMinidumpNew.py: Use yaml2obj where possible
Branches
Unknown
Tags
Unknown