[PATCH] D140166: [IR] return nullptr in Instruction::getInsertionPointAfterDef for CallBrInst

Chuanqi Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 29 18:42:42 PST 2022


ChuanqiXu added a comment.

In D140166#4019420 <https://reviews.llvm.org/D140166#4019420>, @dblaikie wrote:

> In D140166#4019070 <https://reviews.llvm.org/D140166#4019070>, @ChuanqiXu wrote:
>
>> In D140166#4018476 <https://reviews.llvm.org/D140166#4018476>, @dblaikie wrote:
>>
>>>> Note that there is only a coroutine `a()` in the above example. The frontend generated code (with -g) will consist of 1144 lines of IR codes. I get it by:
>>>>
>>>>   clang++ -std=c++20 src.cpp -O3 -S -emit-llvm -g -Xclang -disable-llvm-passes -o frontend-generated.ll
>>>>
>>>> And for the optimized (but before coroutine splitting) IR, it'll still consist of 645 lines of IR code. (I get it by inserting codes in CoroSplit.cpp). So I feel it is too lengthy for a lit test.
>>>
>>> That's with all LLVM passes disabled - it might be interesting if there's something more manageable with some optimization passes applied? (I guess if you don't disable them from clang, -O3 ends up lowering the IR beyond the coroutine abstracitons - so you'd have to do this manually with opt or something to only apply some optimizations and stop before the coroutines were lowered too far/beyond what's needed for this test)
>>
>> As far as I know, I don't the method to generate the IR before Coro-splitting automatically. In the past I always tried to insert codes in CoroSplit pass manually. I didn't feel tired for it.
>
> Sorry, I didn't follow this - could you rephrase?

Sorry. I thought you were asking: "if there is an automatic/manageable way we can get the IR applied with some optimizations but before coro-spliting?". Then my reply is "No, I don't know such methods. I always create it by editing the codes."


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140166/new/

https://reviews.llvm.org/D140166



More information about the llvm-commits mailing list