llvm-project/llvm/test/Transforms/IPConstantProp
Bjorn Pettersson d014d576a9 [IPCP] Don't crash due to arg count/type mismatch between caller/callee
Summary:
This patch avoids an assert in IPConstantPropagation when
there is a argument count/type mismatch between the caller and
the callee.

While this is actually UB on C-level (clang emits a warning),
the IR verifier seems to accept it. I'm not sure what other
frontends/languages might think about this, so simply bailing out
to avoid hitting an assert (in CallSiteBase<>::getArgOperand or
Value::doRAUW) seems like a simple solution.

The problem is exposed by the fact that AbstractCallSites will look
through a bitcast at the callee position of a call/invoke.

Reviewers: jdoerfert, reames, efriedma

Reviewed By: jdoerfert, efriedma

Subscribers: eli.friedman, efriedma, llvm-commits

Differential Revision: https://reviews.llvm.org/D57052

llvm-svn: 352469
2019-01-29 10:19:44 +00:00
..
2008-06-09-WeakProp.ll
2009-09-24-byval-ptr.ll
PR16052.ll
PR26044.ll
arg-count-mismatch.ll [IPCP] Don't crash due to arg count/type mismatch between caller/callee 2019-01-29 10:19:44 +00:00
arg-type-mismatch.ll [IPCP] Don't crash due to arg count/type mismatch between caller/callee 2019-01-29 10:19:44 +00:00
comdat-ipo.ll
dangling-block-address.ll
deadarg.ll
fp-bc-icmp-const-fold.ll
global.ll
multiple_callbacks.ll Enable IPConstantPropagation to work with abstract call sites 2019-01-19 05:19:12 +00:00
musttail-call.ll Recommit r333268: [IPSCCP] Use PredicateInfo to propagate facts from cmp instructions. 2018-08-23 11:04:00 +00:00
naked-return.ll
openmp_parallel_for.ll Enable IPConstantPropagation to work with abstract call sites 2019-01-19 05:19:12 +00:00
pthreads.ll Enable IPConstantPropagation to work with abstract call sites 2019-01-19 05:19:12 +00:00
recursion.ll
remove-call-inst.ll
return-argument.ll
return-constant.ll
return-constants.ll
solve-after-each-resolving-undefs-for-function.ll
thread_local_acs.ll Enable IPConstantPropagation to work with abstract call sites 2019-01-19 05:19:12 +00:00
user-with-multiple-uses.ll