[IR] Prefer scalar type for struct indexes in GEP constant expressions.
authorEli Friedman <efriedma@quicinc.com>
Wed, 17 Jun 2020 23:35:35 +0000 (16:35 -0700)
committerEli Friedman <efriedma@quicinc.com>
Tue, 23 Jun 2020 23:14:36 +0000 (16:14 -0700)
commit90ad786947cc861756c95238f96c267b2a3c4849
tree1c90a2e18b14b1102b38c5342c9bac41547c068a
parent723b5a1785426245e3c56b4666ef526b32be84a9
[IR] Prefer scalar type for struct indexes in GEP constant expressions.

This has two advantages: one, it's simpler, and two, it doesn't require
heroic pattern matching with scalable vectors.

Also includes a small fix to DataLayout to allow the scalable vector
testcase to work correctly.

Differential Revision: https://reviews.llvm.org/D82061
llvm/lib/IR/Constants.cpp
llvm/lib/IR/DataLayout.cpp
llvm/test/Analysis/ConstantFolding/vectorgep-crash.ll
llvm/test/Transforms/InstSimplify/gep.ll