Loop-invariant code motion is a way to make code (a set of instructions) run faster. It works by moving code that doesn't change when a loop runs to the outside of the loop. This means that the code only needs to be run once at the start, instead of running again each time the loop goes around. Moving code outside the loop can make it run faster, because the computer doesn't need to do the same things over and over.