instcombine: alloca: Canonicalize scalar allocation array size
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 13 Mar 2015 19:42:09 +0000 (19:42 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 13 Mar 2015 19:42:09 +0000 (19:42 +0000)
commitd747f3f3fe02a2bb20ba04757481713ca1c21d1d
treeacd5ec4d50f4906babf6e0cc184f10c28d6910be
parent5c718580763d3724aab92bc61c56ac52e8ae69b0
instcombine: alloca: Canonicalize scalar allocation array size

As a follow-up to r232200, add an `-instcombine` to canonicalize scalar
allocations to `i32 1`.  Since r232200, `iX 1` (for X != 32) are only
created by RAUWs, so this shouldn't fire too often.  Nevertheless, it's
a cheap check and a nice cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232202 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
test/Transforms/InstCombine/alloca.ll