This is an archive of the discontinued LLVM Phabricator instance.

llc: Require an explicit -mtriple=default to target default triple
AbandonedPublic

Authored by MatzeB on Jul 11 2017, 6:41 PM.

Details

Summary

Putting this up for discussion with a single test adapted. (Before landing I have to add explicit -mtriple to hundreds of tests):

We have a huge number of tests that just specify -march=xxx or -mcpu=yyy
hence have no OS specified and target the default OS which differs
between machines resulting in nondeterministic tests.

This changes llc to refuse tests that have no target triple specified.
The default can still be targeted with -mtriple=default.

Diff Detail

Repository
rL LLVM

Event Timeline

MatzeB created this revision.Jul 11 2017, 6:41 PM
efriedma edited edge metadata.Jul 12 2017, 3:17 PM

Having a default architecture is convenient for messing around... if we're going to do something here, I would rather just kill off "-march".

echristo edited edge metadata.Jul 12 2017, 3:22 PM

Having a default architecture is convenient for messing around... if we're going to do something here, I would rather just kill off "-march".

I'm with Eli here. I like the canonical triple idea.

-eric

Having a default architecture is convenient for messing around... if we're going to do something here, I would rather just kill off "-march".

  • But we still have the default... you just have to use -mtriple=default to get it.
  • I'd be fine with killing off -march as well.
  • I guess I'll start fixing all those tests that just say -march to use -mtriple, as we need that change no matter what variant we choose here.
MatzeB abandoned this revision.Aug 1 2017, 5:31 PM

Ok I changed the PowerPC, X86, ARM (AArch64 wasn't necessary) targets to not use -march anymore in r309754, r309774 and r309755.
Assuming that most tests are created by copy&paste this should hopefully avoid people creating indeterministic tests that break when the default operating system changes.

So we should be fine without this change.

evandro added a subscriber: evandro.Aug 2 2017, 8:42 AM

Just a couple of ¢, if I may, but I was bitten by a difference in code generation between the ELF and MachO ABIs. This is a good move.