Skip to content
Permalink
Browse files

[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302137 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
mstorsjo committed May 4, 2017
1 parent e11b0c6 commit 623692ec9cd5fd1dd90ef0fb66846430134111f9
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/Transforms/IPO/ArgumentPromotion.cpp
@@ -247,7 +247,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 =

0 comments on commit 623692e

Please sign in to comment.