Skip to content
Permalink
Browse files

Add inst simplification with fpscev.

  • Loading branch information...
sheredom committed Jun 20, 2019
1 parent 514fd8e commit efce1ce5f2649ddf447b3a6fb76bdd457284f775
Showing with 989 additions and 16 deletions.
  1. +1 −1 .travis.yml
  2. +7 −4 driver/fpscev_opt.cpp
  3. +559 −11 fpscev.cpp
  4. +422 −0 test/fp_inst_simplify.ll
@@ -25,4 +25,4 @@ script:
- cmake --build .
- ./driver/fpscev_opt ../test/fpscev.ll -o - -S -fpscev-analysis
- ./driver/fpscev_opt ../test/fast_math_propagation.ll -o - -S

- ./driver/fpscev_opt ../test/fp_inst_simplify.ll -o - -S
@@ -34,11 +34,12 @@
using namespace llvm;

namespace llvm {
extern void initializeFPScalarEvolutionPassPass(PassRegistry&);
extern void initializeFPScalarEvolutionPassPass(PassRegistry &);
extern void initializeFastMathPropagationPassPass(PassRegistry &);
extern Pass* createFPScalarEvolutionPass();
extern void initializeFPInstSimplifyPassPass(PassRegistry &);
extern Pass *createFastMathPropagationPass();
}
extern Pass *createFPInstSimplifyPass();
} // namespace llvm

static cl::opt<std::string> inputFilename(cl::Positional,
cl::desc("<input bitcode file>"),
@@ -93,13 +94,15 @@ int main(const int argc, const char *const argv[]) {
}
}

PassRegistry* const passRegistry = PassRegistry::getPassRegistry();
PassRegistry *const passRegistry = PassRegistry::getPassRegistry();

initializeFPScalarEvolutionPassPass(*passRegistry);
initializeFastMathPropagationPassPass(*passRegistry);
initializeFPInstSimplifyPassPass(*passRegistry);

legacy::PassManager passManager;
passManager.add(createFastMathPropagationPass());
passManager.add(createFPInstSimplifyPass());
passManager.run(*module);

std::error_code error;

0 comments on commit efce1ce

Please sign in to comment.
You can’t perform that action at this time.