diff options
| author | River Riddle <riverriddle@google.com> | 2019-11-05 11:57:03 -0800 |
|---|---|---|
| committer | A. Unique TensorFlower <gardener@tensorflow.org> | 2019-11-05 11:57:38 -0800 |
| commit | 2366561a39d80c3c6f0f5b1257760b5a9ed2f7bd (patch) | |
| tree | cb79fed502c6e9d437b34cc1b89b5039952de79e /mlir/lib/IR/Module.cpp | |
| parent | 6d2432561c7822235091d5c58df3b8abb8732610 (diff) | |
| download | bcm5719-llvm-2366561a39d80c3c6f0f5b1257760b5a9ed2f7bd.tar.gz bcm5719-llvm-2366561a39d80c3c6f0f5b1257760b5a9ed2f7bd.zip | |
Add a PatternRewriter hook to merge blocks, and use it to support for folding branches.
A pattern rewriter hook, mergeBlock, is added that allows for merging the operations of one block into the end of another. This is used to support a canonicalization pattern for branch operations that folds the branch when the successor has a single predecessor(the branch block).
Example:
^bb0:
%c0_i32 = constant 0 : i32
br ^bb1(%c0_i32 : i32)
^bb1(%x : i32):
return %x : i32
becomes:
^bb0:
%c0_i32 = constant 0 : i32
return %c0_i32 : i32
PiperOrigin-RevId: 278677825
Diffstat (limited to 'mlir/lib/IR/Module.cpp')
0 files changed, 0 insertions, 0 deletions

