teak-llvm/llvm/lib/Transforms/Utils
Taewook Oh 923c216da5 [ICP] Do not attempt type matching for variable length arguments.
Summary:
When performing indirect call promotion, current implementation inspects "all" parameters of the callsite and attemps to match with the formal argument type of the callee function. However, it is not possible to find the type for variable length arguments, and the compiler crashes when it attemps to match the type for variable lenght argument.

It seems that the bug is introduced with D40658. Prior to that, the type matching is performed only for the parameters whose ID is less than callee->getFunctionNumParams(). The attached test case will crash without the patch.

Reviewers: mssimpso, davidxl, davide

Reviewed By: mssimpso

Subscribers: llvm-commits

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

llvm-svn: 330844
2018-04-25 17:19:21 +00:00
..
AddDiscriminators.cpp Transforms: Introduce Transforms/Utils.h rather than spreading the declarations amongst Scalar.h and IPO.h 2018-03-28 17:44:36 +00:00
ASanStackFrameLayout.cpp [asan] Add a full redzone after every stack variable 2017-11-18 01:13:18 +00:00
BasicBlockUtils.cpp Fix a couple of layering violations in Transforms 2018-03-21 22:34:23 +00:00
BreakCriticalEdges.cpp Transforms: Introduce Transforms/Utils.h rather than spreading the declarations amongst Scalar.h and IPO.h 2018-03-28 17:44:36 +00:00
BuildLibCalls.cpp Merging r46043: 2018-04-25 04:33:36 +00:00
BypassSlowDivision.cpp Fix a couple of layering violations in Transforms 2018-03-21 22:34:23 +00:00
CallPromotionUtils.cpp [ICP] Do not attempt type matching for variable length arguments. 2018-04-25 17:19:21 +00:00
CloneFunction.cpp [DebugInfo][OPT] NFC follow-up on "Fixing a couple of DI duplication bugs of CloneModule" 2018-04-13 21:23:11 +00:00
CloneModule.cpp [DebugInfo][OPT] Fixing a couple of DI duplication bugs of CloneModule 2018-04-13 21:22:24 +00:00
CMakeLists.txt [PR16756] Add SSAUpdaterBulk. 2018-04-09 23:37:20 +00:00
CodeExtractor.cpp Add the ShadowCallStack attribute 2018-04-03 20:10:40 +00:00
CtorUtils.cpp Remove redundant includes from lib/Transforms. 2017-12-13 21:31:01 +00:00
DemoteRegToStack.cpp Fix a couple of layering violations in Transforms 2018-03-21 22:34:23 +00:00
EntryExitInstrumenter.cpp EntryExitInstrumenter: Handle musttail calls 2018-04-06 10:14:09 +00:00
EscapeEnumerator.cpp Fix a couple of layering violations in Transforms 2018-03-21 22:34:23 +00:00
Evaluator.cpp [GlobalOpt] Fix support for casts in ctors. 2018-04-06 15:54:47 +00:00
FlattenCFG.cpp Fix a couple of layering violations in Transforms 2018-03-21 22:34:23 +00:00
FunctionComparator.cpp [Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-10-11 21:41:43 +00:00
FunctionImportUtils.cpp [ThinLTO] Clear dllimport when setting dso_local. 2018-03-13 15:24:51 +00:00
GlobalStatus.cpp [GlobalOpt] Fix exponential compile-time with selects. 2018-01-31 20:42:25 +00:00
ImportedFunctionsInliningStatistics.cpp [Transforms] Change std::sort to llvm::sort in response to r327219 2018-04-13 19:47:57 +00:00
InlineFunction.cpp Treat inlining a notail call as a regular, non-tail call 2018-04-02 21:23:16 +00:00
InstructionNamer.cpp Transforms: Introduce Transforms/Utils.h rather than spreading the declarations amongst Scalar.h and IPO.h 2018-03-28 17:44:36 +00:00
IntegerDivision.cpp
LCSSA.cpp Transforms: Introduce Transforms/Utils.h rather than spreading the declarations amongst Scalar.h and IPO.h 2018-03-28 17:44:36 +00:00
LibCallsShrinkWrap.cpp [Dominators] Remove verifyDomTree and add some verifying for Post Dom Trees 2018-02-28 11:00:08 +00:00
LLVMBuild.txt
Local.cpp Fix a couple of layering violations in Transforms 2018-03-21 22:34:23 +00:00
LoopRotationUtils.cpp [NFC] Remove recently added SE verification because it may be false-positive 2018-04-24 09:11:01 +00:00
LoopSimplify.cpp [NFC] Remove recently added SE verification because it may be false-positive 2018-04-24 09:11:01 +00:00
LoopUnroll.cpp [NFC] Use forgetTopmostLoop instead of logic duplication 2018-04-24 04:33:04 +00:00
LoopUnrollPeel.cpp [LoopUnroll] Only peel if a predicate becomes known in the loop body. 2018-04-18 12:29:24 +00:00
LoopUnrollRuntime.cpp [LoopUnroll] Fix potentially incorrect SCEV invalidation in UnrollRuntime 2018-04-23 10:39:38 +00:00
LoopUtils.cpp Support generic expansion of ordered vector reduction (PR36732) 2018-04-09 15:44:20 +00:00
LoopVersioning.cpp
LowerInvoke.cpp Transforms: Introduce Transforms/Utils.h rather than spreading the declarations amongst Scalar.h and IPO.h 2018-03-28 17:44:36 +00:00
LowerMemIntrinsics.cpp [LowerMemIntrinsics] Update uses of deprecated MemIntrinsic::getAlignment API (NFC) 2018-02-05 22:23:58 +00:00
LowerSwitch.cpp [Transforms] Change std::sort to llvm::sort in response to r327219 2018-04-13 19:47:57 +00:00
Mem2Reg.cpp Transforms: Introduce Transforms/Utils.h rather than spreading the declarations amongst Scalar.h and IPO.h 2018-03-28 17:44:36 +00:00
MetaRenamer.cpp Transforms: Introduce Transforms/Utils.h rather than spreading the declarations amongst Scalar.h and IPO.h 2018-03-28 17:44:36 +00:00
ModuleUtils.cpp ModuleUtils: Stop using comdat members to generate unique module ids. 2017-10-05 21:54:53 +00:00
NameAnonGlobals.cpp
OrderedInstructions.cpp
PredicateInfo.cpp [Transforms] Change std::sort to llvm::sort in response to r327219 2018-04-13 19:47:57 +00:00
PromoteMemoryToRegister.cpp [Mem2Reg] Create merged debug locations for inserted phis 2018-04-17 22:03:08 +00:00
SanitizerStats.cpp
SimplifyCFG.cpp [Transforms] Change std::sort to llvm::sort in response to r327219 2018-04-13 19:47:57 +00:00
SimplifyIndVar.cpp Remove redundant includes from lib/Transforms. 2017-12-13 21:31:01 +00:00
SimplifyInstructions.cpp Transforms: Introduce Transforms/Utils.h rather than spreading the declarations amongst Scalar.h and IPO.h 2018-03-28 17:44:36 +00:00
SimplifyLibCalls.cpp [SimplifyLibcalls] Realloc(null, N) -> Malloc(N) 2018-04-18 14:21:31 +00:00
SplitModule.cpp [Transforms] Change std::sort to llvm::sort in response to r327219 2018-04-13 19:47:57 +00:00
SSAUpdater.cpp Use phi ranges to simplify code. No functionality change intended. 2017-12-30 15:27:33 +00:00
SSAUpdaterBulk.cpp Revert "Revert r330403 and r330413." 2018-04-20 13:34:32 +00:00
StripGCRelocates.cpp Fix a couple of layering violations in Transforms 2018-03-21 22:34:23 +00:00
StripNonLineTableDebugInfo.cpp Fix some layering in StripNonLineTableDebugInfo, moving its declaration from IPO.h to Utils.h to match its implementation 2018-03-29 22:42:08 +00:00
SymbolRewriter.cpp Mark all library options as hidden. 2017-12-01 00:53:10 +00:00
UnifyFunctionExitNodes.cpp Transforms: Introduce Transforms/Utils.h rather than spreading the declarations amongst Scalar.h and IPO.h 2018-03-28 17:44:36 +00:00
Utils.cpp llvm-c: Split Utils out of Scalar.h 2018-03-29 22:31:38 +00:00
ValueMapper.cpp Teach ValueMapper to use ODR uniqued types when available 2018-01-30 20:16:32 +00:00
VNCoercion.cpp