I encountered this issue when constant folding during inlining tried to
fold away a bitcast of a double to an x86_mmx, which is not an integral
type. The test case exposes the same issue with a smaller code snippet
during early CSE.
Details
Diff Detail
Event Timeline
Thanks for the review!
LGTM, but the test shouldn't be in CodeGen. It's not great either, but what about Transforms/EarlyCSE?
The bug isn't specific to EarlyCSE either (I originally found this when folding was invoked from the inliner). I wasn't sure where to put this but there are already a bunch of X86 constant folding tests in CodeGen/X86. It seemed consistent with past tests to put it there. Ok if I leave it there?
test/CodeGen/X86/mmx-bitcast-fold.ll | ||
---|---|---|
2 | Good idea. | |
6 | done | |
9 | done |
Yeah, I know :/
Looking at the history of ConstantFold.cpp, most changes seem to add a test to the relevant transform directory. The closest to dedicated tests seem to be Assembler/ConstantExpr*Fold*.ll.
Eh, it's even more out of place there. I thought it was possible to tickle it with:
@mmx = global x86_mmx bitcast (double 0.000000e+00 to x86_mmx)
but that's rejected.
Anyway, sorry about the pointless back and forth; LGTM in Transforms or CodeGen, your pick.
Ok, thanks. I'm going to move it back to CodeGen/X86 since that's where I see similar tests.
Perhaps x86_64-- ?