[PATCH] D122259: [SelectOpti][2/5] Select-to-branch base transformation
Sotiris Apostolakis via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 23 08:48:05 PDT 2022
apostolakis added inline comments.
================
Comment at: llvm/lib/CodeGen/SelectOptimize.cpp:178
+ auto *FalseBranch = BranchInst::Create(EndBlock, FalseBlock);
+ FalseBranch->setDebugLoc(SI->getDebugLoc());
+
----------------
davidxl wrote:
> The MD_prof data needs to be passed from select to the branch.
Actually this is already done. IB.CreateCondBr (line 191) will copy the metadata (i.e., the branch weights) from the select instruction to the branch instruction.
================
Comment at: llvm/test/CodeGen/X86/select-optimize.ll:1
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc -mtriple=x86_64-unknown-unknown -disable-select-optimize=false -x86-cmov-converter=false -disable-cgp-select2branch=true < %s | FileCheck %s
----------------
davidxl wrote:
> Add more test cases with prof meta data on select?
Added some IR-to-IR tests that check that profile metadata are preserved. More tests with profile metadata are added in the subsequent patches.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D122259/new/
https://reviews.llvm.org/D122259
More information about the llvm-commits
mailing list