Commit fba30747 authored by Tom Stellard's avatar Tom Stellard
Browse files

Merging r302137:

------------------------------------------------------------------------
r302137 | mstorsjo | 2017-05-04 06:54:35 -0400 (Thu, 04 May 2017) | 9 lines

[ArgPromotion] Fix a truncated variable

This fixes a regression since SVN rev 273808 (which was supposed to
not change functionality).

The regression caused miscompilations (noted in the wild when targeting
AArch64) on platforms with 32 bit long.

Differential Revision: https://reviews.llvm.org/D32850
------------------------------------------------------------------------

llvm-svn: 303661
parent baeb745d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -826,7 +826,7 @@ DoPromotion(Function *F, SmallPtrSetImpl<Argument *> &ArgsToPromote,
          if (!ArgIndex.second.empty()) {
            Ops.reserve(ArgIndex.second.size());
            Type *ElTy = V->getType();
            for (unsigned long II : ArgIndex.second) {
            for (auto II : ArgIndex.second) {
              // Use i32 to index structs, and i64 for others (pointers/arrays).
              // This satisfies GEP constraints.
              Type *IdxTy = (ElTy->isStructTy() ?