diff options
author | Ulrich Weigand <ulrich.weigand@de.ibm.com> | 2016-03-31 15:37:06 +0000 |
---|---|---|
committer | Ulrich Weigand <ulrich.weigand@de.ibm.com> | 2016-03-31 15:37:06 +0000 |
commit | 3707ba80302b184c850ccdab2191650b75486742 (patch) | |
tree | 311ca1ffe77dff4042cc8c41977a3067459ff22c /llvm/lib/Transforms/Utils/SplitModule.cpp | |
parent | a621a7f9c30b86f7c38487ab2c24dea4b14043b3 (diff) | |
download | llvm-3707ba80302b184c850ccdab2191650b75486742.zip llvm-3707ba80302b184c850ccdab2191650b75486742.tar.gz llvm-3707ba80302b184c850ccdab2191650b75486742.tar.bz2 |
[PowerPC] Correctly compute 64-bit offsets in fast isel
PPCSimplifyAddress contains this code:
IntegerType *OffsetTy = ((VT == MVT::i32) ? Type::getInt32Ty(*Context)
: Type::getInt64Ty(*Context));
to determine the type to be used for an index register, if one needs
to be created. However, the "VT" here is the type of the data being
loaded or stored, *not* the type of an address. This means that if
a data element of type i32 is accessed using an index that does not
not fit into 32 bits, a wrong address is computed here.
Note that PPCFastISel is only ever used on 64-bit currently, so the type
of an address is actually *always* MVT::i64. Other parts of the code,
even in this same PPCSimplifyAddress routine, already rely on that fact.
Thus, this patch changes the code to simply unconditionally use
Type::getInt64Ty(*Context) as OffsetTy.
llvm-svn: 265023
Diffstat (limited to 'llvm/lib/Transforms/Utils/SplitModule.cpp')
0 files changed, 0 insertions, 0 deletions