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

David Li via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 26 17:27:07 PDT 2016


davidxl added inline comments.

================
Comment at: lib/Transforms/Utils/CondDeadCallElimination.cpp:107
@@ +106,3 @@
+  void shrinkWrapCI(CallInst *CI, Value *Cond);
+  bool performCallNoErrNo(CallInst *CI, const LibFunc::Func &Func);
+  bool performCallDomainErrorOnly(CallInst *CI, const LibFunc::Func &Func);
----------------
Remove this line.

================
Comment at: lib/Transforms/Utils/CondDeadCallElimination.cpp:304
@@ +303,3 @@
+  }
+  assert(Cond != nullptr);
+  shrinkWrapCI(CI, Cond);
----------------
Move this check into ShrinkWrapCI

================
Comment at: test/Transforms/Util/cond-call-dce-double.ll:24
@@ +23,3 @@
+; CHECK: [[COND:%[0-9]+]] = or i1 [[COND2]], [[COND1]]
+; CHECK: br i1 [[COND]], label %[[CALL_LABEL:cdce.call[0-9]*]], label %[[END_LABEL:cdce.end[0-9]*]], !prof ![[BRANCH_WEIGHT:[0-9]+]]
+; CHECK: [[CALL_LABEL]]:
----------------
no need to redefine BRANCH_WEIGHT

================
Comment at: test/Transforms/Util/cond-call-dce-double.ll:34
@@ +33,3 @@
+; CHECK: [[COND:%[0-9]+]] = or i1 [[COND2]], [[COND1]]
+; CHECK: br i1 [[COND]], label %[[CALL_LABEL:cdce.call[0-9]*]], label %[[END_LABEL:cdce.end[0-9]*]], !prof ![[BRANCH_WEIGHT:[0-9]+]]
+; CHECK: [[CALL_LABEL]]:
----------------
same here and other places.


https://reviews.llvm.org/D24414





More information about the llvm-commits mailing list