[llvm] r368893 - InferAddressSpaces: Remove unnecessary check for ConstantInt

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 14 11:01:42 PDT 2019


Author: arsenm
Date: Wed Aug 14 11:01:42 2019
New Revision: 368893

URL: http://llvm.org/viewvc/llvm-project?rev=368893&view=rev
Log:
InferAddressSpaces: Remove unnecessary check for ConstantInt

The IR is invalid if this isn't a constant since immarg was added.

Modified:
    llvm/trunk/lib/Transforms/Scalar/InferAddressSpaces.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/InferAddressSpaces.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InferAddressSpaces.cpp?rev=368893&r1=368892&r2=368893&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/InferAddressSpaces.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/InferAddressSpaces.cpp Wed Aug 14 11:01:42 2019
@@ -269,8 +269,8 @@ bool InferAddressSpaces::rewriteIntrinsi
   case Intrinsic::amdgcn_ds_fadd:
   case Intrinsic::amdgcn_ds_fmin:
   case Intrinsic::amdgcn_ds_fmax: {
-    const ConstantInt *IsVolatile = dyn_cast<ConstantInt>(II->getArgOperand(4));
-    if (!IsVolatile || !IsVolatile->isZero())
+    const ConstantInt *IsVolatile = cast<ConstantInt>(II->getArgOperand(4));
+    if (!IsVolatile->isZero())
       return false;
 
     LLVM_FALLTHROUGH;




More information about the llvm-commits mailing list