[PATCH] D68490: [PATCH 07/38] [noalias] D9378: Add IRBuilder support
Roman Lebedev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 6 03:08:00 PDT 2019
lebedev.ri added inline comments.
================
Comment at: llvm/lib/IR/IRBuilder.cpp:475-484
+ Instruction *Ret = createCallHelper(FnNoAlias, Ops, this);
+
+ if (Ret->getType() != Ptr->getType()) {
+ BitCastInst *BCI = new BitCastInst(Ret, Ptr->getType(), "");
+ BB->getInstList().insert(InsertPt, BCI);
+ SetInstDebugLocation(BCI);
+ Ret = BCI;
----------------
I'd suggest to return `Value*` from `CreateNoAliasPointer()` and to cleanup this to
```
if (Ret->getType() == Ptr->getType())
return Ret;
return CreateBitCast(Ret, Ptr->getType());
```
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D68490/new/
https://reviews.llvm.org/D68490
More information about the llvm-commits
mailing list