[PATCH] D26149: [DAGCombiner] Match load by bytes idiom and fold it into a single load
Hal Finkel via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 8 16:19:24 PST 2016
hfinkel added a comment.
In https://reviews.llvm.org/D26149#583791, @apilipenko wrote:
> I found that this rule doesn't interact with the worklist mechanism in the right way. When a node is changed all its direct users are added to the work list so they can be visited and updated after the definition they are using is updated. The rule I'm adding matches complex patterns with OR node roots. When a part of the pattern is updated (e.g. one of the loads) I need to revisit the OR node but it's not necessarily a direct user of the changed node. For example, I'd like the address of this load to be reassociated so it's easier to analyze:
>
> t25: i32 = add t4, Constant:i32<2>
> t26: i64 = sign_extend t25
> t27: i64 = add t2, t26
> t28: i8,ch = load<LD1[%tmp9]> t0, t27, undef:i64
> t29: i32 = zero_extend t28
> t32: i32 = shl t29, Constant:i8<8>
> t33: i32 = or t23, t32
>
>
> But I have no way to trigger OR pattern matching after it happened because OR is not a direct user of the address.
>
> What is the best way to work around this limitation?
Are you looking for AddToWorklist or AddUsersToWorklist?
https://reviews.llvm.org/D26149
More information about the llvm-commits
mailing list