This is an archive of the discontinued LLVM Phabricator instance.

[ConstantHoisting] add XFAIL test case
Changes PlannedPublic

Authored by nickdesaulniers on Jul 11 2023, 4:08 PM.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald Transcript
nickdesaulniers requested review of this revision.Jul 11 2023, 4:08 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 11 2023, 4:08 PM
nickdesaulniers planned changes to this revision.Jul 11 2023, 4:09 PM

Hi @ributzka, do you have thoughts on how best to fix this issue demonstrated by this test case?

I have a patch that avoids hoisting to the same BB; not sure yet if there's perhaps a better approach.

ributzka added inline comments.Aug 4 2023, 7:14 AM
llvm/test/Transforms/ConstantHoisting/X86/bad-cases.ll
130

Why shouldn't this expensive constant be hoisted? The 68719476704 should be hoisted out of the BB and only the add should stay in %d. Why is 68719476704 materialized twice?

nickdesaulniers added inline comments.Aug 4 2023, 9:23 AM
llvm/test/Transforms/ConstantHoisting/X86/bad-cases.ll
130

Why shouldn't this expensive constant be hoisted?

I'm not even sure it's expensive on x86_64. Pretty sure it can fit in an immediate field for stores + comparisons.

The 68719476704 should be hoisted out of the BB and only the add should stay in %d.

Sure, that would have been acceptable, too.

Why is 68719476704 materialized twice?

That's what I'm curious about; this seems like a bug in ConstantHoist, right?