[PATCH] D153966: [SimplifyCFG] Allow dropping block that only contains ephemeral values

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 28 05:59:44 PDT 2023


nikic created this revision.
nikic added reviewers: ChuanqiXu, jdoerfert, aeubanks, fhahn.
Herald added subscribers: khei4, StephenFan, hiraditya.
Herald added a project: All.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Perform the TryToSimplifyUncondBranchFromEmptyBlock() transform if the block is empty except for ephemeral values. The ephemeral values will be dropped in that case.

This makes sure that assumes don't block this transforms, as reported in https://discourse.llvm.org/t/llvm-assume-blocks-optimization/71609.


https://reviews.llvm.org/D153966

Files:
  llvm/include/llvm/Transforms/Utils/Local.h
  llvm/lib/Transforms/Utils/Local.cpp
  llvm/lib/Transforms/Utils/SimplifyCFG.cpp
  llvm/test/CodeGen/Thumb2/pr52817.ll
  llvm/test/Transforms/LoopVectorize/ARM/pointer_iv.ll
  llvm/test/Transforms/SimplifyCFG/X86/critedge-assume.ll
  llvm/test/Transforms/SimplifyCFG/assume.ll
  llvm/test/Transforms/SimplifyCFG/gepcost.ll
  llvm/test/Transforms/SimplifyCFG/hoist-common-skip.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153966.535351.patch
Type: text/x-patch
Size: 12799 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230628/21c2a5e8/attachment.bin>


More information about the llvm-commits mailing list