[llvm-commits] Patch: new backend for Hexagon processor

Eli Friedman eli.friedman at gmail.com
Mon Nov 28 11:57:05 PST 2011


On Thu, Nov 17, 2011 at 9:00 PM, Tony Linthicum <tlinth at codeaurora.org> wrote:
> On 11/16/2011 6:48 PM, Eli Friedman wrote:
>>
>> On Tue, Nov 15, 2011 at 3:19 PM, Tony Linthicum<tlinth at codeaurora.org>
>>  wrote:
>>>
>>> On 11/14/2011 2:54 PM, Eli Friedman wrote:
>>>
>>>>
>>>> --- a/include/llvm/InitializePasses.h
>>>> +++ b/include/llvm/InitializePasses.h
>>>> @@ -233,6 +233,7 @@ void initializeVerifierPass(PassRegistry&);
>>>>  void initializeVirtRegMapPass(PassRegistry&);
>>>>  void initializeInstSimplifierPass(PassRegistry&);
>>>>
>>>> +void initializeHexagonHardwareLoopsPass(PassRegistry&);
>>>>  }
>>>>
>>>>  #endif
>>>>
>>>> This change shouldn't be necessary; only target-independent passes
>>>> need to be listed here, IIRC.
>>>>
>>>
>>> We are in the process of fixing this and will update with a new patch in
>>> a
>>> day or two.
>>>
>
> Done.
>
>
>>
>> It would be nice to see some more documentation in
>> docs/CodeGenerator.html for Hexagon-specific target information; it
>> looks like there are some interesting target-specific passes, and
>> other information might be useful.
>>
>
> Not a problem.  We will add some documentation.
>
>> I don't see any issues with the rest of the patch; I haven't looked at
>> the lib/Target/Hexagon/* bits in much detail, though.
>>
>
> Thanks.

I just took another look; comments below.

 void MCAsmStreamer::EmitCodeAlignment(unsigned ByteAlignment,
                                       unsigned MaxBytesToEmit) {
-  // Emit with a text fill value.
-  EmitValueToAlignment(ByteAlignment, MAI.getTextAlignFillValue(),
-                       1, MaxBytesToEmit);
+  if (MAI.getCodeAlignDirective()) {
+    OS << MAI.getCodeAlignDirective();
+    EmitEOL();
+  }
+  else {
+    // Emit with a text fill value.
+    EmitValueToAlignment(ByteAlignment, MAI.getTextAlignFillValue(),
+                         1, MaxBytesToEmit);
+  }
 }

This doesn't actually appear to take into account the specified alignment.

+// This file contains a printer that converts from our internal representation
+// of machine-dependent LLVM code to PowerPC assembly language. This printer is

Copy-pasto?  References for PowerPC are scattered around HexagonAsmPrinter.cpp

+/// getFunctionAlignment - Return the Log2 alignment of this function.
+unsigned HexagonTargetLowering::getFunctionAlignment(const Function *) const {
+  return 2;
+}

This isn't overriding anything.  See
setMinFunctionAlignment/setPrefFunctionAlignment.

+def MUX_ri : ALU32_ri<(outs IntRegs:$dst), (ins PredRegs:$src1,
IntRegs:$src2,
s8Imm:$src3),

80 columns?

-Eli




More information about the llvm-commits mailing list