very good programmers tend to have detailed knowledge of the innards of the compiler.
Very good programmers don't care about how compilers work, as compilers have no say in how programming languages work. Their task is it to transform source code into instructions that CPUs or interpreters can execute.
Compilers don't define programming languages, their rules, their expected behavior, or their edge cases, language standards do that and compilers have to follow those standards. They also don't define how CPUs work, CPU vendors or consortia define that and compilers have to work with what they get from those.
Also GCC works very different in many as aspects to LLVM, so it would not be very smart to optimize your C or C++ code for either of these compilers as then the code would perform poorly or not even compile with the other one. Also an optimization in your code that works great today may work horrible in the future, as compilers do change with releases, so you must never rely that your compiler will do or won't do something, as with the next release, everything may be different as it is today.
So unless you want to write your own C/C++ compiler, you don't need to know how current compilers operate as a C/C++ programmer. The next generation of compilers may be AI based and nothing you learn today may be relevant in 5 to 10 years anymore. Also C or C++ may not even be a relevant language anymore in a foreseeable future, considering that modern languages are way more powerful, have better error checking, and are easier to write - nothing new so far - but also meanwhile achieve comparable speeds. E.g. I have plenty of code samples where Swift code is equally fast than C++ code and where Rust code can even beat C code in speed, yet both offer far better compile time and runtime error checking and make it much harder to shoot yourself in the foot than C or C++.
If you want to learn how to write a compiler, there are tons of books about compiler theory but I don't recommend trying to write your own compiler backend, as no matter what you come up with, it will be worse than any existing backend out there. If anything, you write a compiler frontend and use an existing backend and all you need for a frontend is syntax parsing and converting your own language to the intermediate representation that your backend expects. From there the backend will take over and does all the hard work for you.