]> granicus.if.org Git - llvm/commitdiff
InferAddressSpaces: Remove unnecessary check for ConstantInt
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 14 Aug 2019 18:01:42 +0000 (18:01 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 14 Aug 2019 18:01:42 +0000 (18:01 +0000)
The IR is invalid if this isn't a constant since immarg was added.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368893 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/InferAddressSpaces.cpp

index 5f0e2001c73de66449248ff2f32705da20f76bb1..e88d3148258e0b98bdb47a117f5a1e69069f6483 100644 (file)
@@ -269,8 +269,8 @@ bool InferAddressSpaces::rewriteIntrinsicOperands(IntrinsicInst *II,
   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;