[PATCH] D147968: [RFC] BPF: Undo specific transform-preventing passes and add opt flags

Yonghong Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 10 13:18:31 PDT 2023


yonghong-song created this revision.
yonghong-song added a reviewer: ast.
Herald added a subscriber: hiraditya.
Herald added a project: All.
yonghong-song requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

LLVM optimization may generate certain codes which cannot be
handled by kernel verifier, e.g., some optimizations in
in InstCombine, SimplifyCFG and LICM (https://reviews.llvm.org/D147078).
To avoid this issue, BPF backend has implemented some
passes, esp. through 'barrier' builtin function to prevent
certain InstCombine and SimplifyCFG transformations.
In these BPF backend passes pattern matching are used
to capture some specific patterns to prevent some
llvm transformations. But such pattern matching may not be precise
and may prevent some useful transformations. It would be great
if we can directly disable llvm transformations and this will
also avoid bpf specific transformation-preventing passes.

This patch undo previous InstCombine/SimplifyCFG
transformation-preventing passes and added necessary flags
in these transformations permitting BPF backend to disable them.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D147968

Files:
  llvm/include/llvm/IR/IntrinsicsBPF.td
  llvm/include/llvm/Transforms/InstCombine/InstCombiner.h
  llvm/include/llvm/Transforms/Utils/Local.h
  llvm/lib/Target/BPF/BPF.h
  llvm/lib/Target/BPF/BPFAdjustOpt.cpp
  llvm/lib/Target/BPF/BPFCheckAndAdjustIR.cpp
  llvm/lib/Target/BPF/BPFTargetMachine.cpp
  llvm/lib/Target/BPF/BPFTargetTransformInfo.h
  llvm/lib/Target/BPF/CMakeLists.txt
  llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
  llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
  llvm/lib/Transforms/Utils/SimplifyCFG.cpp
  llvm/test/CodeGen/BPF/adjust-opt-icmp1.ll
  llvm/test/CodeGen/BPF/adjust-opt-icmp2.ll
  llvm/test/CodeGen/BPF/adjust-opt-icmp3.ll
  llvm/test/CodeGen/BPF/adjust-opt-speculative1.ll
  llvm/test/CodeGen/BPF/adjust-opt-speculative2.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147968.512236.patch
Type: text/x-patch
Size: 26972 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230410/4d2e64e8/attachment-0001.bin>


More information about the llvm-commits mailing list