Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit 0723602

Browse files
committed
Add casting for other types, like UInt and Float.
1 parent 16b5d55 commit 0723602

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tc/core/polyhedral/codegen_llvm.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,10 @@ class CodeGen_TC : public Halide::Internal::CodeGen_X86 {
252252
if (value->getType() != ty) {
253253
if (op->type.is_int()) {
254254
value = builder->CreateIntCast(value, ty, true);
255+
} else if (op->type.is_uint()) {
256+
value = builder->CreateIntCast(value, ty, false);
257+
} else if (op->type.is_float()) {
258+
value = builder->CreateFPCast(value, ty);
255259
} else {
256260
CHECK(false) << "Type inconsistency not handled. "
257261
<< "Variable " << op->name << " is " << op->type

0 commit comments

Comments
 (0)