[PATCH] Attach function attribute "arm-restrict-it" instead of passing arm-restrict-it as a backend-option

Akira Hatanaka ahatanak at gmail.com
Fri Jun 12 11:21:28 PDT 2015


Hi echristo, dexonsmith,

This patch is part of the work to make LTO and function multi-versioning work correctly.

Currently, -mrestrict-it and -mno-restrict-it have no effect when doing an LTO build because cc1 passes them as backend options.

This patch fixes this bug by defining a new string function attribute "arm-restrict-it" and attaching it to the functions in the IR. This attribute is a tri-state, whose value corresponds to the cl:opt option "IT" n ARMSubtarget:

attribute not attached => DefaultIT ("arm-default-it")
arm-restrict-it=true => RestrictedIT ("arm-restrict-it")
arm-restrict-it=false => NoRestrictedIT ("arm-no-restrict-it")

I plan to send a corresponding llvm patch shortly.

http://reviews.llvm.org/D10414

Files:
  include/clang/Driver/CC1Options.td
  include/clang/Frontend/CodeGenOptions.h
  lib/CodeGen/CGCall.cpp
  lib/Driver/Tools.cpp
  lib/Frontend/CompilerInvocation.cpp
  test/CodeGen/fn-attr.c
  test/Driver/arm-restrict-it.c
  test/Driver/woa-restrict-it.c

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10414.27584.patch
Type: text/x-patch
Size: 6031 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150612/d797a1a1/attachment.bin>


More information about the cfe-commits mailing list