This is an archive of the discontinued LLVM Phabricator instance.

[IR][CodeGen] Remove dependency on EVT from IR/Function.cpp. Move EVT to CodeGen layer.
ClosedPublic

Authored by craig.topper on Mar 28 2018, 11:36 PM.

Details

Summary

Currently EVT is in the IR layer only because of Function.cpp needing a very small piece of the functionality of EVT::getEVTString(). The rest of EVT is used in codegen making CodeGen a better place for it.

The previous code converted a Type* to EVT and then called getEVTString. This was only expected to handle the primitive types from Type*. Since there only a few primitive types, we can just print them as strings directly.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Mar 28 2018, 11:36 PM
dblaikie accepted this revision.Mar 29 2018, 8:37 AM

Fair - the minor 'duplication' seems fine, given it skips the work of mapping the llvm::Type to an EVT, etc...

This revision is now accepted and ready to land.Mar 29 2018, 8:37 AM
This revision was automatically updated to reflect the committed changes.
llvm/trunk/lib/IR/Function.cpp