Skip to content

Commit

Permalink
Internal feature
Browse files Browse the repository at this point in the history
Change-Id: I05b8699b7d4e069b0cd264ff6c0c0ac4edaca02f
  • Loading branch information
DianaChen authored and paigeale committed Nov 1, 2018
1 parent 66de115 commit 3c8da04
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
4 changes: 3 additions & 1 deletion visa/iga/IGALibrary/Frontend/KernelParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -760,8 +760,8 @@ bool GenParser::TryParseInstOptOrDepInfo(InstOptSet &instOpts)
bool GenParser::tryParseInstOptDepInfoToken(InstOptSet &instOpts)
{
auto loc = NextLoc();
InstOpt newOpt = InstOpt::ACCWREN;
if (LookingAt(IDENT)) {
InstOpt newOpt = InstOpt::ACCWREN;
// classic instruction option that affects instruction dependency
// scheduling etc...
if (ConsumeIdentEq("NoDDChk")) {
Expand Down Expand Up @@ -2975,7 +2975,9 @@ Kernel *iga::ParseGenKernel(
const ParseOpts &popts)
{
Kernel *k = new Kernel(m);

InstBuilder h(k, e);

KernelParser p(m, h, inp, e, popts);
try {
p.ParseListing();
Expand Down
3 changes: 3 additions & 0 deletions visa/iga/IGALibrary/IR/InstBuilder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ class InstBuilder {




void clearInstState() {
m_predication.function = PredCtrl::NONE;
m_predication.inverse = false;
Expand Down Expand Up @@ -263,6 +264,7 @@ class InstBuilder {
} // else: targets end of program exactly
}


public:
InstBuilder(Kernel *kernel, ErrorHandler &e)
: m_model(kernel->getModel())
Expand All @@ -274,6 +276,7 @@ class InstBuilder {

ErrorHandler &errorHandler() {return m_errorHandler;}


// Called at the beginning of the program
void ProgramStart() {
m_pc = 0;
Expand Down
10 changes: 7 additions & 3 deletions visa/iga/IGALibrary/api/igaEncoderWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ iga_status_t KernelEncoder::encode()
{

ErrorHandler errHandler;
Encoder enc(kernel->getModel(),
errHandler, EncoderOpts(autoCompact, true, nocompactFirstEightInst));
Encoder enc(kernel->getModel(), errHandler,
EncoderOpts(autoCompact,
true,
nocompactFirstEightInst,
false
));
enc.encodeKernel(
*kernel,
kernel->getMemManager(),
Expand Down Expand Up @@ -73,4 +77,4 @@ bool KernelEncoder::patchImmValue(const Model& model, unsigned char* binary, Typ
return false;

return true;
}
}
1 change: 1 addition & 0 deletions visa/iga/IGALibrary/api/igaEncoderWrapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ class KernelEncoder
// This function is used by visa to patch the add or mov instructions' imm field for the indirect call
// FIXME: Move this api to somewhere else that's more apporopriate
static bool patchImmValue(const iga::Model& model, unsigned char* binary, iga::Type type, const iga::ImmVal &val);

};

0 comments on commit 3c8da04

Please sign in to comment.