File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -726,7 +726,8 @@ static void translateUnPackMask(CallInst &CI) {
726
726
llvm::Value *TransCI = Builder.CreateZExt (
727
727
Arg0, llvm::FixedVectorType::get (llvm::Type::getInt16Ty (Context), N));
728
728
TransCI->takeName (&CI);
729
- cast<llvm::Instruction>(TransCI)->setDebugLoc (CI.getDebugLoc ());
729
+ if (llvm::Instruction *TransCInst = dyn_cast<llvm::Instruction>(TransCI))
730
+ TransCInst->setDebugLoc (CI.getDebugLoc ());
730
731
CI.replaceAllUsesWith (TransCI);
731
732
}
732
733
Original file line number Diff line number Diff line change
1
+ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2
+ ; RUN: opt -LowerESIMD -S < %s | FileCheck %s
3
+
4
+ ; This test checks that there is no crash while lowering
5
+ ; __esimd_unpack_mask when its argument is an integer constant.
6
+
7
+ define spir_func <32 x i16 > @_Z3foov () {
8
+ ; CHECK-LABEL: @_Z3foov(
9
+ ; CHECK-NEXT: ret <32 x i16> zext (<32 x i1> bitcast (<1 x i32> <i32 1717986918> to <32 x i1>) to <32 x i16>)
10
+ ;
11
+ %call.i.i = call spir_func <32 x i16 > @_Z19__esimd_unpack_maskILi32EEN2cl4sycl5INTEL3gpu11vector_typeItXT_EE4typeEj (i32 1717986918 )
12
+ ret <32 x i16 > %call.i.i
13
+ }
14
+
15
+ declare dso_local spir_func <32 x i16 > @_Z19__esimd_unpack_maskILi32EEN2cl4sycl5INTEL3gpu11vector_typeItXT_EE4typeEj (i32 )
You can’t perform that action at this time.
0 commit comments