There's a reason a lot of these potentially non-portable tricks show up in high-performance computing (particularly in videogames) and in the embedded space.
Otherwise, remember the first rule of code optimization for beginners: "Don't."
EDIT: And by "they don't apply", I mean they can crash your program or even silently corrupt your data.
For games, this can mean a higher frame rate. For data processing, it can mean the data gets processed significantly faster. It's especially important for things like video encoders, where even a 1% savings in CPU time can translate directly to 1% more potential revenue for the same operating cost at a company that relies heavily on video encoding.
Yeah, saving those cycles doesn't really mean anything to a beginner, but they can be a huge savings for high performance computation applications.
When you first learn about 'cool hacks' like these, you'll want to use everywhere.
Then you'll realize that they don't apply to certain data types in certain environments.
Then you'll come to realize that the rules governing which hacks to use are too complex to remember.
Then you'll want to write a program that figures it out for you.
Then you'll realize that those programs already exist, and they are called compilers.
So now you are back where you started. You have made no progress, but you have gained an important insight.