)]}'
{
  "commit": "bc1a66c7cfe12f1fb1f12c38b35148822b36beca",
  "tree": "eb4b9074275cb79ca91ed2696f6b16b193a567b2",
  "parents": [
    "6649bd025e0106c372d624a736a6dfc7b8f37404"
  ],
  "author": {
    "name": "Nicolas Capens",
    "email": "capn@google.com",
    "time": "Fri Feb 05 15:18:42 2021 -0500"
  },
  "committer": {
    "name": "Nicolas Capens",
    "email": "nicolascapens@google.com",
    "time": "Fri Feb 19 21:06:06 2021 +0000"
  },
  "message": "Fix lowering and optimization of 64-bit absolute addresses\n\nx86-64 does not support 64-bit immediates as absolute memory addresses.\nThey have to be stored in a register, which can then be used as [base].\n\nPreviously we addressed this at the SubzeroReactor level by emitting a\nBitcast from an Ice::Operand to an Ice::Variable, for which Subzero\nalready supported 64-bit constants as input.\n\nThis change implements X86OperandMem creation from a 64-bit constant\noperand by letting legalize() move it into a GPR and using it as the\nmemory operand\u0027s base register.\n\nA Reactor unit test is added to exercise this.\n\nAnother issue was that doLoadOpt() assumed all load instructions are\ncandidates for fusing into a subsequent instruction which takes the\nresult of the load. This isn\u0027t true when for 64-bit constant addresses\nan instruction to copy it into a register is inserted.\n\nFor now this case is simply skipped. A future optimization could adjust\nthe iterators properly so the load from [base] can be fused with the\nnext instruction.\n\nLastly, it is possible for a 64-bit constant to fit within a 32-bit\nimmediate, in which case legalize() by default does not perform the copy\ninto a GPR (note this is to allow moves and calls with 64-bit\nimmediates, where they are legal), and simply returns the 64-bit\nconstant. So we must not allow legalization to an immediate in this\ncase. Note that while we could replace it with a 32-bit constant, it\u0027s\nrare for absolute addresses to fit in this range, and it would be\nnon-deterministic which path is taken, so for consistency we don\u0027t\nperform this optimization.\n\nBug: b/148272103\nChange-Id: I5fcfa971dc93f2307202ee11619e84c65fe46188\nReviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52768\nTested-by: Nicolas Capens \u003cnicolascapens@google.com\u003e\nPresubmit-Ready: Nicolas Capens \u003cnicolascapens@google.com\u003e\nReviewed-by: Antonio Maiorano \u003camaiorano@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "8be37b5effb1f337e236e260ee5768fa82aa7897",
      "old_mode": 33188,
      "old_path": "src/Reactor/Optimizer.cpp",
      "new_id": "d5f95e89d55ef1f1f82d8d7f1ac2d50be1f60368",
      "new_mode": 33188,
      "new_path": "src/Reactor/Optimizer.cpp"
    },
    {
      "type": "modify",
      "old_id": "41c07c84dd9f617e9fafd7b8f838c40cc1a6812c",
      "old_mode": 33188,
      "old_path": "src/Reactor/SubzeroReactor.cpp",
      "new_id": "53377cadaaa348c05e483f3619208d89784615ae",
      "new_mode": 33188,
      "new_path": "src/Reactor/SubzeroReactor.cpp"
    },
    {
      "type": "modify",
      "old_id": "b6c0d9cf707ebaab8b1f3d1fe0c75c299900766b",
      "old_mode": 33188,
      "old_path": "tests/ReactorUnitTests/ReactorUnitTests.cpp",
      "new_id": "6b85a480b7c2ffa9f1b0003c4623ae1df509e756",
      "new_mode": 33188,
      "new_path": "tests/ReactorUnitTests/ReactorUnitTests.cpp"
    },
    {
      "type": "modify",
      "old_id": "d4c41d30ace7775caa0558b7c4d695e9e7951452",
      "old_mode": 33188,
      "old_path": "third_party/subzero/src/IceTargetLoweringX86BaseImpl.h",
      "new_id": "37ab794fc10be182bf78821c54f1e1127e178df7",
      "new_mode": 33188,
      "new_path": "third_party/subzero/src/IceTargetLoweringX86BaseImpl.h"
    }
  ]
}
