diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2017-12-14 22:05:20 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2017-12-14 22:05:20 +0000 |
| commit | 0ab0c1a201ece292fdced1f913fa257bdcb5280f (patch) | |
| tree | e896fb6f22c7ce9f2106707b0796e7cab2c2c59e /llvm/test/Transforms | |
| parent | 34ccadcea9eba33d2e410b2af843a3da602611bf (diff) | |
| download | bcm5719-llvm-0ab0c1a201ece292fdced1f913fa257bdcb5280f.tar.gz bcm5719-llvm-0ab0c1a201ece292fdced1f913fa257bdcb5280f.zip | |
[SimplifyCFG] don't sink common insts too soon (PR34603)
This should solve:
https://bugs.llvm.org/show_bug.cgi?id=34603
...by preventing SimplifyCFG from altering redundant instructions before early-cse has a chance to run.
It changes the default (canonical-forming) behavior of SimplifyCFG, so we're only doing the
sinking transform later in the optimization pipeline.
Differential Revision: https://reviews.llvm.org/D38566
llvm-svn: 320749
Diffstat (limited to 'llvm/test/Transforms')
| -rw-r--r-- | llvm/test/Transforms/PhaseOrdering/simplifycfg-options.ll | 6 | ||||
| -rw-r--r-- | llvm/test/Transforms/SimplifyCFG/no-md-sink.ll | 2 | ||||
| -rw-r--r-- | llvm/test/Transforms/SimplifyCFG/sink-common-code.ll | 2 |
3 files changed, 4 insertions, 6 deletions
diff --git a/llvm/test/Transforms/PhaseOrdering/simplifycfg-options.ll b/llvm/test/Transforms/PhaseOrdering/simplifycfg-options.ll index fcb9a552966..69346234635 100644 --- a/llvm/test/Transforms/PhaseOrdering/simplifycfg-options.ll +++ b/llvm/test/Transforms/PhaseOrdering/simplifycfg-options.ll @@ -76,10 +76,8 @@ define double @max_of_loads(double* %x, double* %y, i64 %i) { ; ALL-NEXT: [[XI:%.*]] = load double, double* [[XI_PTR]], align 8 ; ALL-NEXT: [[YI:%.*]] = load double, double* [[YI_PTR]], align 8 ; ALL-NEXT: [[CMP:%.*]] = fcmp ogt double [[XI]], [[YI]] -; ALL-NEXT: [[Y_SINK:%.*]] = select i1 [[CMP]], double* [[X]], double* [[Y]] -; ALL-NEXT: [[YI_PTR_AGAIN:%.*]] = getelementptr double, double* [[Y_SINK]], i64 [[I]] -; ALL-NEXT: [[YI_AGAIN:%.*]] = load double, double* [[YI_PTR_AGAIN]], align 8 -; ALL-NEXT: ret double [[YI_AGAIN]] +; ALL-NEXT: [[XI_YI:%.*]] = select i1 [[CMP]], double [[XI]], double [[YI]] +; ALL-NEXT: ret double [[XI_YI]] ; entry: %xi_ptr = getelementptr double, double* %x, i64 %i diff --git a/llvm/test/Transforms/SimplifyCFG/no-md-sink.ll b/llvm/test/Transforms/SimplifyCFG/no-md-sink.ll index b60327073ec..25747bfc219 100644 --- a/llvm/test/Transforms/SimplifyCFG/no-md-sink.ll +++ b/llvm/test/Transforms/SimplifyCFG/no-md-sink.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -simplifycfg -S | FileCheck %s +; RUN: opt < %s -simplifycfg -sink-common-insts -S | FileCheck %s define i1 @test1(i1 zeroext %flag, i8* %y) #0 { entry: diff --git a/llvm/test/Transforms/SimplifyCFG/sink-common-code.ll b/llvm/test/Transforms/SimplifyCFG/sink-common-code.ll index a261453661a..0ac80e5fb03 100644 --- a/llvm/test/Transforms/SimplifyCFG/sink-common-code.ll +++ b/llvm/test/Transforms/SimplifyCFG/sink-common-code.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -simplifycfg -S | FileCheck -enable-var-scope %s +; RUN: opt < %s -simplifycfg -sink-common-insts -S | FileCheck -enable-var-scope %s define zeroext i1 @test1(i1 zeroext %flag, i32 %blksA, i32 %blksB, i32 %nblks) { entry: |

