From aeebe7f208eda273041a3d31cb261bfe372ea96b Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 9 Mar 2006 22:38:10 +0000 Subject: [PATCH] use autogenerated side-effect information git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26673 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/Local.cpp | 32 +++++--------------------------- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/lib/Transforms/Utils/Local.cpp b/lib/Transforms/Utils/Local.cpp index 9685e94cc19..9c7bfcebce6 100644 --- a/lib/Transforms/Utils/Local.cpp +++ b/lib/Transforms/Utils/Local.cpp @@ -307,33 +307,11 @@ bool llvm::isInstructionTriviallyDead(Instruction *I) { if (!I->mayWriteToMemory()) return true; if (CallInst *CI = dyn_cast(I)) - if (Function *F = CI->getCalledFunction()) - switch (F->getIntrinsicID()) { - default: break; - case Intrinsic::returnaddress: - case Intrinsic::frameaddress: - case Intrinsic::stacksave: - case Intrinsic::isunordered_f32: - case Intrinsic::isunordered_f64: - case Intrinsic::bswap_i16: - case Intrinsic::bswap_i32: - case Intrinsic::bswap_i64: - case Intrinsic::ctpop_i8: - case Intrinsic::ctpop_i16: - case Intrinsic::ctpop_i32: - case Intrinsic::ctpop_i64: - case Intrinsic::ctlz_i8: - case Intrinsic::ctlz_i16: - case Intrinsic::ctlz_i32: - case Intrinsic::ctlz_i64: - case Intrinsic::cttz_i8: - case Intrinsic::cttz_i16: - case Intrinsic::cttz_i32: - case Intrinsic::cttz_i64: - case Intrinsic::sqrt_f32: - case Intrinsic::sqrt_f64: - return true; // These intrinsics have no side effects. - } + if (Function *F = CI->getCalledFunction()) { +#define GET_SIDE_EFFECT_INFO +#include "llvm/Intrinsics.gen" +#undef GET_SIDE_EFFECT_INFO + } return false; } -- 2.34.1