[PATCH] D18990: [InstCombine] Remove trivially empty va_start/va_end and va_copy/va_end ranges.

Renato Golin via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 12 04:18:44 PDT 2016


rengolin added a subscriber: rengolin.

================
Comment at: lib/Transforms/InstCombine/InstCombineCalls.cpp:911
@@ +910,3 @@
+  unsigned NumArgOperands = I.getNumArgOperands();
+  assert(E.getNumArgOperands() == NumArgOperands &&
+         "the intrinsics must have the same number of operands.");
----------------
this could be a return false short-cut, not necessarily an assert...

================
Comment at: lib/Transforms/InstCombine/InstCombineCalls.cpp:943
@@ +942,3 @@
+
+Instruction *InstCombiner::visitVAStartInst(VAStartInst &I) {
+  removeTriviallyEmptyRange(I, Intrinsic::vastart, Intrinsic::vaend, *this);
----------------
Where is this used and what's the point of always returning the null pointer?

================
Comment at: lib/Transforms/InstCombine/InstCombineCalls.cpp:950
@@ +949,3 @@
+  // We can not use the removeTriviallyEmptyRange helper function here
+  // because va_copy has an extra argument in its prototype.
+  BasicBlock::iterator BI(I), BE(I.getParent()->end());
----------------
This could be a boolean flag to check for argument equality.


http://reviews.llvm.org/D18990





More information about the llvm-commits mailing list