[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
Mon Sep 29 11:53:43 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 (!MDFrom) {
----------------
nikic wrote:

braces

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


More information about the llvm-commits mailing list