[llvm] [InstCombine] Set !prof metadata on Selects identified by add.ll test (PR #158743)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 27 13:35:09 PDT 2025


================
@@ -469,6 +470,18 @@ class LLVM_LIBRARY_VISIBILITY InstCombinerImpl final
   Value *simplifyNonNullOperand(Value *V, bool HasDereferenceable,
                                 unsigned Depth = 0);
 
+  SelectInst *createSelectInst(Value *C, Value *S1, Value *S2,
+                               const Twine &NameStr = "",
+                               InsertPosition InsertBefore = nullptr,
+                               Instruction *MDFrom = nullptr) {
+    SelectInst *SI =
+        SelectInst::Create(C, S1, S2, NameStr, InsertBefore, MDFrom);
+    if (SI && !MDFrom) {
----------------
nikic wrote:

SI can't be null here.

https://github.com/llvm/llvm-project/pull/158743


More information about the llvm-commits mailing list