While trying some things out I found that foo and foo2 compile to the same thing. So LLVM is probably just using dce to ignore it. Which makes your code quite odd.
function foo(x)
# some code
y = (1, 2) # first
y = [x[1] for i in x] # second
# more code
return y
end
function foo2(x)
# some code
# first
y = [x[1] for i in x] # second
# more code
return y
end