Reapply [FastISel] Let the target decide first if it wants to materialize a constant...
[oota-llvm.git] / lib / Target / NVPTX / NVPTXFavorNonGenericAddrSpaces.cpp
index 5ca2b58746df6a4ec6680dac8ee47824d118e45a..f3a095d829e409ad026c1e0f91f79df9d6efff50 100644 (file)
@@ -63,7 +63,7 @@ public:
   static char ID;
   NVPTXFavorNonGenericAddrSpaces() : FunctionPass(ID) {}
 
-  virtual bool runOnFunction(Function &F) override;
+  bool runOnFunction(Function &F) override;
 
   /// Optimizes load/store instructions. Idx is the index of the pointer operand
   /// (0 for load, and 1 for store). Returns true if it changes anything.
@@ -111,7 +111,7 @@ static bool IsEliminableAddrSpaceCast(Operator *Cast) {
 bool NVPTXFavorNonGenericAddrSpaces::hoistAddrSpaceCastFromGEP(
     GEPOperator *GEP) {
   Operator *Cast = dyn_cast<Operator>(GEP->getPointerOperand());
-  if (Cast == nullptr)
+  if (!Cast)
     return false;
 
   if (!IsEliminableAddrSpaceCast(Cast))