Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StackColoring::remapInstructions does not remap all necessary instructions #14462

Closed
llvmbot opened this issue Oct 15, 2012 · 2 comments
Closed
Labels
bugzilla Issues migrated from bugzilla tools:opt

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Oct 15, 2012

Bugzilla Link 14090
Resolution FIXED
Resolved on Oct 23, 2012 06:49
Version trunk
OS All
Reporter LLVM Bugzilla Contributor
CC @ahatanak

Extended Description

StackColoring::remapInstructions relies on GetUnderlyingObject to return the real underlying object in order to determine if an instruction needs to be remapped.

However GetUnderlyingObject does not always do so. In the particular case I was having trouble with, the underlying object was behind a ptrtoint which GetUnderlyingObject does not cross. For example line 06 below:

00 for.body.i: ; preds = %for.body.i.lr.ph, %if.then.i.i.i.i
01 %14 = phi i32 [ %.ph32.i81, %for.body.i.lr.ph ], [ %inc.i.i.i.i, %if.then.i.i.i.i ]
02 %15 = bitcast i64* %retval.i.i to i32**
03 %16 = bitcast i64* %retval.i.i to i8*
04 call void @​llvm.lifetime.start(i64 8, i8* %16)
05 store i32* %.ph.i80, i32** %15, align 8, !tbaa !​0
06 %sunkaddr = ptrtoint i64* %retval.i.i to i32
07 %sunkaddr86 = add i32 %sunkaddr, 4
08 %sunkaddr87 = inttoptr i32 %sunkaddr86 to i32*
09 store i32 %14, i32* %sunkaddr87, align 4, !tbaa !​3
10 %17 = load i64* %retval.i.i, align 8
11 call void @​llvm.lifetime.end(i64 8, i8* %16)
12 %18 = lshr i64 %17, 32
13 %19 = trunc i64 %18 to i32
14 %shl.i.i.i = shl i32 1, %19
15 %20 = trunc i64 %17 to i32
16 br i1 %_Val, label %if.then.i.i, label %if.else.i.i

This results in incorrect alias information. Later in Machine Instruction Scheduling it seems as if updated and non-updated instructions are not aliased when indeed they are. In the example above the load on line 10 gets scheduled before the store in 09 which produces wrong results.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Oct 23, 2012

This is fixed in the trunk. Matthew, do you mind closing the bug ?

@llvmbot
Copy link
Collaborator Author

llvmbot commented Oct 23, 2012

Fixed by revision 166216.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla tools:opt
Projects
None yet
Development

No branches or pull requests

1 participant