[PATCH] D38474: Add support for multiple prof metadata on instructions.

Hiroshi Yamauchi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 2 11:49:42 PDT 2017


yamauchi created this revision.

An instruction can currently have up to one prof metadata type associated with
it. It's useful to be able to have more than one prof metadata associated with
an instruction, going forward.

This patch introduces an optional two-level structure in addition to the current
single-level one. For example,

br i1 %cond, label %then, label %else, !prof !0

!0 = !{!"branch_weights", i32 64, i32 4}  ; Single-level

br i1 %cond, label %then, label %else, !prof !1

!1 = !{!1, !2, !3, !4}                    ; Two-level
!2 = !{!"branch_weights", i32 64, i32 4}
!3 = !{!"foo"}
!4 = !{!"bar"}


https://reviews.llvm.org/D38474

Files:
  include/llvm/Analysis/CFGPrinter.h
  include/llvm/IR/IRBuilder.h
  include/llvm/IR/Instruction.h
  include/llvm/IR/LLVMContext.h
  include/llvm/IR/MDBuilder.h
  include/llvm/Transforms/PGOInstrumentation.h
  lib/Analysis/BranchProbabilityInfo.cpp
  lib/CodeGen/CodeGenPrepare.cpp
  lib/IR/Instruction.cpp
  lib/IR/LLVMContext.cpp
  lib/IR/MDBuilder.cpp
  lib/IR/Metadata.cpp
  lib/ProfileData/InstrProf.cpp
  lib/Transforms/IPO/CrossDSOCFI.cpp
  lib/Transforms/IPO/LowerTypeTests.cpp
  lib/Transforms/IPO/SampleProfile.cpp
  lib/Transforms/Instrumentation/IndirectCallPromotion.cpp
  lib/Transforms/Instrumentation/PGOInstrumentation.cpp
  lib/Transforms/Instrumentation/PGOMemOPSizeOpt.cpp
  lib/Transforms/Scalar/JumpThreading.cpp
  lib/Transforms/Scalar/LowerExpectIntrinsic.cpp
  lib/Transforms/Scalar/LowerGuardIntrinsic.cpp
  lib/Transforms/Utils/BasicBlockUtils.cpp
  lib/Transforms/Utils/CodeExtractor.cpp
  lib/Transforms/Utils/Local.cpp
  lib/Transforms/Utils/LoopUnrollPeel.cpp
  lib/Transforms/Utils/SimplifyCFG.cpp
  test/Analysis/BlockFrequencyInfo/two_level_prof.ll
  test/Transforms/SimplifyCFG/preserve-branchweights.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38474.117404.patch
Type: text/x-patch
Size: 55246 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171002/5460e8c2/attachment.bin>


More information about the llvm-commits mailing list