From: Simon Pilgrim Date: Wed, 8 May 2019 10:39:56 +0000 (+0000) Subject: R600InstrInfo.cpp - Add getTransSwizzle assert for the swizzle op index. NFCI. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=507eb79ef0a660919801681ad8481bd4fc136567;p=llvm R600InstrInfo.cpp - Add getTransSwizzle assert for the swizzle op index. NFCI. Fixes static analyzer undefined value warning. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360239 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/AMDGPU/R600InstrInfo.cpp b/lib/Target/AMDGPU/R600InstrInfo.cpp index bc21d912db1..d9e839fe203 100644 --- a/lib/Target/AMDGPU/R600InstrInfo.cpp +++ b/lib/Target/AMDGPU/R600InstrInfo.cpp @@ -401,6 +401,7 @@ Swizzle(std::vector> Src, } static unsigned getTransSwizzle(R600InstrInfo::BankSwizzle Swz, unsigned Op) { + assert(Op < 3 && "Out of range swizzle index"); switch (Swz) { case R600InstrInfo::ALU_VEC_012_SCL_210: { unsigned Cycles[3] = { 2, 1, 0};