[llvm] r284989 - Check the number of Args in LibCallsShrinkWrap.
Rong Xu via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 24 09:50:12 PDT 2016
Author: xur
Date: Mon Oct 24 11:50:12 2016
New Revision: 284989
URL: http://llvm.org/viewvc/llvm-project?rev=284989&view=rev
Log:
Check the number of Args in LibCallsShrinkWrap.
Some library fucntions can have no argument.
Modified:
llvm/trunk/lib/Transforms/Utils/LibCallsShrinkWrap.cpp
Modified: llvm/trunk/lib/Transforms/Utils/LibCallsShrinkWrap.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LibCallsShrinkWrap.cpp?rev=284989&r1=284988&r2=284989&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/LibCallsShrinkWrap.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/LibCallsShrinkWrap.cpp Mon Oct 24 11:50:12 2016
@@ -317,6 +317,8 @@ void LibCallsShrinkWrap::checkCandidate(
if (!TLI.getLibFunc(*Callee, Func) || !TLI.has(Func))
return;
+ if (CI.getNumArgOperands() == 0)
+ return;
// TODO: Handle long double in other formats.
Type *ArgType = CI.getArgOperand(0)->getType();
if (!(ArgType->isFloatTy() || ArgType->isDoubleTy() ||
More information about the llvm-commits
mailing list