Wiki Roadmap Timeline Tickets New Ticket Source Search Help / Guide About Trac Login

Changeset 1506:76936858d1c6

Show
Ignore:
Timestamp:
06/20/09 09:39:13 (6 years ago)
Author:
Frits van Bommel <fvbommel wxs.nl>
branch:
default
Message:

Return void* from _d_allocclass so LLVM doesn't do weird things with it...
This allows -instcombine followed by -gvn to do devirtualization, so add
-gvn in strategic places in the default pass order.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gen/optimizer.cpp

    r1492 r1506  
    136136        addPass(pm, createTailCallEliminationPass()); 
    137137        addPass(pm, createCFGSimplificationPass()); 
     138        addPass(pm, createGVNPass()); 
    138139    } 
    139140 
     
    146147            addPass(pm, createScalarReplAggregatesPass()); 
    147148            addPass(pm, createInstructionCombiningPass()); 
    148  
    149             // Inline again, to catch things like foreach delegates 
    150             // passed to inlined opApply's where the function wasn't 
    151             // known during the first inliner pass. 
     149            // -instcombine + gvn == devirtualization :) 
     150            addPass(pm, createGVNPass()); 
     151 
     152            // Inline again, to catch things like now nonvirtual 
     153            // function calls, foreach delegates passed to inlined 
     154            // opApply's, etc. where the actual function being called 
     155            // wasn't known during the first inliner pass. 
    152156            addPass(pm, createFunctionInliningPass()); 
    153157 
  • gen/runtime.cpp

    r1485 r1506  
    330330        std::vector<const LLType*> types; 
    331331        types.push_back(classInfoTy); 
    332         const llvm::FunctionType* fty = llvm::FunctionType::get(objectTy, types, false); 
     332        const llvm::FunctionType* fty = llvm::FunctionType::get(voidPtrTy, types, false); 
    333333        llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M) 
    334334            ->setAttributes(Attr_NoAlias); 
  • runtime/internal/lifetime.d

    r1440 r1506  
    108108 * 
    109109 */ 
    110 extern (C) Object _d_allocclass(ClassInfo ci) 
     110extern (C) void* _d_allocclass(ClassInfo ci) 
    111111{ 
    112112    void* p; 
     
    151151 
    152152    debug(PRINTF) printf("initialization done\n"); 
    153     return cast(Object) p; 
     153    return p; 
    154154} 
    155155 
Copyright © 2008, LDC Development Team.