[llvm] r302111 - [XRay] Use wordsize-dependent alignment for index

Dean Michael Berris via llvm-commits llvm-commits at lists.llvm.org
Wed May 3 21:55:47 PDT 2017


Author: dberris
Date: Wed May  3 23:55:46 2017
New Revision: 302111

URL: http://llvm.org/viewvc/llvm-project?rev=302111&view=rev
Log:
[XRay] Use wordsize-dependent alignment for index

This makes it simpler for the runtime to consistently handle the entries
in the function sled index in both 32 and 64 bit platforms where the
XRay runtime works.

Follow-up on D32693.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=302111&r1=302110&r2=302111&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Wed May  3 23:55:46 2017
@@ -2811,10 +2811,10 @@ void AsmPrinter::emitXRayTable() {
 
   // We then emit a single entry in the index per function. We use the symbols
   // that bound the instrumentation map as the range for a specific function.
-  // Each entry here will be 16-byte aligned, as we're writing down two
-  // pointers.
+  // Each entry here will be 2 * word size aligned, as we're writing down two
+  // pointers. This should work for both 32-bit and 64-bit platforms.
   OutStreamer->SwitchSection(FnSledIndex);
-  OutStreamer->EmitCodeAlignment(16);
+  OutStreamer->EmitCodeAlignment(2 * WordSizeBytes);
   OutStreamer->EmitLabel(IdxRef);
   OutStreamer->EmitSymbolValue(SledsStart, WordSizeBytes);
   OutStreamer->EmitSymbolValue(SledsEnd, WordSizeBytes);




More information about the llvm-commits mailing list