BaseIndexOffset address analysis incorrectly ignores offsets folded
into indexed memory operations causing potential errors in alias
analysis of pre-indexed operations.
Details
- Reviewers
efriedma RKSimon hfinkel jyknight - Commits
- rG134a2c12cef9: Merging r322003: --------------------------------------------------------------…
rG6e2d03d4103d: [DAG] Teach BaseIndexOffset to correctly handle with indexed operations
rL322693: Merging r322003:
rL322003: [DAG] Teach BaseIndexOffset to correctly handle with indexed operations
Diff Detail
- Build Status
Buildable 13494 Build 13494: arc lint + arc unit
Event Timeline
I would prefer to have a regression test, but it's okay if you can't come up with a way to write one.
llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp | ||
---|---|---|
90 | Does this need to be something like "BaseIndexOffset(Base, N->getOffset(), 0, false);"? Currently, it looks like this code is discarding the increment. |
llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp | ||
---|---|---|
90 | Good catch. This won't work on pre-decrement though as we'd need the negated index. I've changed it to mark such cases as returning no information and modifying other uses to check for a null base. |
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | ||
---|---|---|
13360 | Does this null check still work properly given that BaseIndexOffset::match can return a null base? |
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | ||
---|---|---|
13360 | The indexed check @ line 13350 precludes the new case from happening here. |
Does this null check still work properly given that BaseIndexOffset::match can return a null base?