[llvm] [AArch64] Combine and and lsl into ubfiz (PR #118974)

Cullen Rhodes via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 17 07:29:22 PST 2025


c-rhodes wrote:

@alexfh thanks for reporting. Can confirm `llc r.ll` is hanging and reverting this patch fixes it.

Had a quick look at debug output can see it's stuck in a loop of:
```
  Combining: t62138: i64 = shl t62137, Constant:i64<1>
  Creating new node: t62139: i64 = shl OpaqueConstant:i64<-2401053089408754003>, Constant:i64<1>
  Creating new node: t62140: i64 = shl t6, Constant:i64<1>
  Creating new node: t62141: i64 = and t62140, t62139
   ... into: t62141: i64 = and t62140, t62139
  
  Legalizing: t62141: i64 = and t62140, t62139
  Legal node: nothing to do
  
  Combining: t62141: i64 = and t62140, t62139
  Creating new node: t62142: i64 = and t6, OpaqueConstant:i64<-2401053089408754003>
  Creating new node: t62143: i64 = shl t62142, Constant:i64<1>
   ... into: t62143: i64 = shl t62142, Constant:i64<1>
```

first combine is the one I added here and the last is `DAGCombiner::visitAND`,
specifically: https://github.com/llvm/llvm-project/blob/63b0ab84253f29f1f9b9136a02d589552b29c645/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp#L7446-L7449 and they keep undoing each other.

Will revert for now whilst I figure out a fix.

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


More information about the llvm-commits mailing list