mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 04:02:41 +01:00
6d9a123c1d
>> > > It doesn't matter in terms of semantics: because AnalyzeGlobal > returned false, we're guaranteed the address of the global is never > taken. I wouldn't be surprised if we end up generating invalid IR in > some cases, though, because of the semantics of replaceAllUsesWith. > Do you have a testcase that breaks? > > The problem is replaceAllUsesWith asserts for type mismatch here. Try attached .bc with llvm-ld. assert(New->getType() == getType() && "replaceAllUses of value with new value of different type!"); Since stack is always on address space zero, I don't think that type of GV in a different address space is ever going to match. The other way is to allow replaceAllUsesWith to ignore address spaces while comparing types. (do we have a way to do that ?). But then such an optimization may fail the entire idea of user wanting to place a variable into different memory space. The original idea of user might be to save on the stack space (data memory) and hence he asked the variable to be placed into different memory space (program memory). So the best bet here is to deny this optimization by checking GV->getType()->getAddressSpace() == 0. llvm-svn: 73605 |
||
---|---|---|
.. | ||
ArgumentPromotion.cpp | ||
CMakeLists.txt | ||
ConstantMerge.cpp | ||
DeadArgumentElimination.cpp | ||
DeadTypeElimination.cpp | ||
ExtractGV.cpp | ||
FunctionAttrs.cpp | ||
GlobalDCE.cpp | ||
GlobalOpt.cpp | ||
IndMemRemoval.cpp | ||
InlineAlways.cpp | ||
Inliner.cpp | ||
InlineSimple.cpp | ||
Internalize.cpp | ||
IPConstantPropagation.cpp | ||
IPO.cpp | ||
LoopExtractor.cpp | ||
LowerSetJmp.cpp | ||
Makefile | ||
MergeFunctions.cpp | ||
PartialInlining.cpp | ||
PartialSpecialization.cpp | ||
PruneEH.cpp | ||
RaiseAllocations.cpp | ||
StripDeadPrototypes.cpp | ||
StripSymbols.cpp | ||
StructRetPromotion.cpp |