[PATCH] D46584: [Evaluator] Improve evaluation of call instruction
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 10 07:21:55 PDT 2018
grimar added inline comments.
================
Comment at: lib/Transforms/Utils/Evaluator.cpp:243
+ return NewRV ? NewRV : RV;
+}
/// Evaluate all instructions in block BB, returning true if successful, false
----------------
Seems it better looks like:
```
Constant *Evaluator::substCallExprArgument(Value *CallExpr, Constant *RV) {
ConstantExpr *CE = dyn_cast<ConstantExpr>(CallExpr);
if (!CE || CE->getOpcode() != Instruction::BitCast)
return RV;
if (auto *FT = dyn_cast<FunctionType>(CE->getType()->getPointerElementType()))
return ConstantFoldLoadThroughBitcast(RV, FT->getReturnType(), DL);
return RV;
}
```
https://reviews.llvm.org/D46584
More information about the llvm-commits
mailing list