[llvm-commits] [llvm] r47755 - /llvm/trunk/lib/CodeGen/LoopAligner.cpp

Evan Cheng evan.cheng at apple.com
Fri Feb 29 09:52:15 PST 2008


Author: evancheng
Date: Fri Feb 29 11:52:15 2008
New Revision: 47755

URL: http://llvm.org/viewvc/llvm-project?rev=47755&view=rev
Log:
Fix PR2112: don't run loop aligner if target doesn't have a TargetLowering object.

Modified:
    llvm/trunk/lib/CodeGen/LoopAligner.cpp

Modified: llvm/trunk/lib/CodeGen/LoopAligner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LoopAligner.cpp?rev=47755&r1=47754&r2=47755&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/LoopAligner.cpp (original)
+++ llvm/trunk/lib/CodeGen/LoopAligner.cpp Fri Feb 29 11:52:15 2008
@@ -24,8 +24,6 @@
 
 namespace {
   class LoopAligner : public MachineFunctionPass {
-    const TargetLowering *TLI;
-
   public:
     static char ID;
     LoopAligner() : MachineFunctionPass((intptr_t)&ID) {}
@@ -51,7 +49,11 @@
   if (MLI->begin() == MLI->end())
     return false;  // No loops.
 
-  unsigned Align = MF.getTarget().getTargetLowering()->getPrefLoopAlignment();
+  const TargetLowering *TLI = MF.getTarget().getTargetLowering();
+  if (!TLI)
+    return false;
+
+  unsigned Align = TLI->getPrefLoopAlignment();
   if (!Align)
     return false;  // Don't care about loop alignment.
 





More information about the llvm-commits mailing list