Skip to content

Commit cedb828

Browse files
Revert "[REV] Generate rev16 for all (srl (bswap x), (i64 16)) instructions"
This reverts commit 7d0d37404c613be62e84536d8efd675756160867.
1 parent 290190b commit cedb828

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Target/AArch64/AArch64InstrInfo.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2836,8 +2836,8 @@ def : InstAlias<"rev64 $Rd, $Rn", (REVXr GPR64:$Rd, GPR64:$Rn), 0>;
28362836
def : Pat<(bswap (rotr GPR32:$Rn, (i64 16))), (REV16Wr GPR32:$Rn)>;
28372837
def : Pat<(bswap (rotr GPR64:$Rn, (i64 32))), (REV32Xr GPR64:$Rn)>;
28382838

2839-
// Match (srl (bswap x), C) -> revC.
2840-
def : Pat<(srl (bswap GPR32:$Rn), (i64 16)), (REV16Wr GPR32:$Rn)>;
2839+
// Match (srl (bswap x), C) -> revC if the upper bswap bits are known zero.
2840+
def : Pat<(srl (bswap top16Zero:$Rn), (i64 16)), (REV16Wr GPR32:$Rn)>;
28412841
def : Pat<(srl (bswap top32Zero:$Rn), (i64 32)), (REV32Xr GPR64:$Rn)>;
28422842

28432843
def : Pat<(or (and (srl GPR64:$Rn, (i64 8)), (i64 0x00ff00ff00ff00ff)),

0 commit comments

Comments
 (0)