[GISel]: Relax opcode checking at the top level to enable CSE
authorAditya Nandakumar <aditya_nandakumar@apple.com>
Thu, 23 Apr 2020 00:15:00 +0000 (17:15 -0700)
committerAditya Nandakumar <aditya_nandakumar@apple.com>
Thu, 23 Apr 2020 00:31:33 +0000 (17:31 -0700)
Loosen the restriction on what kinds of opcodes can be CSEd as
targets may want to CSE some generic target specific pseudos.
NFC as far as this change is concerned as CSEConfig still pretty much is
a subset of this check.

Differential Revision: https://reviews.llvm.org/D78684

llvm/lib/CodeGen/GlobalISel/CSEInfo.cpp

index 0e4fa21..e258ffb 100644 (file)
@@ -217,9 +217,6 @@ void GISelCSEInfo::handleRecordedInsts() {
 }
 
 bool GISelCSEInfo::shouldCSE(unsigned Opc) const {
-  // Only GISel opcodes are CSEable
-  if (!isPreISelGenericOpcode(Opc))
-    return false;
   assert(CSEOpt.get() && "CSEConfig not set");
   return CSEOpt->shouldCSEOpc(Opc);
 }