Warning: Spoilers for Avengers: Infinity War follow.
Tom Hiddleston found out about Loki’s fate in Avengers: Infinity War two years ago.
Per CBR, Hiddleston revealed during ACE Comic Con in Seattle he knew about Loki’s death since May 2016. Infinity War directors Joe and Anthony Russo told Hiddleston their plans to kill off Loki early on in production.
“So, I’ve known about that scene for two years,” Hiddleston said. “I met with Marvel in May 2016, and they were actually telling me the story of Ragnarok with concept art and images.
“The Russos came in, and I introduced myself. So, all four of us sat down, and they said this is how Infinity War begins.”
Source: IGN.com Hiddleston Knew About Loki's Fate in Infinity War Two Years Ago