go.tools/ssa: avoid redundant uint64 conversion of right operand of <<, >>.
Also: add sanity check that no Instruction yields a Value of 'untyped' type.
https://codereview.appspot.com/11011043/diff/15001/ssa/sanity.go File ssa/sanity.go (right): https://codereview.appspot.com/11011043/diff/15001/ssa/sanity.go#newcode163 ssa/sanity.go:163: // Check value-defining instructions have valid types. On 2013/07/08 ...
10 years, 8 months ago
(2013-07-08 21:29:26 UTC)
#3
https://codereview.appspot.com/11011043/diff/15001/ssa/sanity.go
File ssa/sanity.go (right):
https://codereview.appspot.com/11011043/diff/15001/ssa/sanity.go#newcode163
ssa/sanity.go:163: // Check value-defining instructions have valid types.
On 2013/07/08 21:15:13, gri wrote:
> what about
>
> if x == y ...
>
> The result of x == y is an untyped bool per the spec:
>
> "Comparison operators compare two operands and yield an untyped boolean
value."
Yes, the source type of x==y is an untyped bool, but the type of the
ssa.BinOp(EQL) instruction is exactly a bool. Conversions are emitted as needed
to convert this to a named bool type.
I added a testcase.
*** Submitted as https://code.google.com/p/go/source/detail?r=7c66da902422&repo=tools *** go.tools/ssa: avoid redundant uint64 conversion of right operand of <<, ...
10 years, 8 months ago
(2013-07-08 21:33:54 UTC)
#5
Issue 11011043: code review 11011043: go.tools/ssa: avoid redundant uint64 conversion of righ...
(Closed)
Created 10 years, 8 months ago by adonovan
Modified 10 years, 6 months ago
Reviewers:
Base URL:
Comments: 3