1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00

Fix the instcombine GEP index widening transform to work correctly for vector

getelementptrs.

llvm-svn: 167829
This commit is contained in:
Duncan Sands 2012-11-13 13:01:00 +00:00
parent 8c43343240
commit 834534bbe1
2 changed files with 9 additions and 4 deletions

View File

@ -83,15 +83,15 @@ namespace llvm {
typedef generic_gep_type_iterator<> gep_type_iterator;
inline gep_type_iterator gep_type_begin(const User *GEP) {
return gep_type_iterator::begin(GEP->getOperand(0)->getType(),
GEP->op_begin()+1);
return gep_type_iterator::begin
(GEP->getOperand(0)->getType()->getScalarType(), GEP->op_begin()+1);
}
inline gep_type_iterator gep_type_end(const User *GEP) {
return gep_type_iterator::end(GEP->op_end());
}
inline gep_type_iterator gep_type_begin(const User &GEP) {
return gep_type_iterator::begin(GEP.getOperand(0)->getType(),
GEP.op_begin()+1);
return gep_type_iterator::begin
(GEP.getOperand(0)->getType()->getScalarType(), GEP.op_begin()+1);
}
inline gep_type_iterator gep_type_end(const User &GEP) {
return gep_type_iterator::end(GEP.op_end());

View File

@ -35,3 +35,8 @@ define <2 x i1> @test5(<2 x i8*> %a) {
%B = icmp ult <2 x i8*> %g, zeroinitializer
ret <2 x i1> %B
}
define <2 x i32*> @test7(<2 x {i32, i32}*> %a) {
%w = getelementptr <2 x {i32, i32}*> %a, <2 x i32> <i32 5, i32 9>, <2 x i32> zeroinitializer
ret <2 x i32*> %w
}