[PATCH] D146702: [MergeICmps] Attach metadata to new created loads

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 23 04:57:41 PDT 2023


nikic added a comment.

I think this is right, but I'm not very confident about it. The problem is that mergeicmps can reorder loads, but I think these isolated comparisons will not get reordered before other ones (only possibly after), so I think it's fine. But maybe I just didn't manage to construct the right test case.



================
Comment at: llvm/lib/Transforms/Scalar/MergeICmps.cpp:646
+    LoadInst *const RhsLoad =
         Builder.CreateLoad(FirstCmp.Rhs().LoadI->getType(), Rhs);
+    // Copy metadata
----------------
Maybe it would be better to clone the instructions, similar to the GEPs above?


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

https://reviews.llvm.org/D146702



More information about the llvm-commits mailing list