[Beignet] [PATCH] Backend: Fix bug build with clang

Yang, Rong R rong.r.yang at intel.com
Tue May 17 06:00:06 UTC 2016


LGTM, pushed, thanks.

> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> Xiuli Pan
> Sent: Friday, April 29, 2016 14:32
> To: beignet at lists.freedesktop.org
> Cc: Pan, Xiuli <xiuli.pan at intel.com>
> Subject: [Beignet] [PATCH] Backend: Fix bug build with clang
> 
> From: Pan Xiuli <xiuli.pan at intel.com>
> 
> When using clang template name can not be the same with class variable.
> This bug will cause the gen ir load/store switch and casue self test error.
> 
> Signed-off-by: Pan Xiuli <xiuli.pan at intel.com>
> ---
>  backend/src/llvm/llvm_gen_backend.cpp | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/backend/src/llvm/llvm_gen_backend.cpp
> b/backend/src/llvm/llvm_gen_backend.cpp
> index 51a1dab..66293fc 100644
> --- a/backend/src/llvm/llvm_gen_backend.cpp
> +++ b/backend/src/llvm/llvm_gen_backend.cpp
> @@ -443,7 +443,7 @@ namespace gbe
>        void         emitBatchLoadOrStore(const ir::Type type, const uint32_t
> elemNum, Value *llvmValues, Type * elemType);
>        ir::Register getOffsetAddress(ir::Register basePtr, unsigned offset);
>        void         shootMessage(ir::Type type, ir::Register offset, ir::Tuple value,
> unsigned elemNum);
> -      template <bool isLoad, typename T>
> +      template <bool IsLoad, typename T>
>        void         emitLoadOrStore(T &I);
>      private:
>        ir::Context             &ctx;
> @@ -642,7 +642,7 @@ namespace gbe
>       */
>      INLINE void simplifyTerminator(BasicBlock *bb);
>      /*! Helper function to emit loads and stores */
> -    template <bool isLoad, typename T> void emitLoadOrStore(T &I);
> +    template <bool IsLoad, typename T> void emitLoadOrStore(T &I);
>      /*! Will try to remove MOVs due to PHI resolution */
>      void removeMOVs(const ir::Liveness &liveness, ir::Function &fn);
>      /*! Optimize phi move based on liveness information */ @@ -712,7 +712,7
> @@ namespace gbe
>      void visitUnreachableInst(UnreachableInst &I) {NOT_SUPPORTED;}
>      void visitGetElementPtrInst(GetElementPtrInst &I) {NOT_SUPPORTED;}
>      void visitInsertValueInst(InsertValueInst &I) {NOT_SUPPORTED;}
> -    template <bool isLoad, typename T> void visitLoadOrStore(T &I);
> +    template <bool IsLoad, typename T> void visitLoadOrStore(T &I);
> 
>      INLINE void gatherBTI(Value *pointer, ir::BTI &bti);
>      // batch vec4/8/16 load/store
> @@ -4863,7 +4863,7 @@ namespace gbe
>      }
>    }
> 
> -  template <bool isLoad, typename T>
> +  template <bool IsLoad, typename T>
>    void MemoryInstHelper::emitLoadOrStore(T &I) {
>      Value *llvmPtr = I.getPointerOperand();
>      Value *llvmValues = getLoadOrStoreValue(I); @@ -4873,7 +4873,7 @@
> namespace gbe
>      const ir::Register pointer = writer->getRegister(llvmPtr);
>      const ir::RegisterFamily pointerFamily = ctx.getPointerFamily();
> 
> -    this->isLoad = isLoad;
> +    this->isLoad = IsLoad;
>      Type *scalarType = llvmType;
>      if (!isScalarType(llvmType)) {
>        VectorType *vectorType = cast<VectorType>(llvmType);
> --
> 2.5.0
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list