+ PM.add(getModuleAsmPrinterPass(Out));
+
+ // Emit bytecode to the assembly file into its special section next
+ if (EmitMappingInfo) {
+ PM.add(getEmitBytecodeToAsmPass(Out));
+ PM.add(getFunctionInfo(Out));
+ }
+
+ return false;
+}
+
+// addPassesToJITCompile - This method controls the JIT method of code
+// generation for the UltraSparc.
+//
+bool UltraSparc::addPassesToJITCompile(PassManager &PM) {
+ const TargetData &TD = getTargetData();
+
+ PM.add(new TargetData("lli", TD.isLittleEndian(), TD.getPointerSize(),
+ TD.getPointerAlignment(), TD.getDoubleAlignment()));
+
+ // Replace malloc and free instructions with library calls.
+ // Do this after tracing until lli implements these lib calls.
+ // For now, it will emulate malloc and free internally.
+ PM.add(createLowerAllocationsPass());
+
+ // FIXME: implement the switch instruction in the instruction selector.
+ PM.add(createLowerSwitchPass());
+
+ // decompose multi-dimensional array references into single-dim refs
+ PM.add(createDecomposeMultiDimRefsPass());
+
+ // Construct and initialize the MachineFunction object for this fn.
+ PM.add(createMachineCodeConstructionPass(*this));
+
+ PM.add(createInstructionSelectionPass(*this));
+
+ // new pass: convert Value* in MachineOperand to an unsigned register
+ // this brings it in line with what the X86 JIT's RegisterAllocator expects
+ //PM.add(createAddRegNumToValuesPass());
+
+ PM.add(getRegisterAllocator(*this));
+ PM.add(getPrologEpilogInsertionPass());
+
+ if (!DisablePeephole)
+ PM.add(createPeepholeOptsPass(*this));