[PATCH] D102764: [IR] Prefer not to delete blocks that have their address taken
Roman Lebedev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 19 11:41:36 PDT 2021
lebedev.ri added a comment.
In D102764#2769261 <https://reviews.llvm.org/D102764#2769261>, @efriedma wrote:
>> Which is obviously no longer an address of a block, and iff the use semantically required it to actually be an address of a block, e.g. AArch64's S constaint in llvm/test/CodeGen/AArch64/inlineasm-S-constraint.ll, then the IR suddenly becomes invalid.
>
> Not completely sure what you mean by "semantically required"; you mean it has to point somewhere in the same section?
For example, if we, for some reason, decide to delete block `%loc` in `@test_inline_constraint_S_label()`,
`(i8* blockaddress(@test_inline_constraint_S_label, %loc))` will be replaced with e.g. (i8* inttoptr(i32 1 to i8*)),
and whoops: https://godbolt.org/z/Ee1Y6sbEf
> We could add support for `blockaddress(@lower_blockaddress, null)` or something like that, I guess.
>
> I don't think it makes sense to block the elimination of unreachable blocks; that's likely to cause other issues.
Yeah, i'm still unsure how we are supposed to deal with `blockaddress` thing :/
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D102764/new/
https://reviews.llvm.org/D102764
More information about the llvm-commits
mailing list