[llvm-commits] [llvm] r86767 - in /llvm/trunk: include/llvm/Analysis/LazyValueInfo.h include/llvm/Analysis/Passes.h include/llvm/LinkAllPasses.h lib/Analysis/CMakeLists.txt lib/Analysis/LazyValueInfo.cpp test/Transforms/JumpThreading/basic.ll
Chris Lattner
sabre at nondot.org
Tue Nov 10 16:22:30 PST 2009
Author: lattner
Date: Tue Nov 10 18:22:30 2009
New Revision: 86767
URL: http://llvm.org/viewvc/llvm-project?rev=86767&view=rev
Log:
Stub out a new lazy value info pass, which will eventually
vend value constraint information to the optimizer.
Added:
llvm/trunk/include/llvm/Analysis/LazyValueInfo.h
llvm/trunk/lib/Analysis/LazyValueInfo.cpp
Modified:
llvm/trunk/include/llvm/Analysis/Passes.h
llvm/trunk/include/llvm/LinkAllPasses.h
llvm/trunk/lib/Analysis/CMakeLists.txt
llvm/trunk/test/Transforms/JumpThreading/basic.ll
Added: llvm/trunk/include/llvm/Analysis/LazyValueInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LazyValueInfo.h?rev=86767&view=auto
==============================================================================
--- llvm/trunk/include/llvm/Analysis/LazyValueInfo.h (added)
+++ llvm/trunk/include/llvm/Analysis/LazyValueInfo.h Tue Nov 10 18:22:30 2009
@@ -0,0 +1,43 @@
+//===- LazyValueInfo.h - Value constraint analysis --------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines the interface for lazy computation of value constraint
+// information.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ANALYSIS_LIVEVALUES_H
+#define LLVM_ANALYSIS_LIVEVALUES_H
+
+#include "llvm/Pass.h"
+
+namespace llvm {
+
+/// LazyValueInfo - This pass computes, caches, and vends lazy value constraint
+/// information.
+class LazyValueInfo : public FunctionPass {
+public:
+ static char ID;
+ LazyValueInfo();
+
+ virtual void getAnalysisUsage(AnalysisUsage &AU) const {
+ AU.setPreservesAll();
+ }
+ virtual void releaseMemory();
+
+ virtual bool runOnFunction(Function &F) {
+ // Fully lazy.
+ return false;
+ }
+};
+
+} // end namespace llvm
+
+#endif
+
Modified: llvm/trunk/include/llvm/Analysis/Passes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/Passes.h?rev=86767&r1=86766&r2=86767&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/Passes.h (original)
+++ llvm/trunk/include/llvm/Analysis/Passes.h Tue Nov 10 18:22:30 2009
@@ -139,6 +139,12 @@
// createLiveValuesPass - This creates an instance of the LiveValues pass.
//
FunctionPass *createLiveValuesPass();
+
+ //===--------------------------------------------------------------------===//
+ //
+ /// createLazyValueInfoPass - This creates an instance of the LazyValueInfo
+ /// pass.
+ FunctionPass *createLazyValueInfoPass();
//===--------------------------------------------------------------------===//
//
Modified: llvm/trunk/include/llvm/LinkAllPasses.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/LinkAllPasses.h?rev=86767&r1=86766&r2=86767&view=diff
==============================================================================
--- llvm/trunk/include/llvm/LinkAllPasses.h (original)
+++ llvm/trunk/include/llvm/LinkAllPasses.h Tue Nov 10 18:22:30 2009
@@ -82,6 +82,7 @@
(void) llvm::createInternalizePass(false);
(void) llvm::createLCSSAPass();
(void) llvm::createLICMPass();
+ (void) llvm::createLazyValueInfoPass();
(void) llvm::createLiveValuesPass();
(void) llvm::createLoopDependenceAnalysisPass();
(void) llvm::createLoopExtractorPass();
Modified: llvm/trunk/lib/Analysis/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CMakeLists.txt?rev=86767&r1=86766&r2=86767&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/CMakeLists.txt (original)
+++ llvm/trunk/lib/Analysis/CMakeLists.txt Tue Nov 10 18:22:30 2009
@@ -18,6 +18,7 @@
InstructionSimplify.cpp
Interval.cpp
IntervalPartition.cpp
+ LazyValueInfo.cpp
LibCallAliasAnalysis.cpp
LibCallSemantics.cpp
LiveValues.cpp
Added: llvm/trunk/lib/Analysis/LazyValueInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LazyValueInfo.cpp?rev=86767&view=auto
==============================================================================
--- llvm/trunk/lib/Analysis/LazyValueInfo.cpp (added)
+++ llvm/trunk/lib/Analysis/LazyValueInfo.cpp Tue Nov 10 18:22:30 2009
@@ -0,0 +1,31 @@
+//===- LazyValueInfo.cpp - Value constraint analysis ----------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines the interface for lazy computation of value constraint
+// information.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/Analysis/LazyValueInfo.h"
+using namespace llvm;
+
+char LazyValueInfo::ID = 0;
+static RegisterPass<LazyValueInfo>
+X("lazy-value-info", "Lazy Value Information Analysis", false, true);
+
+namespace llvm {
+ FunctionPass *createLazyValueInfoPass() { return new LazyValueInfo(); }
+}
+
+LazyValueInfo::LazyValueInfo() : FunctionPass(&ID) {
+}
+
+void LazyValueInfo::releaseMemory() {
+
+}
Modified: llvm/trunk/test/Transforms/JumpThreading/basic.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/JumpThreading/basic.ll?rev=86767&r1=86766&r2=86767&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/JumpThreading/basic.ll (original)
+++ llvm/trunk/test/Transforms/JumpThreading/basic.ll Tue Nov 10 18:22:30 2009
@@ -284,3 +284,29 @@
}
+
+
+;;; Duplicate condition to avoid xor of cond.
+define i32 @test10(i1 %cond, i1 %cond2) {
+Entry:
+; CHECK: @test10
+ %v1 = call i32 @f1()
+ br i1 %cond, label %Merge, label %F1
+
+F1:
+ br label %Merge
+
+Merge:
+ %B = phi i1 [true, %Entry], [%cond2, %F1]
+ %M = icmp eq i32 %v1, 192
+ %N = xor i1 %B, %M
+ br i1 %N, label %T2, label %F2
+
+T2:
+ ret i32 123
+
+F2:
+ ret i32 %v1
+}
+
+
More information about the llvm-commits
mailing list