[llvm] [CodeGen] Perform early program return instead of using indirect branch (PR #102127)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 20 11:18:06 PDT 2024


arsenm wrote:

> TailDuplication in machineBlockPlacement occurs under very tight constraint (such as high branch probabilty & unconditional control flow to tailBB) . Also, it happens only if TailDuplicateThreshold (defined by TargetTransformInfo[TTI]) is satisfied (as inline duplication from taillBB to PredessorBB occurs). And above all, it does not account for range of branch instruction.

I assume you mean TargetInstrInfo, not TargetTransformInfo. This control seems pretty limited. For AMDGPU the default value seems too small, and we would need more context.

> So, is it good to assume that testCases should be made in accordance to above limitations to see the effective full pass pipeline effects, or all scenarios of early program return should be supposedly handled additionally?

We need to craft test cases to see if there's any issue that needs to be solved in the first place. I do think we under tail duplicate in general, but we need example functions to figure out what needs to be done 

https://github.com/llvm/llvm-project/pull/102127


More information about the llvm-commits mailing list