[PATCH] D46584: [Evaluator] Improve evaluation of call instruction
Teresa Johnson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 6 07:01:14 PDT 2018
tejohnson added a comment.
Sorry I missed this one.
================
Comment at: lib/Transforms/Utils/Evaluator.cpp:232
+
+/// Subsitute function call in bitcast expression to evaluated return value
+Constant *Evaluator::substCallExprArgument(Value *CallExpr, Constant *RV) {
----------------
The name/description seem a little confusing to me. IIUC there isn't any substitution into the function call expression being done here, it is essentially casting the evaluated return value to the call's bitcast type, right?
================
Comment at: lib/Transforms/Utils/Evaluator.cpp:506
if (Constant *C = ConstantFoldCall(CS, Callee, Formals, TLI)) {
- InstResult = C;
+ InstResult = substCallExprArgument(CS.getCalledValue(), C);
LLVM_DEBUG(dbgs() << "Constant folded function call. Result: "
----------------
Is this case being tested by the new test case?
================
Comment at: test/Transforms/GlobalOpt/evaluate-call.ll:1
+; RUN: opt -globalopt -instcombine %s -S -o - | FileCheck %s
+
----------------
Needs comment about what is being tested
https://reviews.llvm.org/D46584
More information about the llvm-commits
mailing list