Skip to content

[RISCV] Fix incorrect mask of shuffle vector in the test. (NFC) #130244

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
Mar 10, 2025

Conversation

tclin914
Copy link
Contributor

@tclin914 tclin914 commented Mar 7, 2025

The mask of shuffle vector should be <u, u, 4, 6, 8, 10, 12, 14>, not <u, u, 4, 6, *6, 10, 12, 14> for steps of 2.

And the mask of suffle vector with an undef initial element has been supported by #118509.

The mask of shuffle vector should be <u, u, 4, 6, 8, 10, 12, 14>
not <u, u, 4, 6, *6, 10, 12, 14> for the steps by 2.

And the mask of suffle vector with an undef initial element has been
supported by llvm#118509.
@tclin914 tclin914 requested review from preames and topperc March 7, 2025 05:09
Copy link

github-actions bot commented Mar 7, 2025

⚠️ undef deprecator found issues in your code. ⚠️

You can test this locally with the following command:
git diff -U0 --pickaxe-regex -S '([^a-zA-Z0-9#_-]undef[^a-zA-Z0-9_-]|UndefValue::get)' 93b3cbadc2b624f5daf0ce000684c3c154d0aca4 7e2233beb76f0c34098737f867e0c9d531524f3b llvm/test/CodeGen/RISCV/rvv/fixed-vectors-shufflevector-vnsrl.ll

The following files introduce new uses of undef:

  • llvm/test/CodeGen/RISCV/rvv/fixed-vectors-shufflevector-vnsrl.ll

Undef is now deprecated and should only be used in the rare cases where no replacement is possible. For example, a load of uninitialized memory yields undef. You should use poison values for placeholders instead.

In tests, avoid using undef and having tests that trigger undefined behavior. If you need an operand with some unimportant value, you can add a new argument to the function and use that instead.

For example, this is considered a bad practice:

define void @fn() {
  ...
  br i1 undef, ...
}

Please use the following instead:

define void @fn(i1 %cond) {
  ...
  br i1 %cond, ...
}

Please refer to the Undefined Behavior Manual for more information.

Copy link
Collaborator

@preames preames 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.

@tclin914 tclin914 merged commit f62ab33 into llvm:main Mar 10, 2025
11 of 12 checks passed
@tclin914 tclin914 deleted the maskshufflevector branch March 10, 2025 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants