[PATCH] D147921: [X86][AMX] Add check for potentially dereferencing null return value
Bing Yu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 10 01:42:44 PDT 2023
yubing created this revision.
Herald added subscribers: pengfei, hiraditya.
Herald added a project: All.
yubing requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D147921
Files:
llvm/lib/Target/X86/X86LowerAMXType.cpp
Index: llvm/lib/Target/X86/X86LowerAMXType.cpp
===================================================================
--- llvm/lib/Target/X86/X86LowerAMXType.cpp
+++ llvm/lib/Target/X86/X86LowerAMXType.cpp
@@ -488,7 +488,7 @@
// Get tile shape.
IntrinsicInst *II = nullptr;
if (IsPHI) {
- Value *PhiOp = dyn_cast<PHINode>(V)->getIncomingValue(0);
+ Value *PhiOp = cast<PHINode>(V)->getIncomingValue(0);
II = cast<IntrinsicInst>(PhiOp);
} else {
II = cast<IntrinsicInst>(V);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147921.512096.patch
Type: text/x-patch
Size: 499 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230410/9240f5a5/attachment.bin>
More information about the llvm-commits
mailing list