summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/LoopStrengthReduce/X86
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2019-05-25 06:17:47 +0000
committerCraig Topper <craig.topper@intel.com>2019-05-25 06:17:47 +0000
commit46e5052b8e2de46473959797ae310c3801a7cf17 (patch)
tree3f6dc3b1591988612c57045748c78b7c1b877be2 /llvm/test/Transforms/LoopStrengthReduce/X86
parent4b08fcdeb13c0d6ebb32688e0b7b0915a1e5c9bd (diff)
downloadbcm5719-llvm-46e5052b8e2de46473959797ae310c3801a7cf17.tar.gz
bcm5719-llvm-46e5052b8e2de46473959797ae310c3801a7cf17.zip
[X86FixupLEAs] Turn optIncDec into a generic two address LEA optimizer. Support LEA64_32r properly.
INC/DEC is really a special case of a more generic issue. We should also turn leas into add reg/reg or add reg/imm regardless of the slow lea flags. This also supports LEA64_32 which has 64 bit input registers and 32 bit output registers. So we need to convert the 64 bit inputs to their 32 bit equivalents to check if they are equal to base reg. One thing to note, the original code preserved the kill flags by adding operands to the new instruction instead of using addReg. But I think tied operands aren't supposed to have the kill flag set. I dropped the kill flags, but I could probably try to preserve it in the add reg/reg case if we think its important. Not sure which operand its supposed to go on for the LEA64_32r instruction due to the super reg implicit uses. Though I'm also not sure those are needed since they were probably just created by an INSERT_SUBREG from a 32-bit input. Differential Revision: https://reviews.llvm.org/D61472 llvm-svn: 361691
Diffstat (limited to 'llvm/test/Transforms/LoopStrengthReduce/X86')
-rw-r--r--llvm/test/Transforms/LoopStrengthReduce/X86/ivchain-X86.ll8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/test/Transforms/LoopStrengthReduce/X86/ivchain-X86.ll b/llvm/test/Transforms/LoopStrengthReduce/X86/ivchain-X86.ll
index 0be39d3814a..c17f4a8a233 100644
--- a/llvm/test/Transforms/LoopStrengthReduce/X86/ivchain-X86.ll
+++ b/llvm/test/Transforms/LoopStrengthReduce/X86/ivchain-X86.ll
@@ -243,14 +243,14 @@ define void @extrastride(i8* nocapture %main, i32 %main_stride, i32* nocapture %
; X32-NEXT: # =>This Inner Loop Header: Depth=1
; X32-NEXT: movl (%ebx,%esi), %ebp
; X32-NEXT: addl (%ebx), %ebp
-; X32-NEXT: leal (%ebx,%esi), %ebx
+; X32-NEXT: addl %esi, %ebx
; X32-NEXT: addl (%esi,%ebx), %ebp
-; X32-NEXT: leal (%ebx,%esi), %ebx
+; X32-NEXT: addl %esi, %ebx
; X32-NEXT: addl (%esi,%ebx), %ebp
-; X32-NEXT: leal (%ebx,%esi), %ebx
+; X32-NEXT: addl %esi, %ebx
; X32-NEXT: addl (%esi,%ebx), %ebp
; X32-NEXT: movl %ebp, (%edx)
-; X32-NEXT: leal (%ebx,%esi), %ebx
+; X32-NEXT: addl %esi, %ebx
; X32-NEXT: addl %edi, %ebx
; X32-NEXT: addl %ecx, %edx
; X32-NEXT: decl %eax
OpenPOWER on IntegriCloud