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 5b54af87178cdbbffcdf3e26aa02f1ef3a6e95c1..3fca522324da8c4f7fed769ff2fa3a98fec6a444 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 29ae168e7603d2cb2a65dfe367157c1b27d667f8..82d871d41067222716b4eca52778f53fb549ba34 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 6eae46d3ae01eac460fbc705284174ea69bbc39a..b1175d7f9b7ab08b2d14dcce1557573c570fa66e 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();