2017-11-30 21:39:10 +08:00
|
|
|
; RUN: llc -ppc-gpr-icmps=all -verify-machineinstrs -mcpu=pwr7 < %s | FileCheck %s
|
|
|
|
; RUN: llc -ppc-gpr-icmps=all -verify-machineinstrs -mcpu=pwr7 -ppc-gen-isel=false < %s | FileCheck --check-prefix=CHECK-NO-ISEL %s
|
2015-03-21 11:36:02 +08:00
|
|
|
target datalayout = "E-m:e-i64:64-n32:64"
|
|
|
|
target triple = "powerpc64-unknown-linux-gnu"
|
|
|
|
|
|
|
|
; Function Attrs: nounwind readnone
|
|
|
|
define signext i32 @crbitsoff(i32 signext %v1, i32 signext %v2) #0 {
|
|
|
|
entry:
|
|
|
|
%tobool = icmp ne i32 %v1, 0
|
|
|
|
%lnot = icmp eq i32 %v2, 0
|
|
|
|
%and3 = and i1 %tobool, %lnot
|
|
|
|
%and = zext i1 %and3 to i32
|
|
|
|
ret i32 %and
|
|
|
|
|
|
|
|
; CHECK-LABEL: @crbitsoff
|
2017-01-17 04:12:26 +08:00
|
|
|
; CHECK-NO-ISEL-LABEL: @crbitsoff
|
2015-03-21 11:36:02 +08:00
|
|
|
; CHECK-DAG: cmplwi {{[0-9]+}}, 3, 0
|
|
|
|
; CHECK-DAG: li [[REG2:[0-9]+]], 1
|
|
|
|
; CHECK-DAG: cntlzw [[REG3:[0-9]+]],
|
[PowerPC] Fix the PPCInstrInfo::getInstrLatency implementation
PowerPC uses itineraries to describe processor pipelines (and dispatch-group
restrictions for P7/P8 cores). Unfortunately, the target-independent
implementation of TII.getInstrLatency calls ItinData->getStageLatency, and that
looks for the largest cycle count in the pipeline for any given instruction.
This, however, yields the wrong answer for the PPC itineraries, because we
don't encode the full pipeline. Because the functional units are fully
pipelined, we only model the initial stages (there are no relevant hazards in
the later stages to model), and so the technique employed by getStageLatency
does not really work. Instead, we should take the maximum output operand
latency, and that's what PPCInstrInfo::getInstrLatency now does.
This caused some test-case churn, including two unfortunate side effects.
First, the new arrangement of copies we get from function parameters now
sometimes blocks VSX FMA mutation (a FIXME has been added to the code and the
test cases), and we have one significant test-suite regression:
SingleSource/Benchmarks/BenchmarkGame/spectral-norm
56.4185% +/- 18.9398%
In this benchmark we have a loop with a vectorized FP divide, and it with the
new scheduling both divides end up in the same dispatch group (which in this
case seems to cause a problem, although why is not exactly clear). The grouping
structure is hard to predict from the bottom of the loop, and there may not be
much we can do to fix this.
Very few other test-suite performance effects were really significant, but
almost all weakly favor this change. However, in light of the issues
highlighted above, I've left the old behavior available via a
command-line flag.
llvm-svn: 242188
2015-07-15 04:02:02 +08:00
|
|
|
; CHECK: isel [[REG4:[0-9]+]], 0, [[REG2]]
|
2017-01-17 04:12:26 +08:00
|
|
|
; CHECK-NO-ISEL: bc 12, 2, [[TRUE:.LBB[0-9]+]]
|
|
|
|
; CHECK-NO-ISEL: ori 4, 5, 0
|
|
|
|
; CHECK-NO-ISEL-NEXT: b [[SUCCESSOR:.LBB[0-9]+]]
|
|
|
|
; CHECK-NO-ISEL: [[TRUE]]
|
|
|
|
; CHECK-NO-ISEL-NEXT: addi 4, 0, 0
|
[PowerPC] Fix the PPCInstrInfo::getInstrLatency implementation
PowerPC uses itineraries to describe processor pipelines (and dispatch-group
restrictions for P7/P8 cores). Unfortunately, the target-independent
implementation of TII.getInstrLatency calls ItinData->getStageLatency, and that
looks for the largest cycle count in the pipeline for any given instruction.
This, however, yields the wrong answer for the PPC itineraries, because we
don't encode the full pipeline. Because the functional units are fully
pipelined, we only model the initial stages (there are no relevant hazards in
the later stages to model), and so the technique employed by getStageLatency
does not really work. Instead, we should take the maximum output operand
latency, and that's what PPCInstrInfo::getInstrLatency now does.
This caused some test-case churn, including two unfortunate side effects.
First, the new arrangement of copies we get from function parameters now
sometimes blocks VSX FMA mutation (a FIXME has been added to the code and the
test cases), and we have one significant test-suite regression:
SingleSource/Benchmarks/BenchmarkGame/spectral-norm
56.4185% +/- 18.9398%
In this benchmark we have a loop with a vectorized FP divide, and it with the
new scheduling both divides end up in the same dispatch group (which in this
case seems to cause a problem, although why is not exactly clear). The grouping
structure is hard to predict from the bottom of the loop, and there may not be
much we can do to fix this.
Very few other test-suite performance effects were really significant, but
almost all weakly favor this change. However, in light of the issues
highlighted above, I've left the old behavior available via a
command-line flag.
llvm-svn: 242188
2015-07-15 04:02:02 +08:00
|
|
|
; CHECK: and 3, [[REG4]], [[REG3]]
|
2015-03-21 11:36:02 +08:00
|
|
|
; CHECK: blr
|
|
|
|
}
|
|
|
|
|
|
|
|
define signext i32 @crbitson(i32 signext %v1, i32 signext %v2) #1 {
|
|
|
|
entry:
|
|
|
|
%tobool = icmp ne i32 %v1, 0
|
|
|
|
%lnot = icmp eq i32 %v2, 0
|
|
|
|
%and3 = and i1 %tobool, %lnot
|
|
|
|
%and = zext i1 %and3 to i32
|
|
|
|
ret i32 %and
|
|
|
|
|
|
|
|
; CHECK-LABEL: @crbitson
|
2017-01-17 04:12:26 +08:00
|
|
|
; CHECK-NO-ISEL-LABEL: @crbitson
|
2017-06-07 20:23:41 +08:00
|
|
|
; CHECK-DAG: cntlzw [[REG1:[0-9]+]], 3
|
|
|
|
; CHECK-DAG: cntlzw [[REG2:[0-9]+]], 4
|
|
|
|
; CHECK: srwi [[REG3:[0-9]+]], [[REG1]], 5
|
|
|
|
; CHECK: srwi [[REG4:[0-9]+]], [[REG2]], 5
|
|
|
|
; CHECK: xori [[REG5:[0-9]+]], [[REG3]], 1
|
|
|
|
; CHECK: and 3, [[REG5]], [[REG4]]
|
|
|
|
; CHECK-NEXT: blr
|
2015-03-21 11:36:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
attributes #0 = { nounwind readnone "target-features"="-crbits" }
|
|
|
|
attributes #1 = { nounwind readnone }
|
|
|
|
|