Skip to content

[LV] Remove redundant check. nfc #135605

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

Merged
merged 1 commit into from
Apr 15, 2025
Merged

[LV] Remove redundant check. nfc #135605

merged 1 commit into from
Apr 15, 2025

Conversation

Mel-Chen
Copy link
Contributor

Remove the redundant !TheLoop->contains(Op->getParent()) check since !TheLoop->contains(Op) has already been verified.

@llvmbot
Copy link
Member

llvmbot commented Apr 14, 2025

@llvm/pr-subscribers-vectorizers

@llvm/pr-subscribers-llvm-transforms

Author: Mel Chen (Mel-Chen)

Changes

Remove the redundant !TheLoop->contains(Op->getParent()) check since !TheLoop->contains(Op) has already been verified.


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

1 Files Affected:

  • (modified) llvm/lib/Transforms/Vectorize/LoopVectorize.cpp (-3)
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index a4d546f698d5f..3a76fa98a42cb 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -7203,9 +7203,6 @@ void LoopVectorizationCostModel::collectValuesToIgnore() {
         }))
       continue;
 
-    if (!TheLoop->contains(Op->getParent()))
-      continue;
-
     // If all of Op's users are in ValuesToIgnore, add it to ValuesToIgnore
     // which applies for both scalar and vector versions. Otherwise it is only
     // dead in vector versions, so only add it to VecValuesToIgnore.

Copy link
Contributor

@fhahn fhahn left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

@Mel-Chen Mel-Chen merged commit e96111d into llvm:main Apr 15, 2025
13 of 14 checks passed
@Mel-Chen Mel-Chen deleted the nfc-dead-check branch April 15, 2025 00:21
var-const pushed a commit to ldionne/llvm-project that referenced this pull request Apr 17, 2025
Remove the redundant `!TheLoop->contains(Op->getParent())` check since
`!TheLoop->contains(Op)` has already been verified.
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