================
@@ -2928,12 +2928,13 @@ static void emitUsed(CodeGenModule &CGM, StringRef Name,
for (unsigned i = 0, e = List.size(); i != e; ++i) {
UsedArray[i] =
llvm::ConstantExpr::getPointerBitCastOrAddrSpaceCast(
- cast<llvm::Constant>(&*List[i]), CGM.Int8PtrTy);
----------------
arsenm wrote:
> Ok, I'm still struggling to see why it is best create (possibly) broken IR
It's not broken. It just needs to provide a use, and whatever casts are there
do not matter. We can write whatever rules we want and have the verifier
enforce it. Currently we don't have any generic concept of "illegal
addrspacecasts" (relatedly we should probably stop throwing codegen errors on
the cases we don't handle, and just lower them to poison)
> Why not make it a special global that uses AS 42
Behavior of address spaces are target defined. We don't want to just grab
random numbers for generic purposes. We've gradually been migrating away from 0
being special in more contexts, but nothing has been done for used (and I don't
see a particularly compelling reason to do, used just needs to be a box that is
a use)
> IR-level compat between LLVM versions (yes it frequently works but it's not
> guaranteed to).
We do guarantee forward compatible bitcode
https://github.com/llvm/llvm-project/pull/93601
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits