[PATCH] D127729: [Bitcode] Support expanding constant expressions into instructions
Benjamin Kramer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 29 04:51:49 PDT 2022
bkramer 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);
----------------
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.
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