Skip to content

Commit 215d65f

Browse files
committed
Adjust comment to more correctly clarify the limitations of this optimization
1 parent c6eb67a commit 215d65f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

llvm/lib/Transforms/Scalar/InferAlignment.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ bool inferAlignment(Function &F, AssumptionCache &AC, DominatorTree &DT) {
9595

9696
for (BasicBlock &BB : F) {
9797
// We need to reset the map for each block because alignment information
98-
// can't be propagated across blocks. This is because control flow could
99-
// be dependent on the address at runtime, making an alignment assumption
100-
// within one block not true in another. Some sort of dominator tree
101-
// approach could be better, but restricting within a basic block is correct
102-
// too.
98+
// can only be propagated from instruction A to B if A dominates B.
99+
// This is because control flow (and exception throwing) could be dependent
100+
// on the address (and its alignment) at runtime. Some sort of dominator
101+
// tree approach could be better, but doing a simple forward pass through a
102+
// single basic block is correct too.
103103
BestBasePointerAligns.clear();
104104

105105
for (Instruction &I : BB) {

0 commit comments

Comments
 (0)