[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 22:01:22 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rGaaddf43fc3d8: [X86][AMX] Add check for potentially dereferencing null return value (authored by yubing).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147921/new/

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.512335.patch
Type: text/x-patch
Size: 499 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230411/9bdfebc6/attachment.bin>


More information about the llvm-commits mailing list