Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[XCOFF][AIX] Peephole optimization for toc-data.
Followup to D101178 - peephole optimization that converts a load address instruction and a consuming load/store into just the load/store when its safe to do so. eg: converts the 2 instruction code sequence la 4, i[TD](2) stw 3, 0(4) to stw 3, i[TD](2) Differential Revision: https://reviews.llvm.org/D101470
- Loading branch information
Showing
5 changed files
with
119 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -verify-machineinstrs < %s | FileCheck %s | ||
|
||
@underaligned = dso_local global i32 123, align 1 #0 | ||
|
||
define i64 @read() { | ||
entry: | ||
%0 = load i32, ptr @underaligned, align 1 | ||
%1 = sext i32 %0 to i64 | ||
ret i64 %1 | ||
} | ||
|
||
attributes #0 = { "toc-data" } | ||
|
||
; CHECK-LABEL: .read | ||
; CHECK: la [[DEF:[0-9]+]], underaligned[TD](2) | ||
; CHCEK: lwa {{[0-9]+}}, 0([[DEF]]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters