Code that is not used is removed from the final binary.
For example
proc noOneCalledMe() =
echo "Hello?"
echo 1+1
The noOneCalledMe proc will not exist in the final binary created by Nim because it's not used at all. In C or C++ this is usually something you get by compiling with -lto which no one does because it too slow in those languages.
IMO, the most benefit from DCE (Dead code elimination) that it allows to import modules without worrying too much on other modules overhead.
For example if you imported sequtils and used only one proc from this module, you will get only one extra proc extra (and its dependencies if any) in final executable. While in c/c++ if you are imported a library you are importing all of it even if you need 1% of it.