mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-17 23:44:43 +00:00
Fix the instcombine GEP index widening transform to work correctly for vector
getelementptrs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167829 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2333e29be4
commit
707276d415
@ -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());
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user