aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Function.cpp
diff options
context:
space:
mode:
authorSebastian Neubauer <sebastian.neubauer@amd.com>2020-06-03 15:56:40 +0200
committerSebastian Neubauer <sebastian.neubauer@amd.com>2020-07-22 15:59:49 +0200
commit2a6c871596ce8bdd23501a96fd22f0f16d3cfcad (patch)
tree5a4f8a57451082aa942070157ef0adc681ca223d /llvm/lib/IR/Function.cpp
parent5623da56d07b2fa434825af0f3e8494afacf3c52 (diff)
downloadllvm-2a6c871596ce8bdd23501a96fd22f0f16d3cfcad.zip
llvm-2a6c871596ce8bdd23501a96fd22f0f16d3cfcad.tar.gz
llvm-2a6c871596ce8bdd23501a96fd22f0f16d3cfcad.tar.bz2
[InstCombine] Move target-specific inst combining
For a long time, the InstCombine pass handled target specific intrinsics. Having target specific code in general passes was noted as an area for improvement for a long time. D81728 moves most target specific code out of the InstCombine pass. Applying the target specific combinations in an extra pass would probably result in inferior optimizations compared to the current fixed-point iteration, therefore the InstCombine pass resorts to newly introduced functions in the TargetTransformInfo when it encounters unknown intrinsics. The patch should not have any effect on generated code (under the assumption that code never uses intrinsics from a foreign target). This introduces three new functions: TargetTransformInfo::instCombineIntrinsic TargetTransformInfo::simplifyDemandedUseBitsIntrinsic TargetTransformInfo::simplifyDemandedVectorEltsIntrinsic A few target specific parts are left in the InstCombine folder, where it makes sense to share code. The largest left-over part in InstCombineCalls.cpp is the code shared between arm and aarch64. This allows to move about 3000 lines out from InstCombine to the targets. Differential Revision: https://reviews.llvm.org/D81728
Diffstat (limited to 'llvm/lib/IR/Function.cpp')
-rw-r--r--llvm/lib/IR/Function.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp
index 35472f7..c925adc 100644
--- a/llvm/lib/IR/Function.cpp
+++ b/llvm/lib/IR/Function.cpp
@@ -618,6 +618,10 @@ static const char * const IntrinsicNameTable[] = {
#include "llvm/IR/IntrinsicImpl.inc"
#undef GET_INTRINSIC_TARGET_DATA
+bool Function::isTargetIntrinsic() const {
+ return IntID > TargetInfos[0].Count;
+}
+
/// Find the segment of \c IntrinsicNameTable for intrinsics with the same
/// target as \c Name, or the generic table if \c Name is not target specific.
///