Make ret part of the instruction block instead of implicitely
authorZack Rusin <zack@tungstengraphics.com>
Thu, 25 Oct 2007 16:14:07 +0000 (12:14 -0400)
committerZack Rusin <zack@tungstengraphics.com>
Fri, 26 Oct 2007 18:59:38 +0000 (14:59 -0400)
closing at the end of parsing.

src/mesa/pipe/llvm/instructions.cpp
src/mesa/pipe/llvm/instructions.h
src/mesa/pipe/llvm/llvmtgsi.cpp

index 5b54af8..3fca522 100644 (file)
@@ -1080,3 +1080,8 @@ llvm::Value * Instructions::trunc(llvm::Value *in)
    return vectorFromVals(fx, fy, fz, fw);
 }
 
+void Instructions::end()
+{
+   new ReturnInst(m_block);
+}
+
index 29ae168..82d871d 100644 (file)
@@ -64,6 +64,7 @@ public:
    void         elseop();
    void         endif();
    void         endLoop();
+   void         end();
    llvm::Value *ex2(llvm::Value *in);
    llvm::Value *floor(llvm::Value *in);
    llvm::Value *frc(llvm::Value *in);
index 6eae46d..b1175d7 100644 (file)
@@ -595,6 +595,7 @@ translate_instruction(llvm::Module *module,
    case TGSI_OPCODE_KIL:
       break;
    case TGSI_OPCODE_END:
+      instr->end();
       return;
       break;
    default:
@@ -696,8 +697,6 @@ tgsi_to_llvm(struct gallivm_prog *prog, const struct tgsi_token *tokens)
       }
    }
 
-   new ReturnInst(instr.currentBlock());
-
    tgsi_parse_free(&parse);
 
    prog->num_consts = storage.numConsts();