[PATCH] D33737: [InstSimplify] Don't constant fold or DCE calls that are marked nobuiltin
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 31 15:29:43 PDT 2017
efriedma added a comment.
The other alternative is that you could pass in an AttributeList (the result of getAttributes()) to the functions... that makes it more clear what exactly is getting used, but it's more complicated (and probably involves a bunch of refactoring to expose a function to check isNoBuiltin given a Function/AttributeList pair).
But either way, I would prefer a solution that involves checking for isNoBuiltin() in as few places as possible.
================
Comment at: lib/Transforms/Utils/Evaluator.cpp:363
+ // Cannot evaluate nobuiltin functions.
+ if (CS.isNoBuiltin()) {
+ DEBUG(dbgs() << "Can not evaluate nobuiltin call\n");
----------------
This isn't doing what you want: we don't call ConstantFoldCall on all paths.
Repository:
rL LLVM
https://reviews.llvm.org/D33737
More information about the llvm-commits
mailing list