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

Rong Xu via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 21 14:30:09 PDT 2016


xur marked 8 inline comments as done.
xur added a comment.

Will branch-weight to 1/2000.


================
Comment at: lib/Transforms/Utils/CondDeadCallElimination.cpp:110
@@ +109,3 @@
+
+  Value *CreateCond(CallInst &CI, CmpInst::Predicate Cmp, float Val,
+                    CmpInst::Predicate Cmp2, float Val2) {
----------------
davidxl wrote:
> Missing documentation for the method. Also name it "CreateOrCond".
> 
> I also  think it is better to pass the Arg directly instead of the CallInst&
I will change the name. 
I'm not sure if it's better to pass Arg directly. I also need the instruction for the IRBuilder (either IRBuilder or CallInst).

================
Comment at: lib/Transforms/Utils/CondDeadCallElimination.cpp:202
@@ +201,3 @@
+  case LibFunc::truncl: {
+    if (!CondCallDCEDoNoError)
+      return;
----------------
davidxl wrote:
> Perhaps break the giant switch into smaller helper functions. For instance define a helper function called: 
> 
> bool doesFuncSetErrNo(...) { ..
>    }
> 
Will do.


https://reviews.llvm.org/D24414





More information about the llvm-commits mailing list