[PATCH] D24414: Conditionally eliminate library calls where the result value is not used

Rong Xu via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 7 16:07:42 PDT 2016


xur added inline comments.


================
Comment at: lib/Transforms/Utils/CondDeadCallElimination.cpp:52
+    "cond-call-dce-disable", cl::init(false), cl::Hidden,
+    cl::desc("Disable conditional call Dead Code Elimination"));
+static cl::opt<bool> CondCallDCEDoDomainError(
----------------
mehdi_amini wrote:
> xur wrote:
> > mehdi_amini wrote:
> > > I don't believe it is common to have such flags in pass implementations?
> > You mean in PassManagerBuilder?
> We have such flags in the pass manager builder, yes. But not here in within the pass itself I think.
OK. I'll move this "disable" option to pass manager build.  I'll rename it to "disable-libcalls-shrinkwrap"


================
Comment at: lib/Transforms/Utils/CondDeadCallElimination.cpp:129
+    if (!Arg->getType()->isFloatTy())
+      V = ConstantExpr::getFPExtend(V, Arg->getType());
+    return BBBuilder.CreateFCmp(Cmp, Arg, V);
----------------
mehdi_amini wrote:
> xur wrote:
> > mehdi_amini wrote:
> > > What about FP16 here?
> > Are there math lib calls using FP16 type?
> > I only know the following types for the math lib calls: double, float and long double.
> I don't know about what can we stuck into TLI? What would the Cuda target do for instance?
the library calls I handled in this pass are white-listed. They should take either "float", "double", or "long double" as the argument. I don't think we will ever see a FP16 type here.  



https://reviews.llvm.org/D24414





More information about the llvm-commits mailing list