Skip to content

[TTI] Assert that TargetIRAnalyis is not requested for intrinsics #129600

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

arichardson
Copy link
Member

@arichardson arichardson commented Mar 3, 2025

This catches the bug fixed in #127760
and also finds another call in LowerTypeTests where we request the TTI
for instrinsics instead of skipping them.

Created using spr 1.3.6-beta.1

[skip ci]
Created using spr 1.3.6-beta.1
@llvmbot
Copy link
Member

llvmbot commented Mar 3, 2025

@llvm/pr-subscribers-llvm-analysis

Author: Alexander Richardson (arichardson)

Changes

This catches the bug fixed in #127760
and also finds another call in LowerTypeTests where we request the TTI
for the called instrinsic rather than the calling function.


Full diff: https://github.com/llvm/llvm-project/pull/129600.diff

1 Files Affected:

  • (modified) llvm/lib/Analysis/TargetTransformInfo.cpp (+1)
diff --git a/llvm/lib/Analysis/TargetTransformInfo.cpp b/llvm/lib/Analysis/TargetTransformInfo.cpp
index 1c54395909f10..067b3ec10fc7a 100644
--- a/llvm/lib/Analysis/TargetTransformInfo.cpp
+++ b/llvm/lib/Analysis/TargetTransformInfo.cpp
@@ -1476,6 +1476,7 @@ TargetIRAnalysis::TargetIRAnalysis(
 
 TargetIRAnalysis::Result TargetIRAnalysis::run(const Function &F,
                                                FunctionAnalysisManager &) {
+  assert(!F.isIntrinsic() && "Should not request TTI for intrinsics");
   return TTICallback(F);
 }
 

@arichardson arichardson requested review from asb, lenary, nikic and topperc March 3, 2025 22:49
@arichardson
Copy link
Member Author

Depends on #129599

@arichardson arichardson changed the title [TTI] Assert that this is not requested for intrinsic functions [TTI] Assert that TargetIRAnalyis is not requested for intrinsics Mar 3, 2025
Created using spr 1.3.6-beta.1

[skip ci]
Created using spr 1.3.6-beta.1
Copy link
Contributor

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

arichardson added a commit that referenced this pull request Mar 4, 2025
When looping over all functions in a module to determine whether any of
them is built with support for B.W, we can skip declarations since those
do not have an associated target-feature attribute.
This was found by the assertion from #129600

Reviewed By: statham-arm

Pull Request: #129599
Created using spr 1.3.6-beta.1
@arichardson arichardson changed the base branch from users/arichardson/spr/main.tti-assert-that-this-is-not-requested-for-intrinsic-functions to main March 4, 2025 16:50
@arichardson arichardson merged commit 17f0aaa into main Mar 4, 2025
1 check was pending
@arichardson arichardson deleted the users/arichardson/spr/tti-assert-that-this-is-not-requested-for-intrinsic-functions branch March 4, 2025 16:50
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Mar 4, 2025
…support

When looping over all functions in a module to determine whether any of
them is built with support for B.W, we can skip declarations since those
do not have an associated target-feature attribute.
This was found by the assertion from llvm/llvm-project#129600

Reviewed By: statham-arm

Pull Request: llvm/llvm-project#129599
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Mar 4, 2025
…rinsics

This catches the bug fixed in llvm/llvm-project#127760
and also finds another call in LowerTypeTests where we request the TTI
for instrinsics instead of skipping them.

Reviewed By: nikic

Pull Request: llvm/llvm-project#129600
jph-13 pushed a commit to jph-13/llvm-project that referenced this pull request Mar 21, 2025
When looping over all functions in a module to determine whether any of
them is built with support for B.W, we can skip declarations since those
do not have an associated target-feature attribute.
This was found by the assertion from llvm#129600

Reviewed By: statham-arm

Pull Request: llvm#129599
jph-13 pushed a commit to jph-13/llvm-project that referenced this pull request Mar 21, 2025
This catches the bug fixed in llvm#127760
and also finds another call in LowerTypeTests where we request the TTI
for instrinsics instead of skipping them.

Reviewed By: nikic

Pull Request: llvm#129600
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants