[llvm] r229260 - NVPTX: Canonicalize access to function attributes, NFC

Duncan P. N. Exon Smith dexonsmith at apple.com
Sat Feb 14 07:35:43 PST 2015


Author: dexonsmith
Date: Sat Feb 14 09:35:43 2015
New Revision: 229260

URL: http://llvm.org/viewvc/llvm-project?rev=229260&view=rev
Log:
NVPTX: Canonicalize access to function attributes, NFC

Canonicalize access to function attributes to use the simpler API.

getAttributes().getAttribute(AttributeSet::FunctionIndex, Kind)
  => getFnAttribute(Kind)

getAttributes().hasAttribute(AttributeSet::FunctionIndex, Kind)
  => hasFnAttribute(Kind)

Modified:
    llvm/trunk/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp

Modified: llvm/trunk/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp?rev=229260&r1=229259&r2=229260&view=diff
==============================================================================
--- llvm/trunk/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp Sat Feb 14 09:35:43 2015
@@ -93,9 +93,7 @@ bool NVPTXDAGToDAGISel::useF32FTZ() cons
     const Function *F = MF->getFunction();
     // Otherwise, check for an nvptx-f32ftz attribute on the function
     if (F->hasFnAttribute("nvptx-f32ftz"))
-      return (F->getAttributes().getAttribute(AttributeSet::FunctionIndex,
-                                              "nvptx-f32ftz")
-                                              .getValueAsString() == "true");
+      return F->getFnAttribute("nvptx-f32ftz").getValueAsString() == "true";
     else
       return false;
   }





More information about the llvm-commits mailing list