mirror of
https://github.com/RPCS3/llvm.git
synced 2025-03-04 08:37:45 +00:00
use autogenerated side-effect information
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26673 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4e5f35973c
commit
aeebe7f208
@ -307,33 +307,11 @@ bool llvm::isInstructionTriviallyDead(Instruction *I) {
|
||||
if (!I->mayWriteToMemory()) return true;
|
||||
|
||||
if (CallInst *CI = dyn_cast<CallInst>(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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user