tclquadcode

Check-in [06eeceb52e]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:merge changes that restore retrograde type inference hack
Timelines: family | ancestors | descendants | both | llvm-integration-memory-part2
Files: files | file ages | folders
SHA1:06eeceb52ed9a89a7faed81ee62ab6a7315ad4fc
User & Date: kbk 2015-03-09 01:57:36
Context
2015-03-09
02:42
Try to restore retrograde type inference - second attempt Closed-Leaf check-in: f68b06d6b1 user: kbk tags: llvm-integration-memory-part2
01:57
merge changes that restore retrograde type inference hack check-in: 06eeceb52e user: kbk tags: llvm-integration-memory-part2
01:53
Make retrograde type inference hack work again. check-in: dc00e24c34 user: kbk tags: kbk-free-values
2015-03-08
16:52
Merge the code to generate the lifetimes from the model; [6d228ecd45] crashes due to type problems... check-in: 3b984c101d user: dkf tags: llvm-integration-memory-part2
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to quadcode.tcl.

2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
....
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
#	Returns a type code
#
# Totally half-arsed implementation needed to get the LLVM connection going

proc requiredInputType {q v} {
    switch -exact -- [lindex $q 0] {
	invoke {
	    if {[lindex $q 2 0] eq "literal" && [lindex $q 2 2] == -1} {
		switch [lindex [builtinCommandType [lindex $q 2 1]] 0 0] {
		    INT {
			return $dataType::INT
		    }
		    DOUBLE {
			return $dataType::DOUBLE
		    }
................................................................................
    }

    # constrain all parameter types according to how they are used in the
    # three address code

    foreach q $quads {
	foreach v [lrange $q 2 end] {
	    if {[lindex $v 0] eq {var} && [lindex $v 2] == -1} {
		set t [requiredInputType $q $v]
		dict set vtypes $v [expr {[dict get $vtypes $v] & $t}]
	    }
	}
    }
}








|







 







|







2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
....
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
#	Returns a type code
#
# Totally half-arsed implementation needed to get the LLVM connection going

proc requiredInputType {q v} {
    switch -exact -- [lindex $q 0] {
	invoke {
	    if {[lindex $q 2 0] eq "literal" && [llength [lindex $q 2]] < 3} {
		switch [lindex [builtinCommandType [lindex $q 2 1]] 0 0] {
		    INT {
			return $dataType::INT
		    }
		    DOUBLE {
			return $dataType::DOUBLE
		    }
................................................................................
    }

    # constrain all parameter types according to how they are used in the
    # three address code

    foreach q $quads {
	foreach v [lrange $q 2 end] {
	    if {[lindex $v 0] eq {var} && [llength $v] < 3} {
		set t [requiredInputType $q $v]
		dict set vtypes $v [expr {[dict get $vtypes $v] & $t}]
	    }
	}
    }
}