[llvm] 84f36b8 - [IR] Remove dead code for unsupported ConstantExpr binops

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 20 03:21:15 PDT 2023


Author: Jay Foad
Date: 2023-04-20T11:18:00+01:00
New Revision: 84f36b82f4d577e8c6a290d81ae3786cb8ba5c6b

URL: https://github.com/llvm/llvm-project/commit/84f36b82f4d577e8c6a290d81ae3786cb8ba5c6b
DIFF: https://github.com/llvm/llvm-project/commit/84f36b82f4d577e8c6a290d81ae3786cb8ba5c6b.diff

LOG: [IR] Remove dead code for unsupported ConstantExpr binops

Added: 
    

Modified: 
    llvm/lib/IR/Constants.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/IR/Constants.cpp b/llvm/lib/IR/Constants.cpp
index 398cedabcfdb7..1d9808ead1ad1 100644
--- a/llvm/lib/IR/Constants.cpp
+++ b/llvm/lib/IR/Constants.cpp
@@ -2259,22 +2259,9 @@ Constant *ConstantExpr::get(unsigned Opcode, Constant *C1, Constant *C2,
   case Instruction::Add:
   case Instruction::Sub:
   case Instruction::Mul:
-  case Instruction::UDiv:
-  case Instruction::SDiv:
-  case Instruction::URem:
-  case Instruction::SRem:
     assert(C1->getType()->isIntOrIntVectorTy() &&
            "Tried to create an integer operation on a non-integer type!");
     break;
-  case Instruction::FAdd:
-  case Instruction::FSub:
-  case Instruction::FMul:
-  case Instruction::FDiv:
-  case Instruction::FRem:
-    assert(C1->getType()->isFPOrFPVectorTy() &&
-           "Tried to create a floating-point operation on a "
-           "non-floating-point type!");
-    break;
   case Instruction::And:
   case Instruction::Or:
   case Instruction::Xor:


        


More information about the llvm-commits mailing list