[llvm] [AArch64] Replace AND with LSL#2 for LDR target (#34101) (PR #89531)

via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 22 06:55:40 PDT 2024


ParkHanbum wrote:

@davemgreen 
I wrote code to restore `and` back to `shl` in the visit load of DAGCombiner.

```
GEN Create new node: t26: i64 = shl t23, Constant:i64<2>
GEN : t26: i64 = shl t23, Constant:i64<2>
```

But in this case, I change `shl` to `and` again in `visitSHL`. 
```
Combining: t26: i64 = shl t23, Constant:i64<2>
Creating constant: t27: i64 = Constant<54>
Creating constant: t28: i64 = Constant<-1>
Creating constant: t29: i64 = Constant<-72057594037927936>
Creating constant: t30: i64 = Constant<1020>
Creating new node: t31: i64 = srl t7, Constant:i64<54>
Creating new node: t32: i64 = and t31, Constant:i64<1020>
 ... into: t32: i64 = and t31, Constant:i64<1020>

```
Do you have any advice on where to implement this?


https://github.com/llvm/llvm-project/pull/89531


More information about the llvm-commits mailing list