diff options
| author | Snehasish Kumar <snehasishk@google.com> | 2026-02-03 04:21:49 +0000 |
|---|---|---|
| committer | Snehasish Kumar <snehasishk@google.com> | 2026-02-10 22:50:08 +0000 |
| commit | 805f51c73fd6d79bf01aece72d52abad866b2525 (patch) | |
| tree | 3879d1ed10edaf1d36bc310ff1a7ca8b469204fe | |
| parent | 0d332505e1298b463ef190139ab9b71771db4d2f (diff) | |
| download | llvm-users/snehasish/fix-logic-select-prof.tar.gz llvm-users/snehasish/fix-logic-select-prof.tar.bz2 llvm-users/snehasish/fix-logic-select-prof.zip | |
InstCombine: Set unknown profile metadata in logic-to-select foldingusers/snehasish/fix-logic-select-prof
| -rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp | 3 | ||||
| -rw-r--r-- | llvm/utils/profcheck-xfail.txt | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp index bf2bc0170810..1377bd6190b3 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp @@ -3348,6 +3348,9 @@ Value *InstCombinerImpl::matchSelectFromAndOr(Value *A, Value *B, Value *C, D = Builder.CreateNot(D); Value *BitcastD = Builder.CreateBitCast(D, SelTy); Value *Select = Builder.CreateSelect(Cond, BitcastB, BitcastD); + if (!ProfcheckDisableMetadataFixes) + if (auto *I = dyn_cast<Instruction>(Select)) + setExplicitlyUnknownBranchWeightsIfProfiled(*I, DEBUG_TYPE, &F); return Builder.CreateBitCast(Select, OrigType); } diff --git a/llvm/utils/profcheck-xfail.txt b/llvm/utils/profcheck-xfail.txt index 9271f4f89af8..7f091efe0c10 100644 --- a/llvm/utils/profcheck-xfail.txt +++ b/llvm/utils/profcheck-xfail.txt @@ -225,7 +225,6 @@ Transforms/InstCombine/load-bitcast-select.ll Transforms/InstCombine/load.ll Transforms/InstCombine/load-select.ll Transforms/InstCombine/loadstore-metadata.ll -Transforms/InstCombine/logical-select-inseltpoison.ll Transforms/InstCombine/logical-select.ll Transforms/InstCombine/lshr.ll Transforms/InstCombine/memchr-11.ll |
