Skip to content

Commit 5837194

Browse files
committed
[InstCombine] Pre-commit change for coverage
1 parent 47ce75e commit 5837194

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1978,6 +1978,7 @@ static Value *buildNew(Instruction *I, ArrayRef<Value*> NewOps,
19781978
DestTy);
19791979
}
19801980
case Instruction::GetElementPtr: {
1981+
llvm_unreachable("Foo");
19811982
Value *Ptr = NewOps[0];
19821983
ArrayRef<Value*> Idx = NewOps.slice(1);
19831984
return Builder.CreateGEP(cast<GEPOperator>(I)->getSourceElementType(),

llvm/test/Transforms/InstCombine/vec_shuffle.ll

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2-
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
2+
; REQURIES: asserts
3+
; RUN: not --crash opt %s -passes=instcombine -disable-output
34

45
declare <2 x half> @llvm.fabs.v2f16(<2 x half>)
56
declare <2 x float> @llvm.fabs.v2f32(<2 x float>)
@@ -248,6 +249,20 @@ define <2 x i8> @test13a(i8 %x1, i8 %x2) {
248249
ret <2 x i8> %D
249250
}
250251

252+
define <1 x ptr> @shuffle_gep(ptr %x1, ptr %x2) {
253+
; CHECK-LABEL: @shuffle_gep(
254+
; CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x i8> poison, i8 [[X2:%.*]], i64 0
255+
; CHECK-NEXT: [[TMP2:%.*]] = insertelement <2 x i8> [[TMP1]], i8 [[X1:%.*]], i64 1
256+
; CHECK-NEXT: [[D:%.*]] = add <2 x i8> [[TMP2]], <i8 7, i8 5>
257+
; CHECK-NEXT: ret <2 x i8> [[D]]
258+
;
259+
%ins.1 = insertelement <2 x ptr> poison, ptr %x1, i32 0
260+
%ins.2 = insertelement <2 x ptr> %ins.1, ptr %x2, i32 1
261+
%gep = getelementptr i8, <2 x ptr> %ins.2, i64 5
262+
%ret = shufflevector <2 x ptr> %gep, <2 x ptr> poison, <1 x i32> <i32 1>
263+
ret <1 x ptr> %ret
264+
}
265+
251266
; Increasing length of vector ops is not a good canonicalization.
252267

253268
define <3 x i32> @add_wider(i32 %y, i32 %z) {

0 commit comments

Comments
 (0)