[PATCH] D146629: [SimplifyCFG][LICM] Preserve nonnull, range and align metadata when speculating

Augie Fackler via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 4 13:14:19 PDT 2023


durin42 added a comment.

I got a funny sense of things and decided to try again with

  diff --git a/llvm/lib/IR/Instruction.cpp b/llvm/lib/IR/Instruction.cpp
  index f14737e73fde..849a22ec9c2f 100644
  --- a/llvm/lib/IR/Instruction.cpp
  +++ b/llvm/lib/IR/Instruction.cpp
  @@ -249,7 +249,7 @@ void Instruction::dropUBImplyingAttrsAndMetadata() {
     // !noundef and various AA metadata must be dropped, as it generally produces
     // immediate undefined behavior.
     unsigned KnownIDs[] = {LLVMContext::MD_annotation, LLVMContext::MD_range,
  -                         LLVMContext::MD_nonnull, LLVMContext::MD_align};
  +                         LLVMContext::MD_align};
     dropUBImplyingAttrsAndUnknownMetadata(KnownIDs);
   }

and the tests all pass. I hope that's useful insight, I'm going to try and keep working on getting some IR out of one of the broken tests.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146629/new/

https://reviews.llvm.org/D146629



More information about the llvm-commits mailing list