[PATCH] D94494: canCreateUndefOrPoison: dyn_cast -> dyn_cast_or_null

Markus Lavin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 12 06:51:19 PST 2021


markus created this revision.
markus added a project: LLVM.
Herald added a subscriber: hiraditya.
markus requested review of this revision.
Herald added a subscriber: llvm-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D94494

Files:
  llvm/lib/Analysis/ValueTracking.cpp


Index: llvm/lib/Analysis/ValueTracking.cpp
===================================================================
--- llvm/lib/Analysis/ValueTracking.cpp
+++ llvm/lib/Analysis/ValueTracking.cpp
@@ -4737,7 +4737,7 @@
         ShiftAmounts.push_back(C);
 
       bool Safe = llvm::all_of(ShiftAmounts, [](Constant *C) {
-        auto *CI = dyn_cast<ConstantInt>(C);
+        auto *CI = dyn_cast_or_null<ConstantInt>(C);
         return CI && CI->getValue().ult(C->getType()->getIntegerBitWidth());
       });
       return !Safe;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94494.316080.patch
Type: text/x-patch
Size: 525 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210112/aa2766cb/attachment.bin>


More information about the llvm-commits mailing list