[Beignet] [PATCH 3/5] GBE: Move createStripAttributesPass before createInstructionCombiningPass.
Yang, Rong R
rong.r.yang at intel.com
Mon Oct 12 23:32:25 PDT 2015
Because the default CallingConv of builtins is CallingConv::C before LLVM3.7 and CallingConv::SPIR_FUNC in LLVM 3.7.
And call instruction's CallingConv::C.
In createInstructionCombiningPass, if call and callee's calling conventions don't match, the call is replaced to undefined.
So need move createStripAttributesPass before createInstructionCombiningPass, because createStripAttributesPass will change all builtins' calling convention to CallingConv::C by force.
> -----Original Message-----
> From: Song, Ruiling
> Sent: Tuesday, October 13, 2015 10:28
> To: Yang, Rong R; beignet at lists.freedesktop.org
> Cc: Yang, Rong R
> Subject: RE: [Beignet] [PATCH 3/5] GBE: Move createStripAttributesPass
> before createInstructionCombiningPass.
>
> The patchset LGTM except this one, I think we still need to make clear what
> goes wrong here.
>
> Thanks!
> Ruiling
> > -----Original Message-----
> > From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf
> > Of Yang Rong
> > Sent: Wednesday, September 16, 2015 4:50 PM
> > To: beignet at lists.freedesktop.org
> > Cc: Yang, Rong R
> > Subject: [Beignet] [PATCH 3/5] GBE: Move createStripAttributesPass
> > before createInstructionCombiningPass.
> >
> > Otherwise, createInstructionCombiningPass will convert some call to
> > illegal instruction in llvm3.7, for example utest compiler_time_stamp
> > and test_load_program_from_spir.
> >
> > Signed-off-by: Yang Rong <rong.r.yang at intel.com>
> > ---
> > backend/src/llvm/llvm_to_gen.cpp | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/backend/src/llvm/llvm_to_gen.cpp
> > b/backend/src/llvm/llvm_to_gen.cpp
> > index 538d1c5..24d4be7 100644
> > --- a/backend/src/llvm/llvm_to_gen.cpp
> > +++ b/backend/src/llvm/llvm_to_gen.cpp
> > @@ -110,6 +110,7 @@ namespace gbe
> > MPM.add(createTypeBasedAliasAnalysisPass());
> > MPM.add(createBasicAliasAnalysisPass());
> > MPM.add(createIntrinsicLoweringPass());
> > + MPM.add(createStripAttributesPass()); // Strip unsupported
> attributes and
> > calling conventions.
> > MPM.add(createSamplerFixPass());
> > MPM.add(createGlobalOptimizerPass()); // Optimize out global vars
> >
> > @@ -119,7 +120,6 @@ namespace gbe
> > MPM.add(createInstructionCombiningPass());// Clean up after IPCP &
> DAE
> > MPM.add(createCFGSimplificationPass()); // Clean up after IPCP & DAE
> > MPM.add(createPruneEHPass()); // Remove dead EH info
> > - MPM.add(createStripAttributesPass()); // Strip unsupported
> attributes and
> > calling conventions.
> > MPM.add(createBarrierNodupPass(false)); // remove noduplicate
> fnAttr
> > before inlining.
> > MPM.add(createFunctionInliningPass(20000));
> > MPM.add(createBarrierNodupPass(true)); // restore noduplicate
> fnAttr after
> > inlining.
> > --
> > 1.8.3.2
> >
> > _______________________________________________
> > Beignet mailing list
> > Beignet at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/beignet
More information about the Beignet
mailing list