[PATCH] D127729: [Bitcode] Support expanding constant expressions into instructions

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 29 05:17:45 PDT 2022


nikic added inline comments.


================
Comment at: llvm/lib/Bitcode/Reader/BitcodeReader.cpp:2822
-        Constant *Op = ValueList.getConstantFwdRef(Record[2], OpTy, OpTyID);
-        V = UpgradeBitCastExpr(Opc, Op, CurTy);
-        if (!V) V = ConstantExpr::getCast(Opc, Op, CurTy);
----------------
bkramer wrote:
> I found a 2013 vintage CUDA bitcode file that relies on this upgrader. It does
> ```
> @unrollpragma = private addrspace(1) constant [17 x i8] c"#pragma unroll 1\00"
> bitcast @unrollpragma to i8*
> ```
> 
> Bitcasting away addrspace has been disallowed since the advent of addrspacecast. Was this backwards compat dropped accidentally or is it time to drop this upgrader?
> 
> If we want the latter we can also remove it from AutoUpgrade.cpp.
This wasn't intentional. Can you please check whether https://gist.github.com/nikic/a4daeb24294f1f16ed45a531bcfaa146 works with your bitcode file?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127729



More information about the llvm-commits mailing list