================ @@ -1210,12 +1211,16 @@ CallInst *CodeExtractor::emitCallAndSwitchStatement(Function *newFunction, if (ArgsInZeroAddressSpace && DL.getAllocaAddrSpace() != 0) { auto *StructSpaceCast = new AddrSpaceCastInst( - Struct, PointerType ::get(Context, 0), "structArg.ascast"); + Struct, PointerType ::get(Context, 0), "structArg.ascast"); StructSpaceCast->insertAfter(Struct); - params.push_back(StructSpaceCast); + // There isn't really a point in generating this cast if you + // just aren't going to use it... + Struct = StructSpaceCast; + //params.push_back(StructSpaceCast); } else { - params.push_back(Struct); + //params.push_back(Struct); } + params.push_back(Struct); ---------------- jdoerfert wrote:
Most of these changes are unrelated. The question is if we need Struct to be the AS cast or if the AS cast should be in the params. It's hard to see the need if this worked for others before. https://github.com/llvm/llvm-project/pull/91261 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits