Lowering a non-branch instruction with a label

Hi All,

I want to lower a hypothetical instruction with an opcode and a label.

ZZZ labelname

The instruction is not a branch/terminator, but a normal instruction taking a label as the only operand.
I managed to represent it in the SelectionDAG with TargetBlockAddress node type, but I am having trouble in lowering it. After Lowering, the assembly ends up with a new label and an empty block instead of the actual label that I want.

Could you please suggest what would be the best way to represent such a hypothetical instruction in the Selection DAG and how to lower it preserving the label?

Thank you.

Is the block marked as having its address taken?

Hello Matt,

Thank you for your response.

I was not setting it before. Even if I set it, still the new empty blocks are generated, but now they are generated at the correct position.

ZZZ     .Ltmp1
.Ltmp1:                                 // Block address taken

Here .Ltmp1 block is created redundantly when I just need the label .LBB0_5.
Any suggestion on how to remove/not generate the temp label?