<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Is there a way to force Using literal pool loads instead of MOVW/MOVT for global/constant value"
   href="http://llvm.org/bugs/show_bug.cgi?id=17280">17280</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Is there a way to force Using literal pool loads instead of MOVW/MOVT for global/constant value
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>mrcool0905@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=11232" name="attach_11232" title="sample code and disassembly dump">attachment 11232</a> <a href="attachment.cgi?id=11232&action=edit" title="sample code and disassembly dump">[details]</a></span>
sample code and disassembly dump

We are cross compiling to cortex-m4 cpu from linux with clang 3.3 and we are
really running of Text. Using literal pool loads instead of MOVW/MOVT would
save 2 bytes each time we load a big value, and I am trying to get it working.
Looking at the change from 5101 (ARMv6T2 and later should materialize
GlobalAddresses using MOVW/MOVT), this should be enabled with -Os for global
value, but it doesn't seem working when I compile the code with Os. After
hacking the llvm source code(add a opt to set UseMovt to false), I was able to
get it working on global value, but it still used MOVW/MOVT on constant value.
Seems like constant value code generation follows a different code path which
doesn't check UseMovt. And I noticed that cortex-m0 use literal pool load all
the time since it doesn't have MOVT instruction.

I am wondering if there is a way to force using literal pool loads instead of
MOVW/MOV, or if you can point me to the right place where we generate constant
value instructions, and I can make a patch for myself. 

Attached is the sample code and disassembly dump.

Thanks,
Rui</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>