mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 21:18:19 +00:00
Allow constfolding of llvm.sin.* and llvm.cos.* intrinsics
This patch const folds llvm.sin.* and llvm.cos.* intrinsics whenever feasible. Differential Revision: http://reviews.llvm.org/D10836 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241665 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1234,6 +1234,8 @@ bool llvm::canConstantFoldCallTo(const Function *F) {
|
||||
case Intrinsic::floor:
|
||||
case Intrinsic::ceil:
|
||||
case Intrinsic::sqrt:
|
||||
case Intrinsic::sin:
|
||||
case Intrinsic::cos:
|
||||
case Intrinsic::pow:
|
||||
case Intrinsic::powi:
|
||||
case Intrinsic::bswap:
|
||||
@@ -1450,6 +1452,10 @@ static Constant *ConstantFoldScalarCall(StringRef Name, unsigned IntrinsicID,
|
||||
return ConstantFoldFP(floor, V, Ty);
|
||||
case Intrinsic::ceil:
|
||||
return ConstantFoldFP(ceil, V, Ty);
|
||||
case Intrinsic::sin:
|
||||
return ConstantFoldFP(sin, V, Ty);
|
||||
case Intrinsic::cos:
|
||||
return ConstantFoldFP(cos, V, Ty);
|
||||
}
|
||||
|
||||
if (!TLI)
|
||||
|
||||
Reference in New Issue
Block a user