)]}'
{
  "commit": "46587483e30188ce485097cdeb48a4d1e0c8a445",
  "tree": "3ad064dec7da6decb98ce0a63e1f71f4592073a4",
  "parents": [
    "0a5b33a8839431a3959273b5ed4a5f3aa77fddfa"
  ],
  "author": {
    "name": "Keith Randall",
    "email": "khr@golang.org",
    "time": "Sat Mar 02 19:22:07 2024 -0800"
  },
  "committer": {
    "name": "Than McIntosh",
    "email": "thanm@google.com",
    "time": "Wed Mar 27 18:49:37 2024 +0000"
  },
  "message": "[release-branch.go1.22] cmd/compile: fix sign/zero-extension removal\n\nWhen an opcode generates a known high bit state (typically, a sub-word\noperation that zeros the high bits), we can remove any subsequent\nextension operation that would be a no-op.\n\nx \u003d (OP ...)\ny \u003d (ZeroExt32to64 x)\n\nIf OP zeros the high 32 bits, then we can replace y with x, as the\nzero extension doesn\u0027t do anything.\n\nHowever, x in this situation normally has a sub-word-sized type.  The\nsemantics of values in registers is typically that the high bits\nbeyond the value\u0027s type size are junk. So although the opcode\ngenerating x *currently* zeros the high bits, after x is rewritten to\nanother opcode it may not - rewrites of sub-word-sized values can\ntrash the high bits.\n\nTo fix, move the extension-removing rules to late lower. That ensures\nthat their arguments won\u0027t be rewritten to change their high bits.\n\nI am also worried about spilling and restoring. Spilling and restoring\ndoesn\u0027t preserve the high bits, but instead sets them to a known value\n(often 0, but in some cases it could be sign-extended).  I am unable\nto come up with a case that would cause a problem here, so leaving for\nanother time.\n\nUpdate #66076\n\nChange-Id: I3b5c091b3b3278ccbb7f11beda8b56f4b6d3fde7\nReviewed-on: https://go-review.googlesource.com/c/go/+/568616\nReviewed-by: Keith Randall \u003ckhr@google.com\u003e\nReviewed-by: Cherry Mui \u003ccherryyz@google.com\u003e\nLUCI-TryBot-Result: Go LUCI \u003cgolang-scoped@luci-project-accounts.iam.gserviceaccount.com\u003e\n(cherry picked from commit a46ecdca36b2359e7496c6d694703a9a9706d760)\nReviewed-on: https://go-review.googlesource.com/c/go/+/573375\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "aac6873d2888e4c60ce2c54e2360a304ed473a08",
      "old_mode": 33188,
      "old_path": "src/cmd/compile/internal/ssa/_gen/AMD64.rules",
      "new_id": "2a4c59ebfc7176028ed9bd5eefa83f11b1a81a23",
      "new_mode": 33188,
      "new_path": "src/cmd/compile/internal/ssa/_gen/AMD64.rules"
    },
    {
      "type": "modify",
      "old_id": "a1e63d6249ac8a10f4b6a4c30f8475af569b9c87",
      "old_mode": 33188,
      "old_path": "src/cmd/compile/internal/ssa/_gen/AMD64latelower.rules",
      "new_id": "1dd804577aeafacb704c3ee28e134f6105cc8a3e",
      "new_mode": 33188,
      "new_path": "src/cmd/compile/internal/ssa/_gen/AMD64latelower.rules"
    },
    {
      "type": "modify",
      "old_id": "c5ee0285d9dbd2bf107064d5c5c74733ade5d6ea",
      "old_mode": 33188,
      "old_path": "src/cmd/compile/internal/ssa/_gen/ARM64.rules",
      "new_id": "18a6586fb0bf01621489ef7733dd14ecd49d4b29",
      "new_mode": 33188,
      "new_path": "src/cmd/compile/internal/ssa/_gen/ARM64.rules"
    },
    {
      "type": "modify",
      "old_id": "d0c2099da9b7c3397134ae817ca3d3b4c125fa65",
      "old_mode": 33188,
      "old_path": "src/cmd/compile/internal/ssa/_gen/ARM64latelower.rules",
      "new_id": "e50d985aa0c8f71d8d49114f48677e66ff451b64",
      "new_mode": 33188,
      "new_path": "src/cmd/compile/internal/ssa/_gen/ARM64latelower.rules"
    },
    {
      "type": "modify",
      "old_id": "bb09c6cddaae2d972a45a12cd02c7f938720cc68",
      "old_mode": 33188,
      "old_path": "src/cmd/compile/internal/ssa/rewrite.go",
      "new_id": "531c5e4cb2c2318c2c4b2e4f93cdb7d7a34edd9d",
      "new_mode": 33188,
      "new_path": "src/cmd/compile/internal/ssa/rewrite.go"
    },
    {
      "type": "modify",
      "old_id": "5332512f2af681a4674fcedf1c2febe033f68e8f",
      "old_mode": 33188,
      "old_path": "src/cmd/compile/internal/ssa/rewriteAMD64.go",
      "new_id": "ba71189703ddffa6d432eb991ff63dbba7bd1cb0",
      "new_mode": 33188,
      "new_path": "src/cmd/compile/internal/ssa/rewriteAMD64.go"
    },
    {
      "type": "modify",
      "old_id": "d3dd2633d1044aee762d50e39b8a58755f0efcce",
      "old_mode": 33188,
      "old_path": "src/cmd/compile/internal/ssa/rewriteAMD64latelower.go",
      "new_id": "11ecb0b285a22cb6effe8df9188d4374546e48aa",
      "new_mode": 33188,
      "new_path": "src/cmd/compile/internal/ssa/rewriteAMD64latelower.go"
    },
    {
      "type": "modify",
      "old_id": "f0a4425502a2b56e5ae62e09412afccbe9ad85f7",
      "old_mode": 33188,
      "old_path": "src/cmd/compile/internal/ssa/rewriteARM64.go",
      "new_id": "8f60f023b18d4986ee98954c41da115212dade6b",
      "new_mode": 33188,
      "new_path": "src/cmd/compile/internal/ssa/rewriteARM64.go"
    },
    {
      "type": "modify",
      "old_id": "09987571855fd16c946ffe5cfe19f5fb2dc13b44",
      "old_mode": 33188,
      "old_path": "src/cmd/compile/internal/ssa/rewriteARM64latelower.go",
      "new_id": "6873fd79968514b92a32243d96b51b57ebbea514",
      "new_mode": 33188,
      "new_path": "src/cmd/compile/internal/ssa/rewriteARM64latelower.go"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "a674503b4729b238063471cbad158736afa76fa1",
      "new_mode": 33188,
      "new_path": "test/fixedbugs/issue66066.go"
    }
  ]
}
