[PATCH] D46584: [Evaluator] Improve evaluation of call instruction

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 21 08:47:26 PDT 2018


tejohnson accepted this revision.
tejohnson added a comment.
This revision is now accepted and ready to land.

LGTM with a couple of nits.



================
Comment at: include/llvm/Transforms/Utils/Evaluator.h:78
+
+  Constant *castCallResultIfNeeded(Value *CallExpr, Constant *RV);
+
----------------
Document your new functions.


================
Comment at: test/Transforms/GlobalOpt/evaluate-constfold-call.ll:2
+; Check if we can evaluate a bitcasted call to a function which is constant folded.
+; Evaluator folds call to ftof, replacing it with constant value in case both operands
+; are known at compile time.
----------------
s/ftof/fmodf/?


================
Comment at: test/Transforms/GlobalOpt/evaluate-constfold-call.ll:6
+
+; CHECK: @_q = dso_local local_unnamed_addr global %struct.Q { i32 1066527622 }
+
----------------
Should the resulting code in main() also be checked? 


https://reviews.llvm.org/D46584





More information about the llvm-commits mailing list