The heart of any backend is instruction selection. LLVM implements several approaches; in this chapter, we will implement instruction selection…