Files
clang-p2996/llvm/test/Transforms/InstCombine/pr34627.ll
Davide Italiano dee018c51f [ConstantFold] Return the correct type when folding a GEP with vector indices.
As Eli pointed out (and I got wrong in the first place), langref says: "The
getelementptr returns a vector of pointers, instead of a single address, when one
or more of its arguments is a vector. In such cases, all vector arguments should
have the same number of elements, and every scalar argument will be effectively
broadcast into a vector during address calculation."

Costantfold for gep doesn't really take in account this paragraph, returning a
pointer instead of a vector of pointer which triggers an assertion in RAUW,
as we're trying to replace values with mistmatching types.

Differential Revision:  https://reviews.llvm.org/D37928

llvm-svn: 313394
2017-09-15 20:53:05 +00:00

12 lines
382 B
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -instcombine %s |FileCheck %s
define <2 x i16> @patatino() {
; CHECK-LABEL: @patatino(
; CHECK-NEXT: ret <2 x i16> zeroinitializer
;
%tmp2 = getelementptr inbounds [1 x i16], [1 x i16]* null, i16 0, <2 x i16> undef
%tmp3 = ptrtoint <2 x i16*> %tmp2 to <2 x i16>
ret <2 x i16> %tmp3
}