Skip to content

Conversation

@fmayer
Copy link
Contributor

@fmayer fmayer commented Jun 11, 2025

No description provided.

Created using spr 1.3.4
@fmayer fmayer requested a review from thurstond June 11, 2025 00:14
@github-actions
Copy link

⚠️ 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)' 'HEAD~1' HEAD llvm/test/Instrumentation/MemorySanitizer/X86/avx512vl-intrinsics.ll llvm/test/Instrumentation/MemorySanitizer/X86/x86-vpermi2.ll

The following files introduce new uses of undef:

  • llvm/test/Instrumentation/MemorySanitizer/X86/avx512vl-intrinsics.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.

@fmayer
Copy link
Contributor Author

fmayer commented Jun 11, 2025

accidentally created second #143643

@fmayer fmayer closed this Jun 11, 2025
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