Index: include/llvm/IR/Operator.h =================================================================== --- include/llvm/IR/Operator.h +++ include/llvm/IR/Operator.h @@ -402,7 +402,7 @@ /// getPointerAddressSpace - Method to return the address space of the /// pointer operand. unsigned getPointerAddressSpace() const { - return cast(getPointerOperandType())->getAddressSpace(); + return getPointerOperandType()->getPointerAddressSpace(); } unsigned getNumIndices() const { // Note: always non-negative Index: test/Transforms/MergeFunc/vector-GEP-crash.ll =================================================================== --- /dev/null +++ test/Transforms/MergeFunc/vector-GEP-crash.ll @@ -0,0 +1,12 @@ +; RUN: opt -mergefunc -disable-output < %s +; This used to cause a crash when compairing the GEPs + +define void @foo(<2 x i64*>) { + %tmp = getelementptr <2 x i64*> %0, <2 x i64> + ret void +} + +define void @bar(<2 x i64*>) { + %tmp = getelementptr <2 x i64*> %0, <2 x i64> + ret void +}