[llvm] r209386 - Override runOnMachineFunction for ARMISelDAGToDAG so that we can

Eric Christopher echristo at gmail.com
Thu May 22 11:25:56 PDT 2014


On Wed, May 21, 2014 at 11:45 PM, Tim Northover <t.p.northover at gmail.com> wrote:
> Hi Eric,
>
>> Override runOnMachineFunction for ARMISelDAGToDAG so that we can
>> reset the subtarget on each function.
>
> Is this preparation for something bigger you're working on, or do we
> need it for some reason now?
>

Preparation for something bigger, basically the CGContext stuff from
another thread. The basic idea comes down to being able to link
together modules (or include in a single module) functions which
target different subtargets/subtarget features and still be able to
codegen and optimize them correctly. It's similar to some of the
function specific optimization that happened recently.

Part of what's going to happen is that we need to be able to
reset/replace/etc the subtarget, target lowering, TTI during a pass
run for a particular target. (Alternately construct a new pass
hierarchy, but that's expensive for reasons I don't know).

As an example (I could give you IR, but this should work): compile one
.c file with -msse3 and one with -msse4.2 and then link the resultant
IR. With a small patch to add the attributes that we already look at
(but then fail on) we could have a single IR file and then generate
code for sse3 and sse4.2 for them on a per function basis.

Also something like: https://gcc.gnu.org/wiki/FunctionMultiVersioning :)

Make sense?

-eric



More information about the llvm-commits mailing list