llvm-project/llvm/lib/Transforms/Utils
Robert Lougher d469133f95 [Evaluator] Walk initial elements when handling load through bitcast
When evaluating a store through a bitcast, the evaluator tries to move the
bitcast from the pointer onto the stored value. If the cast is invalid, it
tries to "introspect" the type to get a valid cast by obtaining a pointer to
the initial element (if the type is nested, this may require walking several
initial elements).

In some situations it is possible to get a bitcast on a load (e.g. with
unions, where the bitcast may not be the same type as the store). However,
equivalent logic to the store to introspect the type is missing. This patch
add this logic.

Note, when developing the patch I was unhappy with adding similar logic
directly to the load case as it could get out of step. Instead, I have
abstracted the "introspection" into a helper function, with the specifics
being handled by a passed-in lambda function.

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

llvm-svn: 359205
2019-04-25 17:00:01 +00:00
..
ASanStackFrameLayout.cpp Use llvm::stable_sort 2019-04-23 14:51:27 +00:00
AddDiscriminators.cpp [llvm] Clarify responsiblity of some of DILocation discriminator APIs 2019-01-24 00:10:25 +00:00
BasicBlockUtils.cpp [Utils] Extract EliminateUnreachableBlocks (NFC) 2019-03-11 17:51:57 +00:00
BreakCriticalEdges.cpp [SanitizerCoverage] Avoid splitting critical edges when destination is a basic block containing unreachable 2019-03-12 18:20:25 +00:00
BuildLibCalls.cpp [SelectionDAG] Allow the user to specify a memeq function. 2019-03-08 09:07:45 +00:00
BypassSlowDivision.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CMakeLists.txt [PGO] Profile guided code size optimization. 2019-04-15 16:49:00 +00:00
CallPromotionUtils.cpp [opaque pointer types] Pass function type for CallBase::setCalledFunction. 2019-02-01 20:44:54 +00:00
CanonicalizeAliases.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CloneFunction.cpp Move DomTreeUpdater from IR to Analysis 2019-02-06 02:52:52 +00:00
CloneModule.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CodeExtractor.cpp [CodeExtractor] Add a few debug lines to understand why a region is not extracted 2019-04-16 02:12:05 +00:00
CtorUtils.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DemoteRegToStack.cpp [opaque pointer types] Pass value type to LoadInst creation. 2019-02-01 20:44:24 +00:00
EntryExitInstrumenter.cpp [opaque pointer types] Add a FunctionCallee wrapper type, and use it. 2019-02-01 02:28:03 +00:00
EscapeEnumerator.cpp [opaque pointer types] Add a FunctionCallee wrapper type, and use it. 2019-02-01 02:28:03 +00:00
Evaluator.cpp [Evaluator] Walk initial elements when handling load through bitcast 2019-04-25 17:00:01 +00:00
FlattenCFG.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
FunctionComparator.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
FunctionImportUtils.cpp Change some dyn_cast to more apropriate isa. NFC 2019-04-05 16:16:23 +00:00
GlobalStatus.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
GuardUtils.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ImportedFunctionsInliningStatistics.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
InlineFunction.cpp Add "const" in GetUnderlyingObjects. NFC 2019-04-24 06:55:50 +00:00
InstructionNamer.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
IntegerDivision.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LCSSA.cpp [MemorySSA] LCSSA preserves MemorySSA. 2019-04-23 20:59:44 +00:00
LLVMBuild.txt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LibCallsShrinkWrap.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Local.cpp [DEBUGINFO] Prevent Instcombine from dropping debuginfo when removing zexts 2019-04-15 17:36:29 +00:00
LoopRotationUtils.cpp [LoopRotate] fix crash encountered with callbr 2019-03-06 23:04:40 +00:00
LoopSimplify.cpp [LPM/BPI] Preserve BPI through trivial loop pass pipeline (e.g. LCSSA, LoopSimplify) 2019-04-22 17:13:43 +00:00
LoopUnroll.cpp [LoopUnroll] Move list of params into a struct [NFCI]. 2019-04-18 23:43:49 +00:00
LoopUnrollAndJam.cpp [SCEV] Add option to forget everything in SCEV. 2019-04-12 19:16:07 +00:00
LoopUnrollPeel.cpp [LoopUnrollPeel] Add case where we should forget the peeled loop from SCEV. 2019-02-14 13:59:39 +00:00
LoopUnrollRuntime.cpp [LoopUnroll] Move list of params into a struct [NFCI]. 2019-04-18 23:43:49 +00:00
LoopUtils.cpp Reland "Relax constraints for reduction vectorization" 2019-03-12 01:31:44 +00:00
LoopVersioning.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LowerInvoke.cpp [opaque pointer types] Pass function types to CallInst creation. 2019-02-01 20:43:25 +00:00
LowerMemIntrinsics.cpp [opaque pointer types] Pass value type to GetElementPtr creation. 2019-02-01 20:44:47 +00:00
LowerSwitch.cpp Use llvm::lower_bound. NFC 2019-04-12 02:02:06 +00:00
Mem2Reg.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
MetaRenamer.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ModuleUtils.cpp [opaque pointer types] Add a FunctionCallee wrapper type, and use it. 2019-02-01 02:28:03 +00:00
NameAnonGlobals.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PredicateInfo.cpp Use llvm::stable_sort 2019-04-23 14:51:27 +00:00
PromoteMemoryToRegister.cpp [Mem2Reg] Delete unused PointerAllocaValues 2019-04-14 07:28:29 +00:00
SSAUpdater.cpp [LICM/MSSA] Add promotion to scalars by building an AliasSetTracker with MemorySSA. 2019-02-06 20:25:17 +00:00
SSAUpdaterBulk.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SanitizerStats.cpp [opaque pointer types] Add a FunctionCallee wrapper type, and use it. 2019-02-01 02:28:03 +00:00
SimplifyCFG.cpp Re-commit r357452: SimplifyCFG SinkCommonCodeFromPredecessors: Also sink function calls without used results (PR41259) 2019-04-16 12:13:25 +00:00
SimplifyIndVar.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SimplifyLibCalls.cpp [PGO] Profile guided code size optimization. 2019-04-15 16:49:00 +00:00
SizeOpts.cpp [PGO] Profile guided code size optimization. 2019-04-15 16:49:00 +00:00
SplitModule.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
StripGCRelocates.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
StripNonLineTableDebugInfo.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SymbolRewriter.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
UnifyFunctionExitNodes.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Utils.cpp [LLVM-C] Expose the "Add Discriminators" Pass To LLVM-C 2019-03-15 16:57:23 +00:00
VNCoercion.cpp [GVN] Small tweaks to comments, style, and missed vector handling 2019-02-20 00:31:28 +00:00
ValueMapper.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00