[llvm] 323cb26 - [ValueTracking] Use a switch statement (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 27 13:43:43 PDT 2020


Author: Nikita Popov
Date: 2020-06-27T22:42:43+02:00
New Revision: 323cb26cef4a1766b660745c38238617c1f1cf33

URL: https://github.com/llvm/llvm-project/commit/323cb26cef4a1766b660745c38238617c1f1cf33
DIFF: https://github.com/llvm/llvm-project/commit/323cb26cef4a1766b660745c38238617c1f1cf33.diff

LOG: [ValueTracking] Use a switch statement (NFC)

Added: 
    

Modified: 
    llvm/lib/Analysis/ValueTracking.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index 9db6aabc728f..3979d3d11f7a 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -4102,12 +4102,17 @@ llvm::getArgumentAliasingToReturnedPointer(const CallBase *Call,
 
 bool llvm::isIntrinsicReturningPointerAliasingArgumentWithoutCapturing(
     const CallBase *Call, bool MustPreserveNullness) {
-  return Call->getIntrinsicID() == Intrinsic::launder_invariant_group ||
-         Call->getIntrinsicID() == Intrinsic::strip_invariant_group ||
-         Call->getIntrinsicID() == Intrinsic::aarch64_irg ||
-         Call->getIntrinsicID() == Intrinsic::aarch64_tagp ||
-         (!MustPreserveNullness &&
-          Call->getIntrinsicID() == Intrinsic::ptrmask);
+  switch (Call->getIntrinsicID()) {
+  case Intrinsic::launder_invariant_group:
+  case Intrinsic::strip_invariant_group:
+  case Intrinsic::aarch64_irg:
+  case Intrinsic::aarch64_tagp:
+    return true;
+  case Intrinsic::ptrmask:
+    return !MustPreserveNullness;
+  default:
+    return false;
+  }
 }
 
 /// \p PN defines a loop-variant pointer to an object.  Check if the


        


More information about the llvm-commits mailing list