[Beignet] [PATCH] GBE: Correctly process constant for phi instruction

Ruiling Song ruiling.song at intel.com
Wed Jun 18 00:59:53 PDT 2014


Simply use getRegister which deals with various ConstantExpr.
Thanks to Abrahm Scully who report the bug.

Signed-off-by: Ruiling Song <ruiling.song at intel.com>
---
 backend/src/llvm/llvm_gen_backend.cpp |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/backend/src/llvm/llvm_gen_backend.cpp b/backend/src/llvm/llvm_gen_backend.cpp
index f3291f8..1bf59a1 100644
--- a/backend/src/llvm/llvm_gen_backend.cpp
+++ b/backend/src/llvm/llvm_gen_backend.cpp
@@ -1083,9 +1083,7 @@ namespace gbe
           if (CPV && dyn_cast<ConstantVector>(CPV) &&
               isa<UndefValue>(extractConstantElem(CPV, 0)))
             continue;
-          const ir::ImmediateIndex immIndex = this->newImmediate(CP);
-          const ir::Immediate imm = ctx.getImmediate(immIndex);
-          ctx.LOADI(imm.type, dst, immIndex);
+          ctx.MOV(type, dst, getRegister(CP));
         } else if (regTranslator.valueExists(IV,0) || dyn_cast<Constant>(IV)) {
           const ir::Register src = this->getRegister(IV);
           ctx.MOV(type, dst, src);
-- 
1.7.10.4



More information about the Beignet mailing list